mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Andi Kleen <andi@firstfloor.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove BKL from sysctl(2)
Date: Wed, 23 Jan 2008 11:38:00 +0000	[thread overview]
Message-ID: <20080123113800.1cecbc59@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <p73k5m0lrxq.fsf@crumb.suse.de>

On 23 Jan 2008 12:09:05 +0100
Andi Kleen <andi@firstfloor.org> wrote:

> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > 
> > There are cases that updating the corepath name and dumping a core at the
> > same moment can result in the wrong thing being exec()'d or a file being
> > opened which is a mix of the old and new name and could go anywhere.
> > 
> > I see two variants on your patch that work
> > 
> > #1	Replace the lock_kernel with a sysctl_update mutex and fix both
> > paths
> > #2	Add locking specifically to the corename path
> 
> Doesn't that apply to pretty much all proc_dostring users, not just
> corename? 
> 
> Some of them might be already broken if their readers don't take BKL.
> Also possibly some of the proc_dointvec for multiple numbers.

Yes - that's why I am wondering if we want a general 'sysctl' mutex or
just to fix the specific case. The corename case is nasty as it is timing
dependant against user activity rather than the less interesting "root
can be silly" type of problem.

If we have a general lock we can then fix the string cases, or even add a
sysctl_string_get() type function.


  reply	other threads:[~2008-01-23 11:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 20:27 Alexey Dobriyan
2008-01-22 20:52 ` Ingo Molnar
2008-01-23 10:51 ` Alan Cox
2008-01-23 11:09   ` Andi Kleen
2008-01-23 11:38     ` Alan Cox [this message]
2008-01-24  7:56       ` Andi Kleen
2008-01-27 12:26   ` [PATCH 2/2] Race-free kernel.core_pattern Alexey Dobriyan
2008-01-27 16:49     ` Andi Kleen

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=20080123113800.1cecbc59@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®