]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/verifier: fix bounds calculation on BPF_RSH
authorEdward Cree <ecree@solarflare.com>
Tue, 19 Dec 2017 04:11:53 +0000 (20:11 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 21 Dec 2017 01:15:41 +0000 (02:15 +0100)
commite04611afe774c9048838309de05efec363a59fef
tree8cc5cc5ecf8b7b1414810542b540b9b7bb3831e6
parentd70203d328ef14c0d02014448b9498f718022737
bpf/verifier: fix bounds calculation on BPF_RSH

Incorrect signed bounds were being computed.
If the old upper signed bound was positive and the old lower signed bound was
negative, this could cause the new upper signed bound to be too low,
leading to security issues.

Fixes: c6ba22c21195 ("bpf/verifier: track signed and unsigned min/max values")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
[jannh@google.com: changed description to reflect bug impact]
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c