* [PATCH 0/2] staging: rtl8192e: Fix alignment of structs and truncated writing
@ 2023-09-18 16:42 Philipp Hortmann
2023-09-18 16:43 ` [PATCH 1/2] staging: rtl8192e: Fix alignment of structs in rtllib.h to two Philipp Hortmann
2023-09-18 16:43 ` [PATCH 2/2] staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name Philipp Hortmann
0 siblings, 2 replies; 3+ messages in thread
From: Philipp Hortmann @ 2023-09-18 16:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Fix alignment of structs and compiler warning truncated writing.
Tested with rtl8192e (WLL6130-D99) in Mode n (12.2 MB/s)
Transferred this patch over wlan connection of rtl8192e.
Philipp Hortmann (2):
staging: rtl8192e: Fix alignment of structs in rtllib.h to two
staging: rtl8192e: Fix compiler warning truncated writing of
iwe.u.name
drivers/staging/rtl8192e/rtllib.h | 14 +++++++-------
drivers/staging/rtl8192e/rtllib_wx.c | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] staging: rtl8192e: Fix alignment of structs in rtllib.h to two
2023-09-18 16:42 [PATCH 0/2] staging: rtl8192e: Fix alignment of structs and truncated writing Philipp Hortmann
@ 2023-09-18 16:43 ` Philipp Hortmann
2023-09-18 16:43 ` [PATCH 2/2] staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name Philipp Hortmann
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Hortmann @ 2023-09-18 16:43 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Fix alignment of structs to even addresses to support all architectures.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 5517b9df65be..7d26910a0b16 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -642,23 +642,23 @@ struct rtllib_authentication {
__le16 status;
/*challenge*/
struct rtllib_info_element info_element[];
-} __packed;
+} __packed __aligned(2);
struct rtllib_disauth {
struct ieee80211_hdr_3addr header;
__le16 reason;
-} __packed;
+} __packed __aligned(2);
struct rtllib_disassoc {
struct ieee80211_hdr_3addr header;
__le16 reason;
-} __packed;
+} __packed __aligned(2);
struct rtllib_probe_request {
struct ieee80211_hdr_3addr header;
/* SSID, supported rates */
struct rtllib_info_element info_element[];
-} __packed;
+} __packed __aligned(2);
struct rtllib_probe_response {
struct ieee80211_hdr_3addr header;
@@ -669,7 +669,7 @@ struct rtllib_probe_response {
* CF params, IBSS params, TIM (if beacon), RSN
*/
struct rtllib_info_element info_element[];
-} __packed;
+} __packed __aligned(2);
/* Alias beacon for probe_response */
#define rtllib_beacon rtllib_probe_response
@@ -680,7 +680,7 @@ struct rtllib_assoc_request_frame {
__le16 listen_interval;
/* SSID, supported rates, RSN */
struct rtllib_info_element info_element[];
-} __packed;
+} __packed __aligned(2);
struct rtllib_assoc_response_frame {
struct ieee80211_hdr_3addr header;
@@ -688,7 +688,7 @@ struct rtllib_assoc_response_frame {
__le16 status;
__le16 aid;
struct rtllib_info_element info_element[]; /* supported rates */
-} __packed;
+} __packed __aligned(2);
struct rtllib_txb {
u8 nr_frags;
--
2.42.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name
2023-09-18 16:42 [PATCH 0/2] staging: rtl8192e: Fix alignment of structs and truncated writing Philipp Hortmann
2023-09-18 16:43 ` [PATCH 1/2] staging: rtl8192e: Fix alignment of structs in rtllib.h to two Philipp Hortmann
@ 2023-09-18 16:43 ` Philipp Hortmann
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Hortmann @ 2023-09-18 16:43 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
iwe.u.name and proto_name have both 16 bytes of space. But when writing
to iwe.u.name the first 10 bytes are used by the fixed string
"IEEE802.11". Evaluating the code shows that only the following strings
can occur in proto_name: "N-24G", "g", "b", "bg". Therefore it is
sufficient to shorten proto_name to 6 bytes.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib_wx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index e9469bfef3dd..a37250de7ba3 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -29,7 +29,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
struct iw_request_info *info)
{
char custom[MAX_CUSTOM_LEN];
- char proto_name[IFNAMSIZ];
+ char proto_name[6];
char *pname = proto_name;
char *p;
struct iw_event iwe;
--
2.42.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-18 16:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 16:42 [PATCH 0/2] staging: rtl8192e: Fix alignment of structs and truncated writing Philipp Hortmann
2023-09-18 16:43 ` [PATCH 1/2] staging: rtl8192e: Fix alignment of structs in rtllib.h to two Philipp Hortmann
2023-09-18 16:43 ` [PATCH 2/2] staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).