summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.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/net/if_tun.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/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index b4015d7..cb9cb69 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -622,7 +622,7 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
return (fsetown(*(int *)data, &tp->tun_sigio));
case FIOGETOWN:
- *(int *)data = fgetown(tp->tun_sigio);
+ *(int *)data = fgetown(&tp->tun_sigio);
return (0);
/* This is deprecated, FIOSETOWN should be used instead. */
@@ -631,7 +631,7 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
/* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)data = -fgetown(tp->tun_sigio);
+ *(int *)data = -fgetown(&tp->tun_sigio);
return (0);
default:
OpenPOWER on IntegriCloud