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: <53E7DB59.6020300@roeck-us.net>
Date:	Sun, 10 Aug 2014 13:51:37 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	Oleg Nesterov <oleg@...hat.com>, Kees Cook <keescook@...omium.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andy Lutomirski <luto@...capital.net>
Subject: Re: Runtime trouble with commit dbd952127d (seccomp: introduce writer
 locking)

On 08/10/2014 12:33 PM, Oleg Nesterov wrote:
> On 08/09, Kees Cook wrote:
>> On Sat, Aug 9, 2014 at 6:47 PM, Guenter Roeck <private@...ck-us.net> wrote:
>>> Hi folks,
>>>
>>> I am having some trouble with commit dbd952127d (seccomp: introduce
>>> writer locking) when running my qemu tests on the upstream kernel.
>> Eek, sorry this is causing you trouble!
>>
>>> With powerpc, I get the following crash.
>>>
>>> ftrace: allocating 20093 entries in 59 pages
>>> ------------[ cut here ]------------
>>> kernel BUG at kernel/fork.c:1108!
>> For your tree, does this resolve to copy_seccomp()'s
>>
>>          BUG_ON(!spin_is_locked(&current->sighand->siglock));
>>
>> line?
> This is almost off-topic, and I too do not understand whats going on...
Some progress. SMP must be disabled for the problem to be seen.

The underlying spinlock structure, specifically arch_spinlock_t, is from
include/linux/spinlock_types_up.h (not as one would innocently assume
from arch/powerpc/include/asm/spinlock_types.h).

In include/linux/spinlock_types_up.h, arch_spinlock_t is defined as

typedef struct {
         /* no debug version on UP */
} arch_rwlock_t;

if spinlock debugging is disabled. With this definition, it is obviously
not possible to detect if the spinlock is locked or not. Actually, the
same file defines

#define arch_spin_is_locked(lock)       ((void)(lock), 0)

so the BUG is really not at all surprising.

That means that the broken configuration is (CONFIG_DEBUG_SPINLOCK=n, CONFIG_SMP=n).
It also means that the BUG_ON checks introduced with the seccomp commit
will cause this configuration to fail hard at least for architectures where CONFIG_SMP
can be disabled, and if those architectures use include/linux/spinlock_types_up.h.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ