diff options
author | mvs <mvs@cvs.openbsd.org> | 2021-04-01 08:39:53 +0000 |
---|---|---|
committer | mvs <mvs@cvs.openbsd.org> | 2021-04-01 08:39:53 +0000 |
commit | af8406fd802895a9cbb6c393e29475fc2627652b (patch) | |
tree | ca137eaf66e38b06dc3e1555ba8076e4bf0655d6 /sys/dev/usb | |
parent | 73ce2fbe6d0454ef375e82d697be187fa539557c (diff) |
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@
Diffstat (limited to 'sys/dev/usb')
-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; } |