From a42c41be4eed3e1ce2a42038b07ce1d3420891cd Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Thu, 29 Apr 2021 18:24:24 +0200 Subject: af_xdp: workaround kernel race between poll() and sendmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior to Linux 5.6 there is a race condition between poll() and sendmsg() in the kernel. This patch protects the syscalls with a lock to prevent it, unless the NO_SYSCALL_LOCK flag is set at create time. See https://lore.kernel.org/bpf/BYAPR11MB365382C5DB1E5FCC53242609C1549@BYAPR11MB3653.namprd11.prod.outlook.com/ Type: fix Change-Id: Ie7d4f5cb41f697b11a09b6046e54d190430d76df Signed-off-by: Benoît Ganne --- src/plugins/af_xdp/unformat.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/af_xdp/unformat.c') diff --git a/src/plugins/af_xdp/unformat.c b/src/plugins/af_xdp/unformat.c index b2292464112..bb4c3048d23 100644 --- a/src/plugins/af_xdp/unformat.c +++ b/src/plugins/af_xdp/unformat.c @@ -50,6 +50,8 @@ unformat_af_xdp_create_if_args (unformat_input_t * input, va_list * vargs) args->mode = AF_XDP_MODE_COPY; else if (unformat (line_input, "zero-copy")) args->mode = AF_XDP_MODE_ZERO_COPY; + else if (unformat (line_input, "no-syscall-lock")) + args->flags |= AF_XDP_CREATE_FLAGS_NO_SYSCALL_LOCK; else { /* return failure on unknown input */ -- cgit 1.2.3-korg