Re: [PATCH] Selinux/hooks.c: Fix a NULL pointer dereference caused by semop()

Ethan Zhao
2015-01-23T15:30:53Z

Davidlohr，

I read your commit 53dad6d3a8e5ac1af8bacc6ac2134ae1a8b085f1,
ipc: fix race with LSMs

The issue we hit without the above patch, the race may happen when
process call semctl with IPC_RMID just as Manfred Spraul mentioned:

Thread A:
IPC_RMID
-> freeary()
->wake_up_sem_queue_do()
Thread B:
->security_sem_free() semtimedop()

->ipcperms()
->ipc_rcu_putref()

If this is the only race, the bug should be fixed with your patch applied
(not verified yet on my case).

Thanks,
Ethan

On Fri, Jan 23, 2015 at 11:30 AM, Davidlohr Bueso <dave@stgolabs.net> wrote:
> On Fri, 2015-01-23 at 10:19 +0800, ethan zhao wrote:
>> > If not, what kernel
>> > version were you running when you triggered the bug?
>> To be honest, a kernel from distro, but not released, but before we
>> get it clear, we wouldn't public more.
>
> Sheesh, could Oracle be any more (ridiculously) secretive about what the
> hell kernel(s) they run... it's like pulling teeth. *sigh*
>