Patch "vhost-vdpa: fix use after free in vhost_vdpa_probe()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    vhost-vdpa: fix use after free in vhost_vdpa_probe()

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vhost-vdpa-fix-use-after-free-in-vhost_vdpa_probe.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 934fd78aa6d937efd1460179b2a54a961eec0949
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Fri Oct 27 15:12:54 2023 +0300

    vhost-vdpa: fix use after free in vhost_vdpa_probe()
    
    [ Upstream commit e07754e0a1ea2d63fb29574253d1fd7405607343 ]
    
    The put_device() calls vhost_vdpa_release_dev() which calls
    ida_simple_remove() and frees "v".  So this call to
    ida_simple_remove() is a use after free and a double free.
    
    Fixes: ebe6a354fa7e ("vhost-vdpa: Call ida_simple_remove() when failed")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Message-Id: <cf53cb61-0699-4e36-a980-94fd4268ff00@moroto.mountain>
    Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 78379ffd23363..fb590e346e43d 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1511,7 +1511,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
 
 err:
 	put_device(&v->dev);
-	ida_simple_remove(&vhost_vdpa_ida, v->minor);
 	return r;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux