diff options
| author | Eric Dumazet <edumazet@kernel.org> | 2026-10-07 06:56:15 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-07 17:57:04 -0700 |
| commit | f202578efc738b883cfa04889eb97328914265a7 (patch) | |
| tree | 7592c5928610fd78eee15e095de89a1c2c0a6a41 /tools/lib/python/kdoc/python_version.py | |
| parent | a51d233ccd4889aadb71dace863525cc2b00271e (diff) | |
| download | linux-next-f202578efc738b883cfa04889eb97328914265a7.tar.gz linux-next-f202578efc738b883cfa04889eb97328914265a7.zip | |
flow_dissector: avoid u16 truncation of hlen in bpf_flow_dissect()
bpf_flow_dissect() sanitizes the offsets returned by the BPF program
with clamp_t(u16, ..., hlen).
If hlen is bigger than 65535, the upper bound is truncated before
the comparison. For instance, with hlen == 65536, both nhoff and
thoff are forced to zero, even if the program returned sane values.
This is the same class of bug as the one fixed in commit 99bda1ecbd56
("flow_dissector: avoid u16 truncation of skb->len when computing
thoff"). That fix does not cover the BPF path, because
__skb_flow_dissect() returns early when a BPF flow dissector
handles the packet.
struct bpf_flow_keys stores nhoff and thoff as u16, so cap hlen
to U16_MAX before clamping.
Found by sashiko while reviewing the commit above.
Fixes: d58e468b1112 ("flow_dissector: implements flow dissector BPF hook")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261007045616.445596-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
