All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henne <henne@nachtwindheim.de>
To: mingo@elte.hu
Cc: corbet@lwn.net, Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: kill-the-BKL/vt: Prevent holding the BKL on return to userspace
Date: Wed, 26 Aug 2009 17:31:34 +0200	[thread overview]
Message-ID: <4A955556.8000104@nachtwindheim.de> (raw)

From: Henrik Kretzschmar <henne@nachtwindheim.de>

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.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>

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

diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 181ff38..b3da7b3 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -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;



             reply	other threads:[~2009-08-26 15:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 15:31 Henne [this message]
2009-08-26 15:51 ` kill-the-BKL/vt: Prevent holding the BKL on return to userspace Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A955556.8000104@nachtwindheim.de \
    --to=henne@nachtwindheim.de \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.