[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E8CF26.9050707@roeck-us.net>
Date: Mon, 11 Aug 2014 07:11:50 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Oleg Nesterov <oleg@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
CC: Kees Cook <keescook@...omium.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...capital.net>
Subject: Re: Runtime trouble with commit dbd952127d (seccomp: introduce writer
locking)
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.
Guenter
--
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