diff options
| author | 2017-02-07 10:08:21 +0000 | |
|---|---|---|
| committer | 2017-02-07 10:08:21 +0000 | |
| commit | a72c3688e752579552e0114fd388485bf20d7ccd (patch) | |
| tree | 699a1ee5a2ea55d0ea398c9ececaabe1d482f7a1 /sys/netinet/in.c | |
| parent | Add installurl to FILES and SEE ALSO. (diff) | |
| download | wireguard-openbsd-a72c3688e752579552e0114fd388485bf20d7ccd.tar.xz wireguard-openbsd-a72c3688e752579552e0114fd388485bf20d7ccd.zip | |
Release the NET_LOCK() before entering per-driver ioctl() routine.
This prevents a deadlock with the X server and some wireless drivers.
The real fix is to take unix domain socket code out of the NET_LOCK().
Issue reported by pirofti@ and ajacoutot@
ok tb@, stsp@, pirofti@
Diffstat (limited to 'sys/netinet/in.c')
| -rw-r--r-- | sys/netinet/in.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 2513b310d56..2cd1f56a524 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.133 2016/12/20 12:35:38 bluhm Exp $ */ +/* $OpenBSD: in.c,v 1.134 2017/02/07 10:08:21 mpi Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -390,7 +390,11 @@ in_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) default: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - return ((*ifp->if_ioctl)(ifp, cmd, data)); + /* XXXSMP breaks atomicity */ + rw_exit_write(&netlock); + error = ((*ifp->if_ioctl)(ifp, cmd, data)); + rw_enter_write(&netlock); + return (error); } return (0); } |
