BPF List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yafang Shao <laoar.shao@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, Yafang Shao <laoar.shao@gmail.com>
Subject: Re: [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux
Date: Sat, 12 Feb 2022 01:58:14 +0800	[thread overview]
Message-ID: <202202112213.WGiJCCYD-lkp@intel.com> (raw)
In-Reply-To: <20220211121145.35237-2-laoar.shao@gmail.com>

Hi Yafang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf/master]
[also build test WARNING on net/master horms-ipvs/master net-next/master v5.17-rc3 next-20220211]
[cannot apply to bpf-next/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yafang-Shao/bpf-Add-more-information-into-bpffs/20220211-201319
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220211/202202112213.WGiJCCYD-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/6cd35bc70f99caee380d84f5ba9256ac5fe03860
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yafang-Shao/bpf-Add-more-information-into-bpffs/20220211-201319
        git checkout 6cd35bc70f99caee380d84f5ba9256ac5fe03860
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash kernel/bpf/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/bpf/inode.c: In function 'bpf_obj_do_pin':
>> kernel/bpf/inode.c:469:24: warning: ignoring return value of 'strncpy_from_user' declared with attribute 'warn_unused_result' [-Wunused-result]
     469 |                 (void) strncpy_from_user(aux->pin_name, pathname, BPF_PIN_NAME_LEN);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +469 kernel/bpf/inode.c

   437	
   438	static int bpf_obj_do_pin(const char __user *pathname, void *raw,
   439				  enum bpf_type type)
   440	{
   441		struct bpf_prog_aux *aux;
   442		struct bpf_prog *prog;
   443		struct dentry *dentry;
   444		struct inode *dir;
   445		struct path path;
   446		umode_t mode;
   447		int ret;
   448	
   449		dentry = user_path_create(AT_FDCWD, pathname, &path, 0);
   450		if (IS_ERR(dentry))
   451			return PTR_ERR(dentry);
   452	
   453		mode = S_IFREG | ((S_IRUSR | S_IWUSR) & ~current_umask());
   454	
   455		ret = security_path_mknod(&path, dentry, mode, 0);
   456		if (ret)
   457			goto out;
   458	
   459		dir = d_inode(path.dentry);
   460		if (dir->i_op != &bpf_dir_iops) {
   461			ret = -EPERM;
   462			goto out;
   463		}
   464	
   465		switch (type) {
   466		case BPF_TYPE_PROG:
   467			prog = raw;
   468			aux = prog->aux;
 > 469			(void) strncpy_from_user(aux->pin_name, pathname, BPF_PIN_NAME_LEN);
   470			aux->pin_name[BPF_PIN_NAME_LEN - 1] = '\0';
   471			ret = vfs_mkobj(dentry, mode, bpf_mkprog, raw);
   472			break;
   473		case BPF_TYPE_MAP:
   474			ret = vfs_mkobj(dentry, mode, bpf_mkmap, raw);
   475			break;
   476		case BPF_TYPE_LINK:
   477			ret = vfs_mkobj(dentry, mode, bpf_mklink, raw);
   478			break;
   479		default:
   480			ret = -EPERM;
   481		}
   482	out:
   483		done_path_create(&path, dentry);
   484		return ret;
   485	}
   486	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  parent reply	other threads:[~2022-02-11 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 12:11 [PATCH 0/4] bpf: Add more information into bpffs Yafang Shao
2022-02-11 12:11 ` [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux Yafang Shao
2022-02-11 12:43   ` Daniel Borkmann
2022-02-11 12:44     ` Daniel Borkmann
2022-02-13 11:28       ` Yafang Shao
2022-02-13 11:27     ` Yafang Shao
2022-02-11 17:58   ` kernel test robot [this message]
2022-02-13 11:29     ` Yafang Shao
2022-02-11 12:11 ` [PATCH 2/4] bpf: Add pin_name into struct bpf_map Yafang Shao
2022-02-11 12:11 ` [PATCH 3/4] bpf: Show pinned file name in {progs, maps}.debug Yafang Shao
2022-02-11 12:11 ` [PATCH 4/4] bpf: Show the used maps of each prog in progs.debug Yafang Shao

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=202202112213.WGiJCCYD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kpsingh@kernel.org \
    --cc=laoar.shao@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.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