public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Suspicious shifting of sempid in try_atomic_semop()
@ 2002-02-27 18:17 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2002-02-27 18:17 UTC (permalink / raw)
  To: linux-kernel

In ipc/sem.c:try_atomic_semop() there is the following code:

	for (sop = sops; sop < sops + nsops; sop++) {
		...
		curr->sempid = (curr->sempid << 16) | pid;
		....
	}

it's undone in the error case:

	while (sop >= sops) {
		...
		curr->sempid >>= 16;
		...
	}

the problem is that in some cases we seem to end up with a sempid
of zero which leads to wrong returns of semctl(..., GETPID, ...)
like in

	http://www.freestandards.org/lsb/test/results/index.php?testcaseid=732

Is there a specific reason we use this shift method I have missed?

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-27 18:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-27 18:17 Suspicious shifting of sempid in try_atomic_semop() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox