The patch number 8842 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Adrian Bunk  <[EMAIL PROTECTED]>
vivi_release(): fix use-after-free


video_device_release() does kfree(), which made the following printk()
doing a use-after-free.

printk() first and release then.

Reported-by: Adrian Bunk <[EMAIL PROTECTED]>

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/vivi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -r 3f3fb810f3fc -r c0105ccaad74 linux/drivers/media/video/vivi.c
--- a/linux/drivers/media/video/vivi.c  Fri Aug 29 19:39:52 2008 -0300
+++ b/linux/drivers/media/video/vivi.c  Thu Aug 28 01:01:57 2008 +0300
@@ -1029,13 +1029,13 @@ static int vivi_release(void)
                dev = list_entry(list, struct vivi_dev, vivi_devlist);
 
                if (-1 != dev->vfd->minor) {
+                       printk(KERN_INFO "%s: unregistering /dev/video%d\n",
+                               VIVI_MODULE_NAME, dev->vfd->minor);
                        video_unregister_device(dev->vfd);
-                       printk(KERN_INFO "%s: /dev/video%d unregistered.\n",
+               } else {
+                       printk(KERN_INFO "%s: releasing /dev/video%d\n",
                                VIVI_MODULE_NAME, dev->vfd->minor);
-               } else {
                        video_device_release(dev->vfd);
-                       printk(KERN_INFO "%s: /dev/video%d released.\n",
-                               VIVI_MODULE_NAME, dev->vfd->minor);
                }
 
                kfree(dev);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/c0105ccaad74cf5c602691c7c7fbf51e5d321c9b

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to