Re: [Patch] SysV SHM is broken on SMP in 2.3.32

Manfred Spraul (manfreds@colorfullife.com)
Tue, 14 Dec 1999 18:14:19 +0100


"Stephen C. Tweedie" wrote:
>
> ipc_addid is where the breakage is. It selects a new ID to use, then
> does an ipc_lock() on that ID, and then installs the new ID. However,
> ipc_lock() aborts because the new ID is not yet installed, and ipc_addid
> silently ignores the error.

Ops. I first wrote ipc_addid(), and then I had to change the semantics
of ipc_lock(). Sorry

> if(ids->seq > ids->seq_max)
> ids->seq = 0;
>
> - ipc_lock(ids,id);
> ids->entries[id].p = new;
> + if (!ipc_lock(ids,id))
> + BUG();
> return id;
> }
>
The patch is wrong: now there is a window where a second cpu could see
an partially initialized structure. I'll post a patch ASAP.

--
	Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/