File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -6577,7 +6577,7 @@ static int check_ptr_to_map_access(struct bpf_verifier_env *env,
6577
6577
* The minimum valid offset is -MAX_BPF_STACK for writes, and
6578
6578
* -state->allocated_stack for reads.
6579
6579
*/
6580
- static int check_stack_slot_within_bounds(int off,
6580
+ static int check_stack_slot_within_bounds(s64 off,
6581
6581
struct bpf_func_state *state,
6582
6582
enum bpf_access_type t)
6583
6583
{
@@ -6606,7 +6606,7 @@ static int check_stack_access_within_bounds(
6606
6606
struct bpf_reg_state *regs = cur_regs(env);
6607
6607
struct bpf_reg_state *reg = regs + regno;
6608
6608
struct bpf_func_state *state = func(env, reg);
6609
- int min_off, max_off;
6609
+ s64 min_off, max_off;
6610
6610
int err;
6611
6611
char *err_extra;
6612
6612
@@ -6619,7 +6619,7 @@ static int check_stack_access_within_bounds(
6619
6619
err_extra = " write to";
6620
6620
6621
6621
if (tnum_is_const(reg->var_off)) {
6622
- min_off = reg->var_off.value + off;
6622
+ min_off = (s64) reg->var_off.value + off;
6623
6623
max_off = min_off + access_size;
6624
6624
} else {
6625
6625
if (reg->smax_value >= BPF_MAX_VAR_OFF ||
You can’t perform that action at this time.
0 commit comments