From: Larry Finger <Larry.Finger@lwfinger.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Larry Finger <Larry.Finger@lwfinger.net>
Subject: [PATCH 2/2] staging: r8188eu: Fix undersized array in rtw_xmit.c
Date: Sat, 28 May 2022 16:14:52 -0500 [thread overview]
Message-ID: <20220528211452.32134-3-Larry.Finger@lwfinger.net> (raw)
In-Reply-To: <20220528211452.32134-1-Larry.Finger@lwfinger.net>
Compiling with -warray-bounds yields the following warning:
drivers/staging/r8188eu/core/rtw_xmit.c: In function ‘rtw_alloc_hwxmits’:
drivers/staging/r8188eu/core/rtw_xmit.c:1493:24: warning: array subscript 4 is outside array bounds of ‘void[64]’ [-Warray-bounds]
1493 | hwxmits[4] .sta_queue = &pxmitpriv->be_pending;
| ~~~~~~~^~~
In file included from drivers/staging/r8188eu/core/../include/osdep_service.h:19,
from drivers/staging/r8188eu/core/rtw_xmit.c:6:
In function ‘kmalloc’,
inlined from ‘kzalloc’ at ./include/linux/slab.h:733:9,
inlined from ‘rtw_alloc_hwxmits’ at drivers/staging/r8188eu/core/rtw_xmit.c:1484:23:
./include/linux/slab.h:600:24: note: at offset 64 into object of size 64 allocated by ‘kmem_cache_alloc_trace’
600 | return kmem_cache_alloc_trace(
| ^~~~~~~~~~~~~~~~~~~~~~~
601 | kmalloc_caches[kmalloc_type(flags)][index],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
602 | flags, size);
|
This warning arises because macro HWXMIT_ENTRY is too small.
Fixes commit 7884fc0a1473 ("staging: r8188eu: introduce new include dir
for RTL8188eu driver")
Fixes: 7884fc0a1473 ("staging: r8188eu: introduce new include dir for RTL8188eu driver")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/r8188eu/include/rtw_xmit.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index b2df1480d66b..27fa536f51ee 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -69,7 +69,7 @@ do { \
dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0 : (dot11txpn.val+1);\
} while (0)
-#define HWXMIT_ENTRY 4
+#define HWXMIT_ENTRY 5
#define TXDESC_SIZE 32
--
2.36.1
next prev parent reply other threads:[~2022-05-28 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-28 21:14 [PATCH 0/2] Fix some compile warnings in v5.18+ Larry Finger
2022-05-28 21:14 ` [PATCH 1/2] staging: r8188eu: Fix warning of array overflow in ioctl_linux.c Larry Finger
2022-05-28 21:14 ` Larry Finger [this message]
2022-05-28 21:32 ` [PATCH 2/2] staging: r8188eu: Fix undersized array in rtw_xmit.c Linus Torvalds
2022-05-28 21:31 ` [PATCH 0/2] Fix some compile warnings in v5.18+ Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220528211452.32134-3-Larry.Finger@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®