OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2017 08:21:44 +0000 (10:21 +0200)
commit655da3da9bb3e35b1b4b57d7914d91fd33efde8b
treed2c32adf10a6c68968e597bad72447069da4f2c2
parentbf5b91b782e8975ec1021139c5e3bd6d3afeb980
bpf/verifier: fix min/max handling in BPF_SUB

[ Upstream commit 9305706c2e808ae59f1eb201867f82f1ddf6d7a6 ]

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: 484611357c19 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c