diff options
| author | 2026-10-07 17:36:07 +0000 | |
|---|---|---|
| committer | 2026-10-15 17:47:40 -0700 | |
| commit | e6974aad4bd7561ed2f1ee56acaee38e3d3c5d01 (patch) | |
| tree | 0d30fd5f10b7b5802a0110e7022be4f54dd6fe71 /scripts/Makefile.thinlto | |
| parent | net: skbuff: don't BUG() on a missing head_frag in skb_zerocopy() (diff) | |
net: skbuff: remove the BUG_ON()s from skb_shift()
skb_shift() has two BUG_ON()s. The first fires if the caller asks to
shift more than @skb holds. Nothing has been touched yet, and returning
0 already means "shifted nothing", which the TCP callers handle by
falling back. Return 0, with a DEBUG_NET_WARN_ON_ONCE() for debug
kernels.
The second fires if the frags run out before @shiftlen does, but it
only checks after the shift has been committed to both skbs, when
there's nothing left to back out to. The loop that builds the new frag
layout only writes @tgt's frag slots past its nr_frags, and the one
branch that modifies @skb's frags also finishes the shift. So if the
loop ends with bytes still left to shift, nothing visible has changed
yet. That's the same state the MAX_SKB_FRAGS bail-out inside the loop
returns 0 from. Move the check up to just before the commit and
return 0 there the same way.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261007-b4-skbuff-bug-on-v2-8-b9a5f732895b@toxicpanda.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
