]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit4faf940dd869c36436ff6f0a0b20369fdf5da68b
tree32530874eaca2c6d4678ee0bb8f82b1fc6f429ec
parent187024144c6e0c82bc32ebb46f3cd0585264833e
bpf: simplify __is_valid_access test on cb

The __is_valid_access() test for cb[] from 62c7989b24db ("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 2d071c643f1c
("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