]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: simplify __is_valid_access test on cb
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 24 Jan 2017 00:06:26 +0000 (01:06 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jan 2017 19:46:05 +0000 (14:46 -0500)
commit66dcbe6a5b83f9797800d350c85313cd7a43d72d
tree32530874eaca2c6d4678ee0bb8f82b1fc6f429ec
parent4d6edaa70fa4fed49febd66da25302fbead966d5
bpf: simplify __is_valid_access test on cb

The __is_valid_access() test for cb[] from 54c32e81b8e0 ("bpf: allow
b/h/w/dw access for bpf's cb in ctx") was done unnecessarily complex,
we can just simplify it the same way as recent fix from 5c69f4c38810
("bpf, trace: make ctx access checks more robust") did. Overflow can
never happen as size is 1/2/4/8 depending on access.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c