Skip to contentSkip to conversation

: Fix get_compat_sigevent()

PATCH In review David S. Miller 2 participants 3 messages Apr 5, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix get_compat_sigevent()

I have no idea how a bug like this lasted so long. Anyways, obvious memset()'ing of incorrect pointer.

Please apply, thanks.

===== kernel/compat.c 1.46 vs edited =====

kernel/compat.c +1 -1
@@ -640,7 +640,7 @@
 int get_compat_sigevent(struct sigevent *event,
 		const struct compat_sigevent __user *u_event)
 {
-	memset(&event, 0, sizeof(*event));
+	memset(event, 0, sizeof(*event));
 	return (!access_ok(VERIFY_READ, u_event, sizeof(*u_event)) ||
 		__get_user(event->sigev_value.sival_int,
 			&u_event->sigev_value.sival_int) ||
#1 lore raw
Quoted 2 lines · On Mon, 4 Apr 2005 22:44:09 -0700 "David S. Miller" <[email protected]> wrote:

I have no idea how a bug like this lasted so long.

Probably because very few programs pass sigevents into the kernel ...

kernel/compat.c line 643

Quoted 2 lines
kernel/compat.c +1 -1
-	memset(&event, 0, sizeof(*event));
+	memset(event, 0, sizeof(*event));

Blush :-)

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#2 lore raw
Quoted 5 lines · On Tue, 5 Apr 2005 17:37:24 +1000 Stephen Rothwell <[email protected]> wrote:
Quoted 2 lines · On Mon, 4 Apr 2005 22:44:09 -0700 "David S. Miller" <[email protected]> wrote:

I have no idea how a bug like this lasted so long.

Probably because very few programs pass sigevents into the kernel ...

Perhaps, but this triggered an OOPS the first time I tried to run the glibc testsuite on a compat platform.

Something for the LTP folks to add I guess. :) I do run that all the time.