diff options
| author | Willem de Bruijn <willemb@google.com> | 2026-10-19 23:15:50 -0400 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-21 17:14:48 -0700 |
| commit | b0e4ea3a0cd42eccad9cc4153afcad555480b9e6 (patch) | |
| tree | c7b58dbc401b8bba41ae83926564382bbcecf53f /scripts/Makefile.thinlto | |
| parent | 9b8ae9aaa1b8e2b6c1cbf5613d3a37923cf53bc5 (diff) | |
| download | linux-b0e4ea3a0cd42eccad9cc4153afcad555480b9e6.tar.gz linux-b0e4ea3a0cd42eccad9cc4153afcad555480b9e6.zip | |
virtio-net: fix frag overflow in big packets receive
In big packets mode with guest GSO, add_recvbuf_big() posts a chain of
MAX_SKB_FRAGS + 1 pages. page_to_skb() copies only ETH_HLEN of the
first page into the linear area and adds the rest of that page as a
frag, then one frag per remaining page. A device that fills the entire
buffer therefore causes MAX_SKB_FRAGS + 1 frags, writing one
skb_frag_t past the end of skb_shinfo(skb)->frags[].
Post one page less. The buffer still fits a maximal GSO packet. A well
behaved device does not trigger this, as GSO packets are at most 64KB.
Also check the frag count in page_to_skb() before adding any frag as
defense in depth.
Fixes: 9ab86bbcf8be ("virtio_net: Defer skb allocation in receive path Date: Wed, 13 Jan 2010 12:53:38 -0800")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20261020032108.81879-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
