aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2002-10-03 02:13:00 +0000
committerDon Lewis <truckman@FreeBSD.org>2002-10-03 02:13:00 +0000
commit91e97a8266d38eb58a566fef3ea7c2353b20fd37 (patch)
treea99f59036961904f8470031c60cd1319fed1c7b9 /sys/kern/sys_socket.c
parent5da2b58aeb4d5bc16b135ed4bea93e94dd900422 (diff)
downloadsrc-91e97a8266d38eb58a566fef3ea7c2353b20fd37.tar.gz
src-91e97a8266d38eb58a566fef3ea7c2353b20fd37.zip
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
Notes
Notes: svn path=/head/; revision=104393
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index b4a9442c697b..46e8384fe2cf 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -131,14 +131,14 @@ soo_ioctl(fp, cmd, data, active_cred, td)
return (fsetown(*(int *)data, &so->so_sigio));
case FIOGETOWN:
- *(int *)data = fgetown(so->so_sigio);
+ *(int *)data = fgetown(&so->so_sigio);
return (0);
case SIOCSPGRP:
return (fsetown(-(*(int *)data), &so->so_sigio));
case SIOCGPGRP:
- *(int *)data = -fgetown(so->so_sigio);
+ *(int *)data = -fgetown(&so->so_sigio);
return (0);
case SIOCATMARK: