]> 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)
commit018db71a702d3d537ebcc8c1c1e8944656b85e66
tree8cc5cc5ecf8b7b1414810542b540b9b7bb3831e6
parentbe618d200410b9e26de3e0fa515c2dcf56fab946
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: 47752acf5f4f ("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