]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/verifier: fix min/max handling in BPF_SUB
authorEdward Cree <ecree@solarflare.com>
Fri, 21 Jul 2017 13:37:34 +0000 (14:37 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jul 2017 21:02:55 +0000 (14:02 -0700)
commit1bacd4ac5501d91c516153d6d686fc878aab4a76
treed90dcd6dc8670134778a891336b3b3c29f86c51a
parent5b952f30ec8cde58918db8aae3c6d5c791e6bf26
bpf/verifier: fix min/max handling in BPF_SUB

We have to subtract the src max from the dst min, and vice-versa, since
 (e.g.) the smallest result comes from the largest subtrahend.

Fixes: 14f13004796b ("bpf: allow access into map value arrays")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/verifier.c