Skip to contentSkip to conversation

kill-the-BKL/vt: Prevent holding the BKL on return to userspace

PATCH Henne 2 participants 2 messages Aug 26, 2009 Char and misc drivers

lore
Share & tools
lore

Henne

author
#0 lore raw

From: Henrik Kretzschmar <[email protected]>

kill-the-BKL/vt: Prevent holding the BKL on return to userspace

Returning from a function which holds the BLK isn't a good idea, so we won't let it return from this point.
Instead we set the return variable and let the function return the normal way without BKL held.

---
This patch is only for the kill-the-BKL branch.

drivers/char/vt_ioctl.c +0 -0
index 181ff38..b3da7b3 100644
@@ -396,7 +396,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
	kbd = kbd_table + console;
	switch (cmd) {
	case TIOCLINUX:

- return tioclinux(tty, arg);
+ ret = tioclinux(tty, arg);
+ break;
+

	case KIOCSOUND:
		if (!perm)
			goto eperm;
#1 lore raw

Review

Quoted 5 lines · On Wed, 26 Aug 2009 17:31:34 +0200 Henne <[email protected]> wrote:
(quoted diff) +3 -1
 	case TIOCLINUX:
-		return tioclinux(tty, arg);
+		ret = tioclinux(tty, arg);
+		break;
+

A quick check says that Jiri Slaby fixed this in commit a115902f67ef51fbbe83e214fb761aaa9734c1ce back in June.

jon