virtio_net: fix mergeable bufs error handling
Subsystems (4)
Michael S. Tsirkin
maintainerPATCH 1/1 virtio_net: fix mergeable bufs error handling
On xdp error we try to free head_skb without having initialized it, that's clearly bogus.
--- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio_net.c +1 -1
@@ -570,7 +570,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,u16 num_buf;struct page *page;int offset; -struct sk_buff *head_skb, *curr_skb; +struct sk_buff *head_skb =NULL , *curr_skb;struct bpf_prog *xdp_prog;unsigned int truesize;
Signature · 1 line
MST
Quoted 15 lines · Michael S. Tsirkin
On xdp error we try to free
head_skbwithout having initialized it, that's clearly bogus.Fixes f600b6905015 ("virtio_net: Add XDP support")Cc John Fastabend <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/virtio_net.c +0
-0
drivers/net/virtio_net.c static struct sk_buff *receive_mergeable(struct net_device *dev, · line 576
Quoted 8 lines
drivers/net/virtio_net.c +1
-1@@ -570,7 +570,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,u16 num_buf;struct page *page;int offset; -struct sk_buff *head_skb, *curr_skb; +struct sk_buff *head_skb =NULL , *curr_skb;struct bpf_prog *xdp_prog;unsigned int truesize;
My tree (net.git HEAD is 8f1f7eeb22c16a197159cf7b35d1350695193ead) has:
head_skb = NULL;
just after the above codes.
Thanks
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
David Miller
maintainerFrom: "Michael S. Tsirkin" <[email protected]>
Date: Wed, 29 Mar 2017 15:37:37 +0300
drivers/net/virtio_net.c static struct sk_buff *receive_mergeable(struct net_device *dev, · line 576
Quoted 9 lines
drivers/net/virtio_net.c +1
-1@@ -570,7 +570,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,u16 num_buf;struct page *page;int offset; -struct sk_buff *head_skb, *curr_skb; +struct sk_buff *head_skb =NULL , *curr_skb;struct bpf_prog *xdp_prog;unsigned int truesize;
Like Jason, I see the very next line is:
head_skb = NULL;
so I don't think this is necessary.