Skip to contentSkip to conversation

bpf: sockmap remove dead check

PATCH Applied Jann Horn 2 participants 2 messages Apr 20, 2018

Subsystems (3)
lore
Share & tools
lore

Jann Horn

author
#0 lore raw

PATCH 1/1 bpf: sockmap remove dead check

Remove dead code that bails on attr->value_size > KMALLOC_MAX_SIZE - the previous check already bails on attr->value_size != 4.

---
 kernel/bpf/sockmap.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/bpf/sockmap.c +0 -3
index 8dd9210d7db7..a3b21385e947 100644
@@ -1442,9 +1442,6 @@ static struct bpf_map *sock_map_alloc(union bpf_attr *attr)
 	    attr->value_size != 4 || attr->map_flags & ~SOCK_CREATE_FLAG_MASK)
 		return ERR_PTR(-EINVAL);
 
-	if (attr->value_size > KMALLOC_MAX_SIZE)
-		return ERR_PTR(-E2BIG);
-
 	err = bpf_tcp_ulp_register();
 	if (err && err != -EEXIST)
 		return ERR_PTR(err);
Signature · 1 line
2.17.0.484.g0c8726318c-goog
maintainer Applied
#1 lore raw
Quoted 4 lines · Jann Horn

Remove dead code that bails on attr->value_size > KMALLOC_MAX_SIZE - the previous check already bails on attr->value_size != 4.

Applied to bpf tree, thanks Jann!