[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240229112250.13723-1-toke@redhat.com>
Date: Thu, 29 Feb 2024 12:22:46 +0100
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Jesper Dangaard Brouer <brouer@...hat.com>,
netdev@...r.kernel.org,
bpf@...r.kernel.org
Subject: [PATCH bpf v2 0/2] Fix hashmap overflow checks for 32-bit arches
Syzbot managed to trigger a crash by creating a DEVMAP_HASH map with a
large number of buckets because the overflow check relies on
well-defined behaviour that is only correct on 64-bit arches.
Fix the overflow checks to happen before values are rounded up.
v2:
- Fix off-by-one error in overflow check
- Apply the same fix to hashtab, where the devmap_hash code was copied
from (John)
Toke Høiland-Jørgensen (2):
bpf: Fix DEVMAP_HASH overflow check on 32-bit arches
bpf: Fix hashtab overflow check on 32-bit arches
kernel/bpf/devmap.c | 8 +++-----
kernel/bpf/hashtab.c | 10 +++++-----
2 files changed, 8 insertions(+), 10 deletions(-)
--
2.43.2
Powered by blists - more mailing lists