This repository has been archived by the owner on Nov 7, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Fix buggy rsh min/max bounds tracking
[ no upstream commit ] Fix incorrect bounds tracking for RSH opcode. Commit f23cc64 ("bpf: fix range arithmetic for bpf map access") had a wrong assumption about min/max bounds. The new dst_reg->min_value needs to be derived by right shifting the max_val bounds, not min_val, and likewise new dst_reg->max_value needs to be derived by right shifting the min_val bounds, not max_val. Later stable kernels than 4.9 are not affected since bounds tracking was overall reworked and they already track this similarly as in the fix. Fixes: f23cc64 ("bpf: fix range arithmetic for bpf map access") Reported-by: Ryota Shiga (Flatt Security) Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: John Fastabend <[email protected]> Cc: Josef Bacik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information