em28xx: use after free in em28xx_v4l2_close()
Subsystems (2)
PATCH 1/1 em28xx: use after free in em28xx_v4l2_close()
We need to move the unlock before the kfree(dev);
---
Applies to linux-next.
drivers/media/video/em28xx/em28xx-video.c +1 -1
@@ -2264,9 +2264,9 @@ static int em28xx_v4l2_close(struct file *filp)if (dev->state &DEV_DISCONNECTED ) {em28xx_release_resources (dev);kfree (dev->alt_max_pkt_size); +mutex_unlock (&dev->lock);kfree (dev);kfree (fh); -mutex_unlock (&dev->lock);return 0 ; }
Hi Dan,
drivers/media/video/em28xx/em28xx-video.c static int em28xx_v4l2_close(struct file *filp) · line 2265
Quoted 13 lines · Dan Carpenter
We need to move the unlock before the kfree(dev);
Signed-off-by Dan Carpenter <[email protected]>---
Applies to linux-next.drivers/media/video/em28xx/em28xx-video.c +0
-0@@ -2264,9 +2264,9 @@ static int em28xx_v4l2_close(struct file *filp)if (dev->state &DEV_DISCONNECTED ) {em28xx_release_resources (dev);
Why not unlocking here?
drivers/media/video/em28xx/em28xx-video.c static int em28xx_v4l2_close(struct file *filp) · line 2269
Quoted 5 lines
drivers/media/video/em28xx/em28xx-video.c +1
-1kfree (dev->alt_max_pkt_size); +mutex_unlock (&dev->lock);kfree (dev);kfree (fh); -mutex_unlock (&dev->lock);
Thanks,
Ezequiel.
Quoted 9 lines · Ezequiel Garcia
Hi Dan,
Quoted 6 lines · Dan Carpenter
We need to move the unlock before the kfree(dev);
Signed-off-by Dan Carpenter <[email protected]>---
Applies to linux-next.
Quoted 9 lines
drivers/media/video/em28xx/em28xx-video.c static int em28xx_v4l2_close(struct file *filp) · line 2265
Quoted 7 lines
drivers/media/video/em28xx/em28xx-video.c +0
-0@@ -2264,9 +2264,9 @@ static int em28xx_v4l2_close(struct file *filp)if (dev->state &DEV_DISCONNECTED ) {em28xx_release_resources (dev);Why not unlocking here?
I don't see a reason to prefer one over the other.
regards,
dan carpenter
Quoted 13 lines
drivers/media/video/em28xx/em28xx-video.c static int em28xx_v4l2_close(struct file *filp) · line 2269
Quoted 6 lines
drivers/media/video/em28xx/em28xx-video.c +1
-1kfree (dev->alt_max_pkt_size); +mutex_unlock (&dev->lock);kfree (dev);kfree (fh); -mutex_unlock (&dev->lock);Thanks,
Ezequiel.
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 20 lines · Dan Carpenter
Quoted 9 lines · Ezequiel Garcia
Hi Dan,
Quoted 6 lines · Dan Carpenter
We need to move the unlock before the kfree(dev);
Signed-off-by Dan Carpenter <[email protected]>---
Applies to linux-next.Quoted 9 lines
drivers/media/video/em28xx/em28xx-video.c static int em28xx_v4l2_close(struct file *filp) · line 2265
Quoted 7 lines
drivers/media/video/em28xx/em28xx-video.c +0
-0@@ -2264,9 +2264,9 @@ static int em28xx_v4l2_close(struct file *filp)if (dev->state &DEV_DISCONNECTED ) {em28xx_release_resources (dev);Why not unlocking here?
Quoted 2 lines
I don't see a reason to prefer one over the other.
Mmm, I see now what you mean,
Thanks and sorry for dumb question,
Ezequiel.