summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2020-12-02 09:25:15 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-12-02 13:25:11 -0800
commit427167c0b064ed898b848209add62b4322ec7840 (patch)
tree7708fccc1fae344093e5835ee142118a1a251c2b /net/ipv6
parenta999696c547f1a8ef2ddbb9b0e77abc3f6db4ff1 (diff)
bpf: Allow bpf_{s,g}etsockopt from cgroup bind{4,6} hooks
I have to now lock/unlock socket for the bind hook execution. That shouldn't cause any overhead because the socket is unbound and shouldn't receive any traffic. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrey Ignatov <rdna@fb.com> Link: https://lore.kernel.org/bpf/20201202172516.3483656-3-sdf@google.com
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e648fbebb167..a7e3d170af51 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -451,7 +451,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
/* BPF prog is run before any checks are done so that if the prog
* changes context in a wrong way it will be caught.
*/
- err = BPF_CGROUP_RUN_PROG_INET6_BIND(sk, uaddr);
+ err = BPF_CGROUP_RUN_PROG_INET6_BIND_LOCK(sk, uaddr);
if (err)
return err;