Re: [PATCH] ipc,sem block sem_lock on sma->lock during sma initialization

From: Manfred Spraul
Date: Sat Nov 22 2014 - 08:56:42 EST

Hi Rik,

good catch - I completely forgot to check the initialization

On 11/22/2014 04:40 AM, Rik van Riel wrote:

newary initializes a bunch of things after the call to
ipc_addid, however some things are initialized inside
ipc_addid as well

Looking closer at newary, I suppose that it should be
possible to move those other initializations before
the call to ipc_addid. That would likely get rid of
the problem, too.

However, I also see this line in newary, and I have
no idea what protects that data:

ns->used_sems += nsems;
It should be sem_ids.rwsem, and at least according to the documentation both freeary() and newary() hold it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at