From: Joanne Koong <[email protected]>
To: kernel test robot <[email protected]>
Cc: [email protected],
"GNU/Weeb Mailing List" <[email protected]>,
[email protected],
Alexei Starovoitov <[email protected]>
Subject: Re: [ammarfaizi2-block:bpf/bpf-next/master 244/254] kernel/bpf/verifier.c:13499:47: sparse: sparse: cast from restricted gfp_t
Date: Mon, 21 Mar 2022 10:41:01 -0700 [thread overview]
Message-ID: <CAJnrk1bqXmtSjvevnuBBqYWsZeQsMPYJhZRCXVrQnwqowBZ00Q@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
On Sun, Mar 20, 2022 at 11:58 PM kernel test robot <[email protected]> wrote:
>
> tree: https://github.com/ammarfaizi2/linux-block bpf/bpf-next/master
> head: 7ada3787e91c89b0aa7abf47682e8e587b855c13
> commit: b00fa38a9c1cba044a32a601b49a55a18ed719d1 [244/254] bpf: Enable non-atomic allocations in local storage
> config: csky-randconfig-s032-20220320 (https://download.01.org/0day-ci/archive/20220321/[email protected]/config)
> compiler: csky-linux-gcc (GCC) 11.2.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # apt-get install sparse
> # sparse version: v0.6.4-dirty
> # https://github.com/ammarfaizi2/linux-block/commit/b00fa38a9c1cba044a32a601b49a55a18ed719d1
> git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
> git fetch --no-tags ammarfaizi2-block bpf/bpf-next/master
> git checkout b00fa38a9c1cba044a32a601b49a55a18ed719d1
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash kernel/bpf/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
>
> sparse warnings: (new ones prefixed by >>)
> >> kernel/bpf/verifier.c:13499:47: sparse: sparse: cast from restricted gfp_t
> kernel/bpf/verifier.c:13501:47: sparse: sparse: cast from restricted gfp_t
> kernel/bpf/verifier.c:13746:38: sparse: sparse: subtraction of functions? Share your drugs
> kernel/bpf/verifier.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...):
> arch/csky/include/asm/uaccess.h:121:17: sparse: sparse: cast removes address space '__user' of expression
> arch/csky/include/asm/uaccess.h:121:17: sparse: sparse: asm output is not an lvalue
> arch/csky/include/asm/uaccess.h:121:17: sparse: sparse: cast removes address space '__user' of expression
> arch/csky/include/asm/uaccess.h:121:17: sparse: sparse: generating address of non-lvalue (11)
> kernel/bpf/verifier.c: note: in included file (through include/linux/bpf.h, include/linux/bpf-cgroup.h):
> include/linux/bpfptr.h:52:47: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:63:40: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast from non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast to non-scalar
> include/linux/bpfptr.h:52:47: sparse: sparse: cast from non-scalar
>
> vim +13499 kernel/bpf/verifier.c
>
> 13236
[...]
> 13485 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt);
> 13486 if (!new_prog)
> 13487 return -ENOMEM;
> 13488
> 13489 delta += cnt - 1;
> 13490 env->prog = prog = new_prog;
> 13491 insn = new_prog->insnsi + i + delta;
> 13492 goto patch_call_imm;
> 13493 }
> 13494
> 13495 if (insn->imm == BPF_FUNC_task_storage_get ||
> 13496 insn->imm == BPF_FUNC_sk_storage_get ||
> 13497 insn->imm == BPF_FUNC_inode_storage_get) {
> 13498 if (env->prog->aux->sleepable)
> 13499 insn_buf[0] = BPF_MOV64_IMM(BPF_REG_5, (__s32)GFP_KERNEL);
> 13500 else
> 13501 insn_buf[0] = BPF_MOV64_IMM(BPF_REG_5, (__s32)GFP_ATOMIC);
Sorry for causing this, I will submit a fix.
> 13502 insn_buf[1] = *insn;
> 13503 cnt = 2;
> 13504
> 13505 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt);
> 13506 if (!new_prog)
> 13507 return -ENOMEM;
> 13508
[...]
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
prev parent reply other threads:[~2022-03-21 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 6:57 [ammarfaizi2-block:bpf/bpf-next/master 244/254] kernel/bpf/verifier.c:13499:47: sparse: sparse: cast from restricted gfp_t kernel test robot
2022-03-21 17:41 ` Joanne Koong [this message]
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=CAJnrk1bqXmtSjvevnuBBqYWsZeQsMPYJhZRCXVrQnwqowBZ00Q@mail.gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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