summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.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/bpf.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/bpf.c')
-rw-r--r--sys/net/bpf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index ee11748..faf89be 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -866,7 +866,7 @@ bpfioctl(dev, cmd, addr, flags, td)
break;
case FIOGETOWN:
- *(int *)addr = fgetown(d->bd_sigio);
+ *(int *)addr = fgetown(&d->bd_sigio);
break;
/* This is deprecated, FIOSETOWN should be used instead. */
@@ -876,7 +876,7 @@ bpfioctl(dev, cmd, addr, flags, td)
/* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)addr = -fgetown(d->bd_sigio);
+ *(int *)addr = -fgetown(&d->bd_sigio);
break;
case BIOCSRSIG: /* Set receive signal */
OpenPOWER on IntegriCloud