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  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]
Date:	Mon, 11 Aug 2014 12:51:22 -0700
From:	Kees Cook <>
To:	Guenter Roeck <>
Cc:	Oleg Nesterov <>,
	Linus Torvalds <>,
	"" <>,
	Andy Lutomirski <>
Subject: Re: Runtime trouble with commit dbd952127d (seccomp: introduce writer locking)

On Mon, Aug 11, 2014 at 7:11 AM, Guenter Roeck <> wrote:
> On 08/11/2014 04:48 AM, Oleg Nesterov wrote:
>> On 08/10, Linus Torvalds wrote:
>>> So that should just be converted to assert_spin_is_locked().
>> I still think that lockdep_assert_held() is better. Unlike
>> assert_spin_locked() it checks that this lock is held by us, and this
>> is what we want in this case.
> assert_spin_locked maps to "BUG_ON(!raw_spin_is_locked(x))"
> which it seems is exactly what the current code is doing.
> I submitted a patch to make that change to use assert_spin_locked.
> Presumably the author had a reason for using BUG_ON and not
> lockdep_assert_held(), ie to perform the checks all the time
> and not just while debugging. For me this was the safe change
> to make. Anything else should, in my opinion, come from the
> original author who introduced the code.

Thanks for the patch! Yeah, that's a weird case; I think we need some
documentation in the header file about the UP vs SMP logic when using
spin_is_locked(). I note that all other stuff gets hidden behind the
_up and _smp headers.

I don't prefer lockdep_assert_held(), though, since I want lock
failures to hit BUG. I'll apply the patch and ask James to pull it.



Kees Cook
Chrome OS Security
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists