lkml.org 
[lkml]   [2009]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] Char: vt_ioctl, fix BKL imbalance
Date
Stanse found (again) a BKL imbalance in vt_ioctl.

It's easily triggerable by ioctl(dev_tty_fd, VT_SETACTIVATE, NULL);

Introduced by "vt: add an activate and lock".

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
---
drivers/char/vt_ioctl.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 29c651a..6b36ee5 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -981,8 +981,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
goto eperm;

if (copy_from_user(&vsa, (struct vt_setactivate __user *)arg,
- sizeof(struct vt_setactivate)))
- return -EFAULT;
+ sizeof(struct vt_setactivate))) {
+ ret = -EFAULT;
+ goto out;
+ }
if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
ret = -ENXIO;
else {
--
1.6.4.2


\
 
 \ /
  Last update: 2009-09-23 16:15    [W:0.025 / U:0.072 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site