lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080326113806.79e84f6d@core>
Date:	Wed, 26 Mar 2008 11:38:06 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	akpm@...l.org, linux-kernel@...r.kernel.org
Subject: [PATCH] tty: drop the BKL for driver/ldisc ioctl methods

Now we have pushed the lock down we can stop wrapping the call with a
lock in the tty layer

Signed-off-by: Alan Cox <alan@...hat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc5-mm1/drivers/char/tty_io.c linux-2.6.25-rc5-mm1/drivers/char/tty_io.c
--- linux.vanilla-2.6.25-rc5-mm1/drivers/char/tty_io.c	2008-03-18 15:52:20.000000000 +0000
+++ linux-2.6.25-rc5-mm1/drivers/char/tty_io.c	2008-03-18 15:58:26.000000000 +0000
@@ -3459,11 +3582,8 @@
 		switch (cmd) {
 		case TIOCSBRK:
 		case TIOCCBRK:
-			if (tty->driver->ioctl) {
-				lock_kernel();
+			if (tty->driver->ioctl)
 				retval = tty->driver->ioctl(tty, file, cmd, arg);
-				unlock_kernel();
-			}
 			return retval;
 
 		/* These two ioctl's always return success; even if */
@@ -3584,18 +3704,14 @@
 		break;
 	}
 	if (tty->driver->ioctl) {
-		lock_kernel();
 		retval = (tty->driver->ioctl)(tty, file, cmd, arg);
-		unlock_kernel();
 		if (retval != -ENOIOCTLCMD)
 			return retval;
 	}
 	ld = tty_ldisc_ref_wait(tty);
 	retval = -EINVAL;
 	if (ld->ioctl) {
-		lock_kernel();
 		retval = ld->ioctl(tty, file, cmd, arg);
-		unlock_kernel();
 		if (retval == -ENOIOCTLCMD)
 			retval = -EINVAL;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ