[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250321110010.95217-4-enjuk@amazon.com>
Date: Fri, 21 Mar 2025 19:59:00 +0900
From: Kohei Enju <enjuk@...zon.com>
To: <bpf@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann
<daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>, "Andrii
Nakryiko" <andrii@...nel.org>, Martin KaFai Lau <martin.lau@...ux.dev>,
"Eduard Zingerman" <eddyz87@...il.com>, Song Liu <song@...nel.org>, Yonghong
Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>, Stanislav
Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, Jiri Olsa
<jolsa@...nel.org>, Peilin Ye <yepeilin@...gle.com>, Ilya Leoshkevich
<iii@...ux.ibm.com>, Kuniyuki Iwashima <kuniyu@...zon.com>,
<kohei.enju@...il.com>, Kohei Enju <enjuk@...zon.com>,
<syzbot+a5964227adc0f904549c@...kaller.appspotmail.com>
Subject: [PATCH v2 bpf-next 0/2] bpf: Fix OOB read and add tests for load-acquire/store-release
This patch series addresses an out-of-bounds read issue in
check_atomic_load/store() reported by syzkaller when an invalid register
number (MAX_BPF_REG or greater) is used.
The first patch fixes the actual bug by changing the order of validity
checks, ensuring register validity is checked before atomic_ptr_type_ok()
is called.
It also updates some tests that were assuming the previous order of checks.
The second patch adds new tests specifically for the invalid register
number case to prevent regression in the future.
Changes:
v2:
- Just swap atomic_ptr_type_ok() and check_load_mem()/check_store_reg()
- Update some tests that were assuming the previous order of checks
- Add new tests specifically for the invalid register number
v1: https://lore.kernel.org/bpf/20250314195619.23772-2-enjuk@amazon.com/
Reported-by: syzbot+a5964227adc0f904549c@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a5964227adc0f904549c
Kohei Enju (2):
bpf: Fix out-of-bounds read in check_atomic_load/store()
selftests/bpf: Add selftests for load-acquire/store-release when
register number is invalid
kernel/bpf/verifier.c | 16 +++++++++--
.../bpf/progs/verifier_load_acquire.c | 26 +++++++++++++++--
.../bpf/progs/verifier_store_release.c | 28 +++++++++++++++++--
3 files changed, 63 insertions(+), 7 deletions(-)
--
2.49.0
Powered by blists - more mailing lists