@@ -14384,25 +14384,25 @@ static int is_branch_taken(struct bpf_reg_state *reg1, struct bpf_reg_state *reg
14384
14384
* simply doing a BPF_K check.
14385
14385
* In JEQ/JNE cases we also adjust the var_off values.
14386
14386
*/
14387
- static void reg_set_min_max(struct bpf_reg_state *true_reg ,
14388
- struct bpf_reg_state *false_reg ,
14387
+ static void reg_set_min_max(struct bpf_reg_state *true_reg1 ,
14388
+ struct bpf_reg_state *false_reg1 ,
14389
14389
u64 uval, u32 uval32,
14390
14390
u8 opcode, bool is_jmp32)
14391
14391
{
14392
- struct tnum false_32off = tnum_subreg(false_reg ->var_off);
14393
- struct tnum false_64off = false_reg ->var_off;
14394
- struct tnum true_32off = tnum_subreg(true_reg ->var_off);
14395
- struct tnum true_64off = true_reg ->var_off;
14392
+ struct tnum false_32off = tnum_subreg(false_reg1 ->var_off);
14393
+ struct tnum false_64off = false_reg1 ->var_off;
14394
+ struct tnum true_32off = tnum_subreg(true_reg1 ->var_off);
14395
+ struct tnum true_64off = true_reg1 ->var_off;
14396
14396
s64 sval = (s64)uval;
14397
14397
s32 sval32 = (s32)uval32;
14398
14398
14399
14399
/* If the dst_reg is a pointer, we can't learn anything about its
14400
14400
* variable offset from the compare (unless src_reg were a pointer into
14401
14401
* the same object, but we don't bother with that.
14402
- * Since false_reg and true_reg have the same type by construction, we
14402
+ * Since false_reg1 and true_reg1 have the same type by construction, we
14403
14403
* only need to check one of them for pointerness.
14404
14404
*/
14405
- if (__is_pointer_value(false, false_reg ))
14405
+ if (__is_pointer_value(false, false_reg1 ))
14406
14406
return;
14407
14407
14408
14408
switch (opcode) {
@@ -14417,20 +14417,20 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14417
14417
*/
14418
14418
case BPF_JEQ:
14419
14419
if (is_jmp32) {
14420
- __mark_reg32_known(true_reg , uval32);
14421
- true_32off = tnum_subreg(true_reg ->var_off);
14420
+ __mark_reg32_known(true_reg1 , uval32);
14421
+ true_32off = tnum_subreg(true_reg1 ->var_off);
14422
14422
} else {
14423
- ___mark_reg_known(true_reg , uval);
14424
- true_64off = true_reg ->var_off;
14423
+ ___mark_reg_known(true_reg1 , uval);
14424
+ true_64off = true_reg1 ->var_off;
14425
14425
}
14426
14426
break;
14427
14427
case BPF_JNE:
14428
14428
if (is_jmp32) {
14429
- __mark_reg32_known(false_reg , uval32);
14430
- false_32off = tnum_subreg(false_reg ->var_off);
14429
+ __mark_reg32_known(false_reg1 , uval32);
14430
+ false_32off = tnum_subreg(false_reg1 ->var_off);
14431
14431
} else {
14432
- ___mark_reg_known(false_reg , uval);
14433
- false_64off = false_reg ->var_off;
14432
+ ___mark_reg_known(false_reg1 , uval);
14433
+ false_64off = false_reg1 ->var_off;
14434
14434
}
14435
14435
break;
14436
14436
case BPF_JSET:
@@ -14453,16 +14453,16 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14453
14453
u32 false_umax = opcode == BPF_JGT ? uval32 : uval32 - 1;
14454
14454
u32 true_umin = opcode == BPF_JGT ? uval32 + 1 : uval32;
14455
14455
14456
- false_reg ->u32_max_value = min(false_reg ->u32_max_value,
14456
+ false_reg1 ->u32_max_value = min(false_reg1 ->u32_max_value,
14457
14457
false_umax);
14458
- true_reg ->u32_min_value = max(true_reg ->u32_min_value,
14458
+ true_reg1 ->u32_min_value = max(true_reg1 ->u32_min_value,
14459
14459
true_umin);
14460
14460
} else {
14461
14461
u64 false_umax = opcode == BPF_JGT ? uval : uval - 1;
14462
14462
u64 true_umin = opcode == BPF_JGT ? uval + 1 : uval;
14463
14463
14464
- false_reg ->umax_value = min(false_reg ->umax_value, false_umax);
14465
- true_reg ->umin_value = max(true_reg ->umin_value, true_umin);
14464
+ false_reg1 ->umax_value = min(false_reg1 ->umax_value, false_umax);
14465
+ true_reg1 ->umin_value = max(true_reg1 ->umin_value, true_umin);
14466
14466
}
14467
14467
break;
14468
14468
}
@@ -14473,14 +14473,14 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14473
14473
s32 false_smax = opcode == BPF_JSGT ? sval32 : sval32 - 1;
14474
14474
s32 true_smin = opcode == BPF_JSGT ? sval32 + 1 : sval32;
14475
14475
14476
- false_reg ->s32_max_value = min(false_reg ->s32_max_value, false_smax);
14477
- true_reg ->s32_min_value = max(true_reg ->s32_min_value, true_smin);
14476
+ false_reg1 ->s32_max_value = min(false_reg1 ->s32_max_value, false_smax);
14477
+ true_reg1 ->s32_min_value = max(true_reg1 ->s32_min_value, true_smin);
14478
14478
} else {
14479
14479
s64 false_smax = opcode == BPF_JSGT ? sval : sval - 1;
14480
14480
s64 true_smin = opcode == BPF_JSGT ? sval + 1 : sval;
14481
14481
14482
- false_reg ->smax_value = min(false_reg ->smax_value, false_smax);
14483
- true_reg ->smin_value = max(true_reg ->smin_value, true_smin);
14482
+ false_reg1 ->smax_value = min(false_reg1 ->smax_value, false_smax);
14483
+ true_reg1 ->smin_value = max(true_reg1 ->smin_value, true_smin);
14484
14484
}
14485
14485
break;
14486
14486
}
@@ -14491,16 +14491,16 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14491
14491
u32 false_umin = opcode == BPF_JLT ? uval32 : uval32 + 1;
14492
14492
u32 true_umax = opcode == BPF_JLT ? uval32 - 1 : uval32;
14493
14493
14494
- false_reg ->u32_min_value = max(false_reg ->u32_min_value,
14494
+ false_reg1 ->u32_min_value = max(false_reg1 ->u32_min_value,
14495
14495
false_umin);
14496
- true_reg ->u32_max_value = min(true_reg ->u32_max_value,
14496
+ true_reg1 ->u32_max_value = min(true_reg1 ->u32_max_value,
14497
14497
true_umax);
14498
14498
} else {
14499
14499
u64 false_umin = opcode == BPF_JLT ? uval : uval + 1;
14500
14500
u64 true_umax = opcode == BPF_JLT ? uval - 1 : uval;
14501
14501
14502
- false_reg ->umin_value = max(false_reg ->umin_value, false_umin);
14503
- true_reg ->umax_value = min(true_reg ->umax_value, true_umax);
14502
+ false_reg1 ->umin_value = max(false_reg1 ->umin_value, false_umin);
14503
+ true_reg1 ->umax_value = min(true_reg1 ->umax_value, true_umax);
14504
14504
}
14505
14505
break;
14506
14506
}
@@ -14511,14 +14511,14 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14511
14511
s32 false_smin = opcode == BPF_JSLT ? sval32 : sval32 + 1;
14512
14512
s32 true_smax = opcode == BPF_JSLT ? sval32 - 1 : sval32;
14513
14513
14514
- false_reg ->s32_min_value = max(false_reg ->s32_min_value, false_smin);
14515
- true_reg ->s32_max_value = min(true_reg ->s32_max_value, true_smax);
14514
+ false_reg1 ->s32_min_value = max(false_reg1 ->s32_min_value, false_smin);
14515
+ true_reg1 ->s32_max_value = min(true_reg1 ->s32_max_value, true_smax);
14516
14516
} else {
14517
14517
s64 false_smin = opcode == BPF_JSLT ? sval : sval + 1;
14518
14518
s64 true_smax = opcode == BPF_JSLT ? sval - 1 : sval;
14519
14519
14520
- false_reg ->smin_value = max(false_reg ->smin_value, false_smin);
14521
- true_reg ->smax_value = min(true_reg ->smax_value, true_smax);
14520
+ false_reg1 ->smin_value = max(false_reg1 ->smin_value, false_smin);
14521
+ true_reg1 ->smax_value = min(true_reg1 ->smax_value, true_smax);
14522
14522
}
14523
14523
break;
14524
14524
}
@@ -14527,17 +14527,17 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
14527
14527
}
14528
14528
14529
14529
if (is_jmp32) {
14530
- false_reg ->var_off = tnum_or(tnum_clear_subreg(false_64off),
14530
+ false_reg1 ->var_off = tnum_or(tnum_clear_subreg(false_64off),
14531
14531
tnum_subreg(false_32off));
14532
- true_reg ->var_off = tnum_or(tnum_clear_subreg(true_64off),
14532
+ true_reg1 ->var_off = tnum_or(tnum_clear_subreg(true_64off),
14533
14533
tnum_subreg(true_32off));
14534
- reg_bounds_sync(false_reg );
14535
- reg_bounds_sync(true_reg );
14534
+ reg_bounds_sync(false_reg1 );
14535
+ reg_bounds_sync(true_reg1 );
14536
14536
} else {
14537
- false_reg ->var_off = false_64off;
14538
- true_reg ->var_off = true_64off;
14539
- reg_bounds_sync(false_reg );
14540
- reg_bounds_sync(true_reg );
14537
+ false_reg1 ->var_off = false_64off;
14538
+ true_reg1 ->var_off = true_64off;
14539
+ reg_bounds_sync(false_reg1 );
14540
+ reg_bounds_sync(true_reg1 );
14541
14541
}
14542
14542
}
14543
14543
0 commit comments