Modify BPF descriptor assertions to assert Giant when a BPF descriptor
lock is asserted and running non-MPSAFE.
This commit is contained in:
parent
a1288c786e
commit
2418d3ccec
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127541
@ -102,7 +102,10 @@ struct bpf_d {
|
||||
|
||||
#define BPFD_LOCK(bd) mtx_lock(&(bd)->bd_mtx)
|
||||
#define BPFD_UNLOCK(bd) mtx_unlock(&(bd)->bd_mtx)
|
||||
#define BPFD_LOCK_ASSERT(bd) mtx_assert(&(bd)->bd_mtx, MA_OWNED)
|
||||
#define BPFD_LOCK_ASSERT(bd) do { \
|
||||
mtx_assert(&(bd)->bd_mtx, MA_OWNED); \
|
||||
NET_ASSERT_GIANT(); \
|
||||
} while (0)
|
||||
|
||||
/* Test whether a BPF is ready for read(). */
|
||||
#define bpf_ready(bd) \
|
||||
|
Loading…
Reference in New Issue
Block a user