lkml.org 
[lkml]   [2008]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Remove BKL from sysctl(2)
On Tue, 22 Jan 2008 23:27:27 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:

> /proc/sys part of sysctl code runs without BKL held, so BKL during
> sysctl(2) is useless. Remove misleading comment and "protection" around
> coredumping code -- kernel.core_pattern can be written without BKL.
>
> do_sysctl() and lookup in /proc/sys use identical iterators, so any locking
> bug BKL supposedly fixed in sysctl(2) code we should have in /proc/sys
> code anyway.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

NAK

The core dump locking is now totally unprotected rather than slightly
dubious. This patch needs to go in together with a parallel patch to
actually lock properly. You've made a bug worse not fixed it.

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



Alan


\
 
 \ /
  Last update: 2008-01-23 11:57    [W:0.072 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site