diff options
Diffstat (limited to 'net/core/sock_map.c')
-rw-r--r-- | net/core/sock_map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 01998860afaa..eb114ee419b6 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c | |||
@@ -656,6 +656,7 @@ static int sock_hash_update_common(struct bpf_map *map, void *key, | |||
656 | struct sock *sk, u64 flags) | 656 | struct sock *sk, u64 flags) |
657 | { | 657 | { |
658 | struct bpf_htab *htab = container_of(map, struct bpf_htab, map); | 658 | struct bpf_htab *htab = container_of(map, struct bpf_htab, map); |
659 | struct inet_connection_sock *icsk = inet_csk(sk); | ||
659 | u32 key_size = map->key_size, hash; | 660 | u32 key_size = map->key_size, hash; |
660 | struct bpf_htab_elem *elem, *elem_new; | 661 | struct bpf_htab_elem *elem, *elem_new; |
661 | struct bpf_htab_bucket *bucket; | 662 | struct bpf_htab_bucket *bucket; |
@@ -666,6 +667,8 @@ static int sock_hash_update_common(struct bpf_map *map, void *key, | |||
666 | WARN_ON_ONCE(!rcu_read_lock_held()); | 667 | WARN_ON_ONCE(!rcu_read_lock_held()); |
667 | if (unlikely(flags > BPF_EXIST)) | 668 | if (unlikely(flags > BPF_EXIST)) |
668 | return -EINVAL; | 669 | return -EINVAL; |
670 | if (unlikely(icsk->icsk_ulp_data)) | ||
671 | return -EINVAL; | ||
669 | 672 | ||
670 | link = sk_psock_init_link(); | 673 | link = sk_psock_init_link(); |
671 | if (!link) | 674 | if (!link) |