This is a note to let you know that I've just added the patch titled bpf: sockmap: Check value of unused args to BPF_PROG_ATTACH to the 5.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bpf-sockmap-check-value-of-unused-args-to-bpf_prog_attach.patch and it can be found in the queue-5.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9b2b09717e1812e450782a43ca0c2790651cf380 Mon Sep 17 00:00:00 2001 From: Lorenz Bauer <lmb@xxxxxxxxxxxxxx> Date: Mon, 29 Jun 2020 10:56:27 +0100 Subject: bpf: sockmap: Check value of unused args to BPF_PROG_ATTACH From: Lorenz Bauer <lmb@xxxxxxxxxxxxxx> commit 9b2b09717e1812e450782a43ca0c2790651cf380 upstream. Using BPF_PROG_ATTACH on a sockmap program currently understands no flags or replace_bpf_fd, but accepts any value. Return EINVAL instead. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Lorenz Bauer <lmb@xxxxxxxxxxxxxx> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/20200629095630.7933-4-lmb@xxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/core/sock_map.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -70,6 +70,9 @@ int sock_map_get_from_fd(const union bpf struct fd f; int ret; + if (attr->attach_flags || attr->replace_bpf_fd) + return -EINVAL; + f = fdget(ufd); map = __bpf_map_get(f); if (IS_ERR(map)) Patches currently in stable-queue which might be from lmb@xxxxxxxxxxxxxx are queue-5.7/bpf-sockmap-check-value-of-unused-args-to-bpf_prog_attach.patch queue-5.7/bpf-sockmap-require-attach_bpf_fd-when-detaching-a-program.patch