lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101126113700.GB28137@pma.sysgo.com>
Date:	Fri, 26 Nov 2010 12:37:00 +0100
From:	Pavel Machek <pma@...go.com>
To:	Larry Finger <Larry.Finger@...inger.net>,
	ath9k-devel@...ema.h4ckr.net, Sujith.Manoharan@...eros.com
Cc:	kernel list <linux-kernel@...r.kernel.org>,
	chunkeey@...glemail.com, linux-wireless@...r.kernel.org,
	rudolf.marek@...go.com, cko@...go.com, mfa@...go.com, anl@...go.com
Subject: [PATCH?] do structures need to be packed? [was Re: ath9k_htc vs.
 powerpc (was Re: working usb wifi card, that is still possible to buy)]

Hi!

I'm not sure if all the structures shared with hardware are properly
marked as packed. In particular, htc_rx_status contains big endian
data, so it might need packing...? Not sure about others.

...you probably do not want to apply all of this...

Unfortunately, it does not solve the problem on powerpc...
								Pavel
Signed-off-by: Pavel Machek <pma@...go.com>

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.h b/drivers/net/wireless/ath/ath9k/htc_hst.h
index 07b6509..79ef4e7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.h
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.h
@@ -89,7 +89,7 @@ struct htc_packet {
 
 	void *context;
 	u32 reserved;
-};
+} __packed;
 
 struct htc_ep_callbacks {
 	void *priv;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 7c1a34d..2afbfc0 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -127,7 +127,7 @@ struct ath_tx_status {
 	u32 evm0;
 	u32 evm1;
 	u32 evm2;
-};
+} __packed;
 
 struct ath_rx_status {
 	u32 rs_tstamp;
@@ -154,7 +154,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
-};
+} __packed;
 
 struct ath_htc_rx_status {
 	__be64 rs_tstamp;
@@ -180,7 +180,7 @@ struct ath_htc_rx_status {
 	__be32 evm0;
 	__be32 evm1;
 	__be32 evm2;
-};
+} __packed;
 
 #define ATH9K_RXERR_CRC           0x01
 #define ATH9K_RXERR_PHY           0x02
@@ -297,7 +297,7 @@ struct ar5416_desc {
 			u32 status7;
 			u32 status8;
 			u32 status9;
-		} tx;
+		} __packed tx;
 		struct {
 			u32 status0;
 			u32 status1;
@@ -308,7 +308,7 @@ struct ar5416_desc {
 			u32 status6;
 			u32 status7;
 			u32 status8;
-		} rx;
+		} __packed rx;
 	} u;
 } __packed;
 
@@ -658,7 +658,7 @@ struct ath9k_11n_rate_series {
 	u32 PktDuration;
 	u32 ChSel;
 	u32 RateFlags;
-};
+} __packed;
 
 enum ath9k_key_type {
 	ATH9K_KEY_TYPE_CLEAR,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ