diff options
author | mvs <mvs@openbsd.org> | 2021-04-01 08:39:52 +0000 |
---|---|---|
committer | mvs <mvs@openbsd.org> | 2021-04-01 08:39:52 +0000 |
commit | 99ae0d529b6d032ce4069677ab2067bf7b453da4 (patch) | |
tree | eb855c3e2ff04cc65ae351e28a434b673d4d9c6f | |
parent | Make build_crls() behave like build_chain(). If there is not auth data (diff) | |
download | wireguard-openbsd-99ae0d529b6d032ce4069677ab2067bf7b453da4.tar.xz wireguard-openbsd-99ae0d529b6d032ce4069677ab2067bf7b453da4.zip |
Push kernel lock down to umb_rtrequest().
We are going to unlock PF_ROUTE sockets. This means `if_rtrequest'
handler will be performed without kernel lock.
umb_rtrequest() calls umb_send_inet_proposal() which touches kernel lock
protected `ipv{4,6}dns' array. Also umb_rtrequest() is the only handler
which requires kernel lock to be held. So push the lock down to
umb_rtrequest() instead of grab it around `if_rtrequest' call.
This hunk was commited separately for decreases PF_ROUTE sockets
unlocking diff.
ok gerhard@ deraadt@
-rw-r--r-- | sys/dev/usb/if_umb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/if_umb.c b/sys/dev/usb/if_umb.c index 655a7f5829e..eba04afddfc 100644 --- a/sys/dev/usb/if_umb.c +++ b/sys/dev/usb/if_umb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_umb.c,v 1.42 2021/03/30 20:58:19 sthen Exp $ */ +/* $OpenBSD: if_umb.c,v 1.43 2021/04/01 08:39:52 mvs Exp $ */ /* * Copyright (c) 2016 genua mbH @@ -1053,10 +1053,12 @@ umb_rtrequest(struct ifnet *ifp, int req, struct rtentry *rt) struct umb_softc *sc = ifp->if_softc; if (req == RTM_PROPOSAL) { + KERNEL_LOCK(); umb_send_inet_proposal(sc, AF_INET); #ifdef INET6 umb_send_inet_proposal(sc, AF_INET6); #endif + KERNEL_UNLOCK(); return; } |