]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/netback: Ensure protocol headers don't fall in the non-linear area
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 22 Nov 2022 09:16:59 +0000 (09:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:24:32 +0000 (11:24 +0100)
commit1a1d9be7b36ee6cbdeb9d160038834d707256e88
tree25eba44f5ed0f30646a33c863cc47122c66e97c7
parent0760acc2e6598ad4f7bd3662db2d907ef0838139
xen/netback: Ensure protocol headers don't fall in the non-linear area

[ Upstream commit ad7f402ae4f466647c3a669b8a6f3e5d4271c84a ]

In some cases, the frontend may send a packet where the protocol headers
are spread across multiple slots. This would result in netback creating
an skb where the protocol headers spill over into the non-linear area.
Some drivers and NICs don't handle this properly resulting in an
interface reset or worse.

This issue was introduced by the removal of an unconditional skb pull in
the tx path to improve performance.  Fix this without reintroducing the
pull by setting up grant copy ops for as many slots as needed to reach
the XEN_NETBACK_TX_COPY_LEN size. Adjust the rest of the code to handle
multiple copy operations per skb.

This is XSA-423 / CVE-2022-3643.

Fixes: 7e5d7753956b ("xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/xen-netback/netback.c