Module Name: src
Committed By: rin
Date: Thu Aug 15 02:22:46 UTC 2024
Modified Files:
src/sys/net: bpf.c
Log Message:
bpf: Mark bpfread_filtops FILTEROP_MPSAFE
Fix deadlock for non-NET_MPSAFE kernel, reported as
PR kern/58531 (thanks manu@ for test).
I've confirmed that there is no new regression for ATF with
any combination of -HEAD/netbsd-10 and default/NET_MPSAFE
rump kernels (aarch64).
Although, some problems have been reported on MP-safety for
bpf(4), PR kern/58596. But, it should take some time to fix.
At the moment, commit this part in advance.
OK ozaki-r@
To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/net/bpf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.252 src/sys/net/bpf.c:1.253
--- src/sys/net/bpf.c:1.252 Mon Jul 31 17:41:18 2023
+++ src/sys/net/bpf.c Thu Aug 15 02:22:46 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.252 2023/07/31 17:41:18 christos Exp $ */
+/* $NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.252 2023/07/31 17:41:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -1611,7 +1611,7 @@ filt_bpfread(struct knote *kn, long hint
}
static const struct filterops bpfread_filtops = {
- .f_flags = FILTEROP_ISFD,
+ .f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
.f_attach = NULL,
.f_detach = filt_bpfrdetach,
.f_event = filt_bpfread,