public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Bug in 2.4.0-test9 and test10 with sys_shmat()
@ 2000-11-16 16:57 Richard Jerrell
  2000-11-17 14:37 ` [Patch] " Christoph Rohland
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Jerrell @ 2000-11-16 16:57 UTC (permalink / raw)
  To: linux-kernel

Sending -1 as the shmid to shmat will cause an oops.  2.2.16 caught this
with simple boundry checking, so replace the lines

if (!shm_sb || (shmid % SEQ_MULTIPLIER) == zero_id)
                return -EINVAL;

with

if (!shm_sb || shmid < 0 || (shmid % SEQ_MULTIPLIER) == zero_id)
                return -EINVAL;

Simple program to demonstrate the bug...

#include <sys/ipc.h>
#include <sys/shm.h>

int main(void) {
	shmat(-1,0,0);
	return 0;
}

Rich
jerrell@missioncriticallinux.com


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-11-17 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-16 16:57 Bug in 2.4.0-test9 and test10 with sys_shmat() Richard Jerrell
2000-11-17 14:37 ` [Patch] " Christoph Rohland

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