Repository navigation
Commit d93080c
bpf: fix partial copy of map_ptr when dst is scalar
commit 0962590 upstream.
ALU operations on pointers such as scalar_reg += map_value_ptr are
handled in adjust_ptr_min_max_vals(). Problem is however that map_ptr
and range in the register state share a union, so transferring state
through dst_reg->range = ptr_reg->range is just buggy as any new
map_ptr in the dst_reg is then truncated (or null) for subsequent
checks. Fix this by adding a raw member and use it for copying state
over to dst_reg.
Fixes: f1174f7 ("bpf/verifier: rework value tracking")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Edward Cree <ecree@solarflare.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 07a03b9 commit d93080c
2 files changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2762 | 2762 | | |
2763 | 2763 | | |
2764 | 2764 | | |
2765 | | - | |
| 2765 | + | |
2766 | 2766 | | |
2767 | 2767 | | |
2768 | 2768 | | |
| |||
2792 | 2792 | | |
2793 | 2793 | | |
2794 | 2794 | | |
| 2795 | + | |
2795 | 2796 | | |
2796 | 2797 | | |
2797 | 2798 | | |
2798 | | - | |
| 2799 | + | |
2799 | 2800 | | |
2800 | 2801 | | |
2801 | 2802 | | |
| |||
2824 | 2825 | | |
2825 | 2826 | | |
2826 | 2827 | | |
2827 | | - | |
| 2828 | + | |
2828 | 2829 | | |
2829 | 2830 | | |
2830 | 2831 | | |
| |||
2850 | 2851 | | |
2851 | 2852 | | |
2852 | 2853 | | |
| 2854 | + | |
2853 | 2855 | | |
2854 | 2856 | | |
2855 | 2857 | | |
2856 | 2858 | | |
2857 | | - | |
| 2859 | + | |
2858 | 2860 | | |
2859 | 2861 | | |
2860 | 2862 | | |
| |||
0 commit comments