linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christy Lee <christylee@fb.com>
To: <dan.carpenter@oracle.com>
Cc: <ast@kernel.org>, <christylee@fb.com>, <kbuild-all@lists.01.org>,
	<kbuild@lists.01.org>, <linux-mm@kvack.org>,
	<bpf@vger.kernel.org>, <kernel-team@fb.com>,
	<christyc.y.lee@gmail.com>, kernel test robot <lkp@intel.com>
Subject: [PATCH bpf-next] Fix incorrect integer literal used for marking scratched registers in  verifier logs
Date: Fri, 7 Jan 2022 16:58:54 -0800	[thread overview]
Message-ID: <20220108005854.658596-1-christylee@fb.com> (raw)
In-Reply-To: <202201060848.nagWejwv-lkp@intel.com>

env->scratched_stack_slots is a 64-bit value, we should use ULL
instead of UL literal values.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christy Lee <christylee@fb.com>
---
 kernel/bpf/verifier.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index bfb45381fb3f..a8587210907d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -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)
 {
-	env->scratched_stack_slots |= 1UL << spi;
+	env->scratched_stack_slots |= 1ULL << spi;
 }
 
 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)
 static void mark_verifier_state_clean(struct bpf_verifier_env *env)
 {
 	env->scratched_regs = 0U;
-	env->scratched_stack_slots = 0UL;
+	env->scratched_stack_slots = 0ULL;
 }
 
 /* Used for printing the entire verifier state. */
 static void mark_verifier_state_scratched(struct bpf_verifier_env *env)
 {
 	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
-- 
2.30.2



  reply	other threads:[~2022-01-08  0:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  8:20 [linux-next:master 7391/10864] kernel/bpf/verifier.c:619 mark_stack_slot_scratched() warn: should '1 << spi' be a 64 bit type? Dan Carpenter
2022-01-08  0:58 ` Christy Lee [this message]
2022-01-10 21:52   ` [PATCH bpf-next] Fix incorrect integer literal used for marking scratched registers in verifier logs Song Liu
2022-01-10 22:12     ` Christy Lee
2022-01-10 22:25       ` Song Liu
2022-01-11  9:48       ` Dan Carpenter
2022-01-11 17:56         ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220108005854.658596-1-christylee@fb.com \
    --to=christylee@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christyc.y.lee@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox