Lines Matching refs:rold
488 static bool regs_exact(const struct bpf_reg_state *rold, in regs_exact() argument
492 return memcmp(rold, rcur, offsetof(struct bpf_reg_state, id)) == 0 && in regs_exact()
493 check_ids(rold->id, rcur->id, idmap) && in regs_exact()
494 check_ids(rold->parent_id, rcur->parent_id, idmap) && in regs_exact()
495 check_ids(rold->map_uid, rcur->map_uid, idmap); in regs_exact()
505 static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, in regsafe() argument
510 return regs_exact(rold, rcur, idmap); in regsafe()
512 if (rold->type == NOT_INIT) in regsafe()
537 if (rold->type != rcur->type) in regsafe()
540 switch (base_type(rold->type)) { in regsafe()
546 return memcmp(rold, rcur, offsetof(struct bpf_reg_state, id)) == 0 && in regsafe()
547 check_scalar_ids(rold->id, rcur->id, idmap); in regsafe()
549 if (!rold->precise && exact == NOT_EXACT) in regsafe()
596 if (rold->id && in regsafe()
597 (rold->id & BPF_ADD_CONST) != (rcur->id & BPF_ADD_CONST)) in regsafe()
601 if ((rold->id & BPF_ADD_CONST) && rold->delta != rcur->delta) in regsafe()
604 if (!check_scalar_ids(rold->id, rcur->id, idmap)) in regsafe()
607 return range_within(rold, rcur) && tnum_in(rold->var_off, rcur->var_off); in regsafe()
616 return memcmp(rold, rcur, offsetof(struct bpf_reg_state, var_off)) == 0 && in regsafe()
617 range_within(rold, rcur) && in regsafe()
618 tnum_in(rold->var_off, rcur->var_off) && in regsafe()
619 check_ids(rold->id, rcur->id, idmap) && in regsafe()
620 check_ids(rold->parent_id, rcur->parent_id, idmap) && in regsafe()
621 check_ids(rold->map_uid, rcur->map_uid, idmap); in regsafe()
630 if (rold->range < 0 || rcur->range < 0) { in regsafe()
632 if (rold->range != rcur->range) in regsafe()
634 } else if (rold->range > rcur->range) { in regsafe()
638 if (!check_ids(rold->id, rcur->id, idmap)) in regsafe()
641 if (rold->id && rold->r64.base != rcur->r64.base) in regsafe()
644 return range_within(rold, rcur) && in regsafe()
645 tnum_in(rold->var_off, rcur->var_off); in regsafe()
647 return regs_exact(rold, rcur, idmap); in regsafe()
651 return memcmp(rold, rcur, offsetof(struct bpf_reg_state, var_off)) == 0 && in regsafe()
652 range_within(rold, rcur) && tnum_in(rold->var_off, rcur->var_off); in regsafe()
654 return regs_exact(rold, rcur, idmap); in regsafe()