anolis: Revert "net: missing check virtio"
ANBZ: #22611
This reverts commit 8759fce7fb
.
The gso check added in this commit overkills normal datapath, resulting
in unexpected packet loss under some devices like vhost [0].
As this patch only fixes a possible WARN_ON_ONCE() under syzbot, which
is thought to be nonsignificant, we just revert it.
[0]
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=89add40066f9ed9abe5f7f886fe5789ff7e0c50e
Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5519
This commit is contained in:
parent
1535649a03
commit
25a462a690
|
@ -53,7 +53,6 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
|
|||
unsigned int thlen = 0;
|
||||
unsigned int p_off = 0;
|
||||
unsigned int ip_proto;
|
||||
u64 ret, remainder, gso_size;
|
||||
|
||||
if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
|
||||
switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
|
||||
|
@ -95,16 +94,6 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
|
|||
u32 off = __virtio16_to_cpu(little_endian, hdr->csum_offset);
|
||||
u32 needed = start + max_t(u32, thlen, off + sizeof(__sum16));
|
||||
|
||||
if (hdr->gso_size) {
|
||||
gso_size = __virtio16_to_cpu(little_endian, hdr->gso_size);
|
||||
ret = div64_u64_rem(skb->len, gso_size, &remainder);
|
||||
if (!(ret && (hdr->gso_size > needed) &&
|
||||
((remainder > needed) || (remainder == 0)))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
|
||||
}
|
||||
|
||||
if (!pskb_may_pull(skb, needed))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue