diff options
| author | Shigeru Yoshida <syoshida@redhat.com> | 2026-07-01 01:46:20 +0900 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-06 12:03:10 +0200 |
| commit | a0a558ca7e75b49e71f8c545c30e8c005e6e4e2f (patch) | |
| tree | 3c4690613efbf207ad31f959b08d91a4803b6c7c /tools/testing | |
| parent | d7a8d500d7e42837bd8dce40cb52c97c6e8706a9 (diff) | |
qede: fix off-by-one in BD ring consumption on build_skb failure
qede_rx_build_skb() and qede_tpa_rx_build_skb() do not check for a
NULL return from qede_build_skb(). When it returns NULL under memory
pressure, the functions still consume a BD from the ring before
returning NULL. The callers then recycle additional BDs, resulting in
one extra BD being consumed (off-by-one). This desynchronizes the BD
ring, which can corrupt DMA page reference counts and lead to SLUB
freelist corruption.
Commit 4e910dbe3650 ("qede: confirm skb is allocated before using")
added a NULL check inside qede_build_skb() to prevent a NULL pointer
dereference, but did not address the missing NULL checks in the
callers, making this off-by-one reachable.
Fix this by adding NULL checks for the return value of
qede_build_skb() in both qede_rx_build_skb() and
qede_tpa_rx_build_skb(), returning NULL immediately before any BD ring
manipulation.
Fixes: 8a8633978b84 ("qede: Add build_skb() support.")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Link: https://patch.msgid.link/20260630164623.3152625-1-syoshida@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions
