diff options
| author | Muhammad Bilal <meatuni001@gmail.com> | 2026-07-28 17:54:55 +0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-01 12:15:16 +0200 |
| commit | ff917923f4fb9c83717ba135ee47d7e4c1567bb7 (patch) | |
| tree | c38fd8fcf58e1937b17fdbc6518b6f8b797fc15a /tools/build/feature/test-all.c | |
| download | linux-stable-ff917923f4fb9c83717ba135ee47d7e4c1567bb7.tar.gz linux-stable-ff917923f4fb9c83717ba135ee47d7e4c1567bb7.zip | |
staging: rtl8723bs: fix OOB read in rtw_action_frame_parse()grafted
rtw_action_frame_parse() takes a frame_len parameter but never
actually checks it before indexing into the frame body:
const u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr);
...
c = frame_body[0];
...
a = frame_body[1];
frame_body already points 24 bytes (sizeof(struct
ieee80211_hdr_3addr)) into frame, so reading frame_body[0] and
frame_body[1] requires frame_len >= 26. A management action frame
shorter than that (e.g. exactly 24 bytes, the minimum a malicious
peer can send) causes a 1-2 byte out-of-bounds read.
This is reachable from rtw_cfg80211_monitor_if_xmit_entry() and
cfg80211_rtw_mgmt_tx() in ioctl_cfg80211.c, both of which pass
attacker/user-influenced frame buffers and lengths straight through.
Add the missing length check before frame_body is dereferenced.
Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Link: https://patch.msgid.link/20260728125456.32359-3-meatuni001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/build/feature/test-all.c')
| -rw-r--r-- | tools/build/feature/test-all.c | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c new file mode 100644 index 000000000..544563d62 --- /dev/null +++ b/tools/build/feature/test-all.c @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * test-all.c: Try to build all the main testcases at once. + * + * A well-configured system will have all the prereqs installed, so we can speed + * up auto-detection on such systems. + */ + +/* + * Quirk: Python headers cannot be in arbitrary places, so keep this testcase at + * the top: + */ +#define main main_test_libpython +# include "test-libpython.c" +#undef main + +#define main main_test_hello +# include "test-hello.c" +#undef main + +#define main main_test_libelf +# include "test-libelf.c" +#undef main + +#define main main_test_gettid +# include "test-gettid.c" +#undef main + +#define main main_test_glibc +# include "test-glibc.c" +#undef main + +#define main main_test_libdw +# include "test-libdw.c" +#undef main + +#define main main_test_eventfd +# include "test-eventfd.c" +#undef main + +#define main main_test_libelf_getphdrnum +# include "test-libelf-getphdrnum.c" +#undef main + +#define main main_test_libelf_gelf_getnote +# include "test-libelf-gelf_getnote.c" +#undef main + +#define main main_test_libelf_getshdrstrndx +# include "test-libelf-getshdrstrndx.c" +#undef main + +#define main main_test_libelf_zstd +# include "test-libelf-zstd.c" +#undef main + +#define main main_test_libslang +# include "test-libslang.c" +#undef main + +#define main main_test_backtrace +# include "test-backtrace.c" +#undef main + +#define main main_test_libnuma +# include "test-libnuma.c" +#undef main + +#define main main_test_numa_num_possible_cpus +# include "test-numa_num_possible_cpus.c" +#undef main + +#define main main_test_timerfd +# include "test-timerfd.c" +#undef main + +#define main main_test_stackprotector_all +# include "test-stackprotector-all.c" +#undef main + +#define main main_test_zlib +# include "test-zlib.c" +#undef main + +#define main main_test_pthread_attr_setaffinity_np +# include "test-pthread-attr-setaffinity-np.c" +#undef main + +#define main main_test_pthread_barrier +# include "test-pthread-barrier.c" +#undef main + +#define main main_test_scandirat +# include "test-scandirat.c" +#undef main + +#define main main_test_sched_getcpu +# include "test-sched_getcpu.c" +#undef main + +# if 0 +/* + * Disable babeltrace2-ctf-writer check for test-all, because the requested + * library version is not released yet in most distributions. Will + * reenable later. + */ + +#define main main_test_babeltrace2_ctf_writer +# include "test-babeltrace2-ctf-writer.c" +#undef main +#endif + +#define main main_test_lzma +# include "test-lzma.c" +#undef main + +#define main main_test_bpf +# include "test-bpf.c" +#undef main + +#define main main_test_sdt +# include "test-sdt.c" +#undef main + +#define main main_test_setns +# include "test-setns.c" +#undef main + +#define main main_test_libaio +# include "test-libaio.c" +#undef main + +#define main main_test_reallocarray +# include "test-reallocarray.c" +#undef main + +#define main main_test_libzstd +# include "test-libzstd.c" +#undef main + +#define main main_test_libtraceevent +# include "test-libtraceevent.c" +#undef main + +#define main main_test_libopenssl +# include "test-libopenssl.c" +#undef main + +int main(int argc, char *argv[]) +{ + main_test_libpython(); + main_test_hello(); + main_test_libelf(); + main_test_gettid(); + main_test_glibc(); + main_test_libdw(); + main_test_eventfd(); + main_test_libelf_getphdrnum(); + main_test_libelf_gelf_getnote(); + main_test_libelf_getshdrstrndx(); + main_test_libslang(); + main_test_backtrace(); + main_test_libnuma(); + main_test_numa_num_possible_cpus(); + main_test_timerfd(); + main_test_stackprotector_all(); + main_test_zlib(); + main_test_pthread_attr_setaffinity_np(); + main_test_pthread_barrier(); + main_test_lzma(); + main_test_bpf(); + main_test_scandirat(); + main_test_sched_getcpu(); + main_test_sdt(); + main_test_setns(); + main_test_libaio(); + main_test_reallocarray(); + main_test_libzstd(); + main_test_libtraceevent(); + main_test_libopenssl(); + + return 0; +} |
