lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201011172343.07949.arnd@arndb.de>
Date:	Wed, 17 Nov 2010 23:43:07 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Randy Dunlap <randy.dunlap@...cle.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: BKL: remove extraneous #include <smp_lock.h>

On Wednesday 17 November 2010 23:23:23 Linus Torvalds wrote:
> On Wed, Nov 17, 2010 at 2:05 PM, Randy Dunlap <randy.dunlap@...cle.com> wrote:
>
> Hmm. I think that part was a mistake, but I suspect the simplest fix
> for it is to simply get rid of "kernel_locked()". It has no other
> users than the hardirq.h one, so let's just move it there.
> 
> Something like the attached?
> 
> NOTE! The reason I only take the CONFIG_LOCK_KERNEL version from
> smp_lock.h is because:
> 
>  - LOCK_KERNEL is defined by init/Kconfig as "(SMP || PREEMPT) && BKL"
> 
>  - inside hardirq.h we only use "kernel_locked()" inside "PREEMPT && BKL"
> 
>  - so "PREEMPT && BKL" implies "LOCK_KERNEL"
> 
>  - so the !LOCK_KERNEL kernel_locked() case is irrelevant.
> 
> unless I did a thinko somewhere.
> 
> Does this work in all configurations? TOTALLY UNTESTED! Caveat emptor.

It looks completely right, thanks for diving into the problem yourself!

The script that I used to create the broken patch removed the smp_lock.h
include from all files that did not call any of lock_kernel, unlock_lernel,
release_kernel_lock and reacquire_kernel_lock, but I missed kernel_locked().

I did not find it in my own build tests, I only tested PREEMPT with BKL
disabled and vice versa and the mails about the build failure in -next
reached me after you had already pulled the patch.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ