Fwd: [PATCH] USB gadget rndis: fix struct rndis_packet_msg_type unaligned bug

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>

----------  Forwarded Message  ----------

Subject: [PATCH] USB gadget rndis: fix struct rndis_packet_msg_type unaligned bug
Date: Thursday 05 April 2007 9:02 pm
From: "Wu, Bryan" <[email protected]>
To: David Brownell <[email protected]>, [email protected], [email protected], [email protected], Andrew Morton <[email protected]>, [email protected]

On packet RX paths, skb_push() may return a pointer which is not aligned as
needed to access it as a "struct rndis_packet_msg_type".  This fixes the bug
by declaring that structure as packed, so that the issue won't appear on the
RX path or any other path.

Signed-off-by: Roy Huang <[email protected]>
Signed-off-by: Jie Zhang <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Signed-off-by: David Brownell <[email protected]>
---
 drivers/usb/gadget/rndis.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -195,7 +195,7 @@ struct rndis_packet_msg_type
 	__le32	PerPacketInfoLength;
 	__le32	VcHandle;
 	__le32	Reserved;
-};
+} __attribute__ ((packed));
 
 struct rndis_config_parameter
 {
-- 


-------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.