]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: make htab inlining more robust wrt assumptions
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 19 Aug 2017 01:12:45 +0000 (03:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Aug 2017 04:56:33 +0000 (21:56 -0700)
commit63498d8c2d8eab5f0f8ccfa3f6d2ec90a5cfc9ad
tree12d7c220c4728a59f0a53a1128bb248a34cc764d
parent6d031ecb94dcc3d046bd46dfebf30900a5e73333
bpf: make htab inlining more robust wrt assumptions

Commit 39e28bbe219f ("bpf: inline htab_map_lookup_elem()") was
making the assumption that a direct call emission to the function
__htab_map_lookup_elem() will always work out for JITs.

This is currently true since all JITs we have are for 64 bit archs,
but in case of 32 bit JITs like upcoming arm32, we get a NULL pointer
dereference when executing the call to __htab_map_lookup_elem()
since passed arguments are of a different size (due to pointer args)
than what we do out of BPF. Guard and thus limit this for now for
the current 64 bit JITs only.

Reported-by: Shubham Bansal <illusionist.neo@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/verifier.c