From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by gnuweeb.org (Postfix) with ESMTPS id B6E1A7E2DC for ; Mon, 21 Mar 2022 17:41:14 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=LCiQ2cBe; dkim-atps=neutral Received: by mail-lj1-f171.google.com with SMTP id o6so20927320ljp.3 for ; Mon, 21 Mar 2022 10:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uvDP/aC4k2MIgLQCzM4tXzCki/AhzE/DRELx6D6TcvQ=; b=LCiQ2cBeGHtozeXWAJvmRWwSIzciVtKWGB8pQ78lb5TjP5X+NgKn+rLgOWRq24XaeK DTNFFZpR+k3YjUjF9zPc65gJ3uf7BKFTAvH3NVZHBFjJ/VZk6a5ivjm3Mfxpao9gvvcw 4DT7pcwi+m7tjMt7OpjXBs9QtMSlGHIt+rwu4eTg93rv27aDIE07WU9KWBeCCMGcImBn YlWs4EQHe9A9pkK7DbJ8VXa1sOwxHS27xRoLlWWuLfv4cPPk6TsH3V3lPgA+b0THxn65 k8aitxmEIG3KeprGwDXtbPyaZnh4Gluqo+Ubvbu5MXkex5SDhMZbrVOhE/yqj099Leyr qzJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uvDP/aC4k2MIgLQCzM4tXzCki/AhzE/DRELx6D6TcvQ=; b=p+g1WIJUJBj79+CSmgWnzFyAIzQZv9WHjJ1friLW0H0y7zrACv6X9OouAadBd1QmEA O4A69kDMSad6RcRtBfZ5+m9asUCiHnwhOTrYB8Vo4D3nldBoPxIlbgTULU8reRGQau/7 2N8NnERU8sK3zxuBfRfPJ3IiKpwmvpAtFazrplR329ZNjoPLTmlJlqic59+Z74M8WcdY KbtomLp0Za8h7Qq22nyiUjYT4TJu5uSAecFwbK6jxFLcEluJRN9UvJP+lZlDj7KbHJ5G mu5midF4pC6Ye2FWjB85zOmkmWIPkTmkCAPhLcaa7f2M0FdgjAjpkMvRJM7qb3WfOT5r LXgQ== X-Gm-Message-State: AOAM5331RWC5Lsw3x+Io8iyM5SPpSqdeRNdFFZhbfw36ToCZmmZfxgFs VcskzvuIG1o+fPEIhN8uzbxQwCrCE0N/3nRewUc= X-Google-Smtp-Source: ABdhPJzbEpirlUxNiDc0Pp6FcUiq9WvkQhNk8nak3G1dOD4WBSldy75o+lwnjBnpM+YiU6CE7/fcbaaUZBHsyMqJarc= X-Received: by 2002:a2e:a0c9:0:b0:249:171b:1b06 with SMTP id f9-20020a2ea0c9000000b00249171b1b06mr16403679ljm.420.1647884472740; Mon, 21 Mar 2022 10:41:12 -0700 (PDT) MIME-Version: 1.0 References: <202203211432.Fx74gYS9-lkp@intel.com> In-Reply-To: <202203211432.Fx74gYS9-lkp@intel.com> From: Joanne Koong Date: Mon, 21 Mar 2022 10:41:01 -0700 Message-ID: Subject: Re: [ammarfaizi2-block:bpf/bpf-next/master 244/254] kernel/bpf/verifier.c:13499:47: sparse: sparse: cast from restricted gfp_t To: kernel test robot Cc: kbuild-all@lists.01.org, "GNU/Weeb Mailing List" , linux-kernel@vger.kernel.org, Alexei Starovoitov Content-Type: text/plain; charset="UTF-8" List-Id: On Sun, Mar 20, 2022 at 11:58 PM kernel test robot 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/202203211432.Fx74gYS9-lkp@intel.com/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 > > > 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