Skip to content

Commit 343e537

Browse files
christycyleeAlexei Starovoitov
authored andcommitted
bpf: Fix incorrect integer literal used for marking scratched stack.
env->scratched_stack_slots is a 64-bit value, we should use ULL instead of UL literal values. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Christy Lee <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 036a05f commit 343e537

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/bpf/verifier.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static void mark_reg_scratched(struct bpf_verifier_env *env, u32 regno)
616616

617617
static void mark_stack_slot_scratched(struct bpf_verifier_env *env, u32 spi)
618618
{
619-
env->scratched_stack_slots |= 1UL << spi;
619+
env->scratched_stack_slots |= 1ULL << spi;
620620
}
621621

622622
static bool reg_scratched(const struct bpf_verifier_env *env, u32 regno)
@@ -637,14 +637,14 @@ static bool verifier_state_scratched(const struct bpf_verifier_env *env)
637637
static void mark_verifier_state_clean(struct bpf_verifier_env *env)
638638
{
639639
env->scratched_regs = 0U;
640-
env->scratched_stack_slots = 0UL;
640+
env->scratched_stack_slots = 0ULL;
641641
}
642642

643643
/* Used for printing the entire verifier state. */
644644
static void mark_verifier_state_scratched(struct bpf_verifier_env *env)
645645
{
646646
env->scratched_regs = ~0U;
647-
env->scratched_stack_slots = ~0UL;
647+
env->scratched_stack_slots = ~0ULL;
648648
}
649649

650650
/* The reg state of a pointer or a bounded scalar was saved when

0 commit comments

Comments
 (0)