public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] introduce put_pid_rcu() to fix unsafe put_pid(vc->vt_pid)
Date: Sun, 3 Dec 2006 13:02:37 -0800	[thread overview]
Message-ID: <20061203130237.761bb15d.akpm@osdl.org> (raw)
In-Reply-To: <20061201234826.GA9511@oleg>

On Sat, 2 Dec 2006 02:48:26 +0300
Oleg Nesterov <oleg@tv-sign.ru> wrote:

> drivers/char/vt_ioctl.c changes vc->vt_pid doing
> 
> 	put_pid(xchg(&vc->vt_pid, ...));
> 
> This is unsafe, put_pid() can actually free the memory while vc->vt_pid is
> still used by kill_pid(vc->vt_pid).
> 
> Add a new helper, put_pid_rcu(), which frees "struct pid" via rcu callback
> and convert vt_ioctl.c to use it.
> 


I'm a bit reluctant to go adding more tricky infrastructure (especially
100% undocumented infrastructure) on behalf of a single usage site in a
place as creepy as the VT ioctl code.

If we envisage future users of this infrastructure (and if it gets
documented) then OK.  Otherwise I'd rather just stick another bandaid into
the vt code.  Can we add some locking there, or change it to use a
task_struct* or something?

  reply	other threads:[~2006-12-03 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 23:48 [PATCH] introduce put_pid_rcu() to fix unsafe put_pid(vc->vt_pid) Oleg Nesterov
2006-12-03 21:02 ` Andrew Morton [this message]
2006-12-03 21:29   ` Oleg Nesterov
2006-12-03 23:18     ` Eric W. Biederman
2006-12-03 23:51       ` Oleg Nesterov

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=20061203130237.761bb15d.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=paulmck@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox