Module Name: src Committed By: riastradh Date: Tue Mar 15 00:05:18 UTC 2022
Modified Files: src/sys/net: if_tun.c Log Message: tun(4): Fix bug introduced in previous locking change. Now that tun_lock runs at IPL_NONE, taking it does not have the side effect of disabling preemption, but pktq_enqueue assumes the caller has disabled preemption so it can safely schedule a softint. This isn't a problem in most physical network drivers because the pktq_enqueue call happens from within the driver's softint context anyway. But tun(4) is special -- here, the pktq_enqueue is triggered by a userland write to the device, which is in thread context. So let's just disable preemption in tunwrite. Reported-by: syzbot+21c2cb300f1ec2162...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.171 -r1.172 src/sys/net/if_tun.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.