summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-10-03 02:13:00 +0000
committertruckman <truckman@FreeBSD.org>2002-10-03 02:13:00 +0000
commitda2757cbc5b4e67753f56890f45f5f687cc298ae (patch)
treea99f59036961904f8470031c60cd1319fed1c7b9 /sys/kern/sys_pipe.c
parentd86ebf792e644b705a6451c5a934d6fa545b3086 (diff)
downloadFreeBSD-src-da2757cbc5b4e67753f56890f45f5f687cc298ae.zip
FreeBSD-src-da2757cbc5b4e67753f56890f45f5f687cc298ae.tar.gz
In an SMP environment post-Giant it is no longer safe to blindly
dereference the struct sigio pointer without any locking. Change fgetown() to take a reference to the pointer instead of a copy of the pointer and call SIGIO_LOCK() before copying the pointer and dereferencing it. Reviewed by: rwatson
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 0931262..7acaf9d 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1204,7 +1204,7 @@ pipe_ioctl(fp, cmd, data, active_cred, td)
case FIOGETOWN:
PIPE_UNLOCK(mpipe);
- *(int *)data = fgetown(mpipe->pipe_sigio);
+ *(int *)data = fgetown(&mpipe->pipe_sigio);
return (0);
/* This is deprecated, FIOSETOWN should be used instead. */
@@ -1215,7 +1215,7 @@ pipe_ioctl(fp, cmd, data, active_cred, td)
/* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
PIPE_UNLOCK(mpipe);
- *(int *)data = -fgetown(mpipe->pipe_sigio);
+ *(int *)data = -fgetown(&mpipe->pipe_sigio);
return (0);
}
OpenPOWER on IntegriCloud