Messages in this thread | | | Date | Wed, 23 Jan 2008 10:51:40 +0000 | From | Alan Cox <> | Subject | Re: [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
| |