Thread (3 messages) 3 messages, 3 authors, 2018-09-21

Re: [PATCH net-next] vhost_net: add a missing error return

From: Jason Wang <jasowang@redhat.com>
Date: 2018-09-21 08:16:03
Also in: kernel-janitors, kvm


On 2018年09月20日 18:01, Dan Carpenter wrote:
quoted hunk ↗ jump to hunk
We accidentally left out this error return so it leads to some use after
free bugs later on.

Fixes: 0a0be13b8fe2 ("vhost_net: batch submitting XDP buffers to underlayer sockets")
Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index dd4e0a301635..1bff6bc8161a 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1244,6 +1244,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
  		kfree(vqs);
  		kvfree(n);
  		kfree(queue);
+		return -ENOMEM;
  	}
  	n->vqs[VHOST_NET_VQ_TX].xdp = xdp;
  
Acked-by: Jason Wang <jasowang@redhat.com>

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help