@@ -14405,25 +14405,25 @@ static int is_branch_taken(struct bpf_reg_state *reg1, struct bpf_reg_state *reg
14405
14405
* simply doing a BPF_K check.
14406
14406
* In JEQ/JNE cases we also adjust the var_off values.
14407
14407
*/
14408
- static void reg_set_min_max(struct bpf_reg_state *true_reg ,
14409
- struct bpf_reg_state *false_reg ,
14408
+ static void reg_set_min_max(struct bpf_reg_state *true_reg1 ,
14409
+ struct bpf_reg_state *false_reg1 ,
14410
14410
u64 uval, u32 uval32,
14411
14411
u8 opcode, bool is_jmp32)
14412
14412
{
14413
- struct tnum false_32off = tnum_subreg(false_reg ->var_off);
14414
- struct tnum false_64off = false_reg ->var_off;
14415
- struct tnum true_32off = tnum_subreg(true_reg ->var_off);
14416
- struct tnum true_64off = true_reg ->var_off;
14413
+ struct tnum false_32off = tnum_subreg(false_reg1 ->var_off);
14414
+ struct tnum false_64off = false_reg1 ->var_off;
14415
+ struct tnum true_32off = tnum_subreg(true_reg1 ->var_off);
14416
+ struct tnum true_64off = true_reg1 ->var_off;
14417
14417
s64 sval = (s64)uval;
14418
14418
s32 sval32 = (s32)uval32;
14419
14419
14420
14420
/* If the dst_reg is a pointer, we can't learn anything about its
14421
14421
* variable offset from the compare (unless src_reg were a pointer into
14422
14422
* the same object, but we don't bother with that.
14423
- * Since false_reg and true_reg have the same type by construction, we
14423
+ * Since false_reg1 and true_reg1 have the same type by construction, we
14424
14424
* only need to check one of them for pointerness.
14425
14425
*/
14426
- if (__is_pointer_value(false, false_reg ))
14426
+ if (__is_pointer_value(false, false_reg1 ))
14427
14427
return;
14428
14428
14429
14429
switch (opcode) {
@@ -14438,20 +14438,20 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14438
14438
*/
14439
14439
case BPF_JEQ:
14440
14440
if (is_jmp32) {
14441
- __mark_reg32_known(true_reg , uval32);
14442
- true_32off = tnum_subreg(true_reg ->var_off);
14441
+ __mark_reg32_known(true_reg1 , uval32);
14442
+ true_32off = tnum_subreg(true_reg1 ->var_off);
14443
14443
} else {
14444
- ___mark_reg_known(true_reg , uval);
14445
- true_64off = true_reg ->var_off;
14444
+ ___mark_reg_known(true_reg1 , uval);
14445
+ true_64off = true_reg1 ->var_off;
14446
14446
}
14447
14447
break;
14448
14448
case BPF_JNE:
14449
14449
if (is_jmp32) {
14450
- __mark_reg32_known(false_reg , uval32);
14451
- false_32off = tnum_subreg(false_reg ->var_off);
14450
+ __mark_reg32_known(false_reg1 , uval32);
14451
+ false_32off = tnum_subreg(false_reg1 ->var_off);
14452
14452
} else {
14453
- ___mark_reg_known(false_reg , uval);
14454
- false_64off = false_reg ->var_off;
14453
+ ___mark_reg_known(false_reg1 , uval);
14454
+ false_64off = false_reg1 ->var_off;
14455
14455
}
14456
14456
break;
14457
14457
case BPF_JSET:
@@ -14474,16 +14474,16 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14474
14474
u32 false_umax = opcode == BPF_JGT ? uval32 : uval32 - 1;
14475
14475
u32 true_umin = opcode == BPF_JGT ? uval32 + 1 : uval32;
14476
14476
14477
- false_reg ->u32_max_value = min(false_reg ->u32_max_value,
14477
+ false_reg1 ->u32_max_value = min(false_reg1 ->u32_max_value,
14478
14478
false_umax);
14479
- true_reg ->u32_min_value = max(true_reg ->u32_min_value,
14479
+ true_reg1 ->u32_min_value = max(true_reg1 ->u32_min_value,
14480
14480
true_umin);
14481
14481
} else {
14482
14482
u64 false_umax = opcode == BPF_JGT ? uval : uval - 1;
14483
14483
u64 true_umin = opcode == BPF_JGT ? uval + 1 : uval;
14484
14484
14485
- false_reg ->umax_value = min(false_reg ->umax_value, false_umax);
14486
- true_reg ->umin_value = max(true_reg ->umin_value, true_umin);
14485
+ false_reg1 ->umax_value = min(false_reg1 ->umax_value, false_umax);
14486
+ true_reg1 ->umin_value = max(true_reg1 ->umin_value, true_umin);
14487
14487
}
14488
14488
break;
14489
14489
}
@@ -14494,14 +14494,14 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14494
14494
s32 false_smax = opcode == BPF_JSGT ? sval32 : sval32 - 1;
14495
14495
s32 true_smin = opcode == BPF_JSGT ? sval32 + 1 : sval32;
14496
14496
14497
- false_reg ->s32_max_value = min(false_reg ->s32_max_value, false_smax);
14498
- true_reg ->s32_min_value = max(true_reg ->s32_min_value, true_smin);
14497
+ false_reg1 ->s32_max_value = min(false_reg1 ->s32_max_value, false_smax);
14498
+ true_reg1 ->s32_min_value = max(true_reg1 ->s32_min_value, true_smin);
14499
14499
} else {
14500
14500
s64 false_smax = opcode == BPF_JSGT ? sval : sval - 1;
14501
14501
s64 true_smin = opcode == BPF_JSGT ? sval + 1 : sval;
14502
14502
14503
- false_reg ->smax_value = min(false_reg ->smax_value, false_smax);
14504
- true_reg ->smin_value = max(true_reg ->smin_value, true_smin);
14503
+ false_reg1 ->smax_value = min(false_reg1 ->smax_value, false_smax);
14504
+ true_reg1 ->smin_value = max(true_reg1 ->smin_value, true_smin);
14505
14505
}
14506
14506
break;
14507
14507
}
@@ -14512,16 +14512,16 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14512
14512
u32 false_umin = opcode == BPF_JLT ? uval32 : uval32 + 1;
14513
14513
u32 true_umax = opcode == BPF_JLT ? uval32 - 1 : uval32;
14514
14514
14515
- false_reg ->u32_min_value = max(false_reg ->u32_min_value,
14515
+ false_reg1 ->u32_min_value = max(false_reg1 ->u32_min_value,
14516
14516
false_umin);
14517
- true_reg ->u32_max_value = min(true_reg ->u32_max_value,
14517
+ true_reg1 ->u32_max_value = min(true_reg1 ->u32_max_value,
14518
14518
true_umax);
14519
14519
} else {
14520
14520
u64 false_umin = opcode == BPF_JLT ? uval : uval + 1;
14521
14521
u64 true_umax = opcode == BPF_JLT ? uval - 1 : uval;
14522
14522
14523
- false_reg ->umin_value = max(false_reg ->umin_value, false_umin);
14524
- true_reg ->umax_value = min(true_reg ->umax_value, true_umax);
14523
+ false_reg1 ->umin_value = max(false_reg1 ->umin_value, false_umin);
14524
+ true_reg1 ->umax_value = min(true_reg1 ->umax_value, true_umax);
14525
14525
}
14526
14526
break;
14527
14527
}
@@ -14532,14 +14532,14 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14532
14532
s32 false_smin = opcode == BPF_JSLT ? sval32 : sval32 + 1;
14533
14533
s32 true_smax = opcode == BPF_JSLT ? sval32 - 1 : sval32;
14534
14534
14535
- false_reg ->s32_min_value = max(false_reg ->s32_min_value, false_smin);
14536
- true_reg ->s32_max_value = min(true_reg ->s32_max_value, true_smax);
14535
+ false_reg1 ->s32_min_value = max(false_reg1 ->s32_min_value, false_smin);
14536
+ true_reg1 ->s32_max_value = min(true_reg1 ->s32_max_value, true_smax);
14537
14537
} else {
14538
14538
s64 false_smin = opcode == BPF_JSLT ? sval : sval + 1;
14539
14539
s64 true_smax = opcode == BPF_JSLT ? sval - 1 : sval;
14540
14540
14541
- false_reg ->smin_value = max(false_reg ->smin_value, false_smin);
14542
- true_reg ->smax_value = min(true_reg ->smax_value, true_smax);
14541
+ false_reg1 ->smin_value = max(false_reg1 ->smin_value, false_smin);
14542
+ true_reg1 ->smax_value = min(true_reg1 ->smax_value, true_smax);
14543
14543
}
14544
14544
break;
14545
14545
}
@@ -14548,17 +14548,17 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14548
14548
}
14549
14549
14550
14550
if (is_jmp32) {
14551
- false_reg ->var_off = tnum_or(tnum_clear_subreg(false_64off),
14551
+ false_reg1 ->var_off = tnum_or(tnum_clear_subreg(false_64off),
14552
14552
tnum_subreg(false_32off));
14553
- true_reg ->var_off = tnum_or(tnum_clear_subreg(true_64off),
14553
+ true_reg1 ->var_off = tnum_or(tnum_clear_subreg(true_64off),
14554
14554
tnum_subreg(true_32off));
14555
- reg_bounds_sync(false_reg );
14556
- reg_bounds_sync(true_reg );
14555
+ reg_bounds_sync(false_reg1 );
14556
+ reg_bounds_sync(true_reg1 );
14557
14557
} else {
14558
- false_reg ->var_off = false_64off;
14559
- true_reg ->var_off = true_64off;
14560
- reg_bounds_sync(false_reg );
14561
- reg_bounds_sync(true_reg );
14558
+ false_reg1 ->var_off = false_64off;
14559
+ true_reg1 ->var_off = true_64off;
14560
+ reg_bounds_sync(false_reg1 );
14561
+ reg_bounds_sync(true_reg1 );
14562
14562
}
14563
14563
}
14564
14564
0 commit comments