Repository navigation
Commit 0962590
bpf: fix partial copy of map_ptr when dst is scalar
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>1 parent 3615353 commit 0962590
2 files changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3046 | 3046 | | |
3047 | 3047 | | |
3048 | 3048 | | |
3049 | | - | |
| 3049 | + | |
3050 | 3050 | | |
3051 | 3051 | | |
3052 | 3052 | | |
| |||
3076 | 3076 | | |
3077 | 3077 | | |
3078 | 3078 | | |
| 3079 | + | |
3079 | 3080 | | |
3080 | 3081 | | |
3081 | 3082 | | |
3082 | | - | |
| 3083 | + | |
3083 | 3084 | | |
3084 | 3085 | | |
3085 | 3086 | | |
| |||
3108 | 3109 | | |
3109 | 3110 | | |
3110 | 3111 | | |
3111 | | - | |
| 3112 | + | |
3112 | 3113 | | |
3113 | 3114 | | |
3114 | 3115 | | |
| |||
3134 | 3135 | | |
3135 | 3136 | | |
3136 | 3137 | | |
| 3138 | + | |
3137 | 3139 | | |
3138 | 3140 | | |
3139 | 3141 | | |
3140 | 3142 | | |
3141 | | - | |
| 3143 | + | |
3142 | 3144 | | |
3143 | 3145 | | |
3144 | 3146 | | |
| |||
0 commit comments