Modify BPF descriptor assertions to assert Giant when a BPF descriptor
lock is asserted and running non-MPSAFE.
This commit is contained in:
parent
0feec33757
commit
8a581b46e3
@ -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