提交 343e5375 编写于 作者: C Christy Lee 提交者: Alexei Starovoitov

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: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NChristy Lee <christylee@fb.com>
Acked-by: NSong Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/r/20220108005854.658596-1-christylee@fb.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
上级 036a05f5
...@@ -616,7 +616,7 @@ static void mark_reg_scratched(struct bpf_verifier_env *env, u32 regno) ...@@ -616,7 +616,7 @@ static void mark_reg_scratched(struct bpf_verifier_env *env, u32 regno)
static void mark_stack_slot_scratched(struct bpf_verifier_env *env, u32 spi) static void mark_stack_slot_scratched(struct bpf_verifier_env *env, u32 spi)
{ {
env->scratched_stack_slots |= 1UL << spi; env->scratched_stack_slots |= 1ULL << spi;
} }
static bool reg_scratched(const struct bpf_verifier_env *env, u32 regno) 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) ...@@ -637,14 +637,14 @@ static bool verifier_state_scratched(const struct bpf_verifier_env *env)
static void mark_verifier_state_clean(struct bpf_verifier_env *env) static void mark_verifier_state_clean(struct bpf_verifier_env *env)
{ {
env->scratched_regs = 0U; env->scratched_regs = 0U;
env->scratched_stack_slots = 0UL; env->scratched_stack_slots = 0ULL;
} }
/* Used for printing the entire verifier state. */ /* Used for printing the entire verifier state. */
static void mark_verifier_state_scratched(struct bpf_verifier_env *env) static void mark_verifier_state_scratched(struct bpf_verifier_env *env)
{ {
env->scratched_regs = ~0U; env->scratched_regs = ~0U;
env->scratched_stack_slots = ~0UL; env->scratched_stack_slots = ~0ULL;
} }
/* The reg state of a pointer or a bounded scalar was saved when /* The reg state of a pointer or a bounded scalar was saved when
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册