Content-Type: multipart/mixed; boundary="===============8285333421288339135==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux Date: Sat, 12 Feb 2022 01:58:14 +0800 Message-ID: <202202112213.WGiJCCYD-lkp@intel.com> In-Reply-To: <20220211121145.35237-2-laoar.shao@gmail.com> List-Id: --===============8285333421288339135== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-i= nformation-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(a)intel.com/config) compiler: arceb-elf-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/6cd35bc70f99caee380d84f5b= a9256ac5fe03860 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Yafang-Shao/bpf-Add-more-informati= on-into-bpffs/20220211-201319 git checkout 6cd35bc70f99caee380d84f5ba9256ac5fe03860 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Darc SHELL=3D/bin/bash kernel/bpf/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot 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_fr= om_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 =3D user_path_create(AT_FDCWD, pathname, &path, 0); 450 if (IS_ERR(dentry)) 451 return PTR_ERR(dentry); 452 = 453 mode =3D S_IFREG | ((S_IRUSR | S_IWUSR) & ~current_umask()); 454 = 455 ret =3D security_path_mknod(&path, dentry, mode, 0); 456 if (ret) 457 goto out; 458 = 459 dir =3D d_inode(path.dentry); 460 if (dir->i_op !=3D &bpf_dir_iops) { 461 ret =3D -EPERM; 462 goto out; 463 } 464 = 465 switch (type) { 466 case BPF_TYPE_PROG: 467 prog =3D raw; 468 aux =3D prog->aux; > 469 (void) strncpy_from_user(aux->pin_name, pathname, BPF_PIN_NAME_LEN= ); 470 aux->pin_name[BPF_PIN_NAME_LEN - 1] =3D '\0'; 471 ret =3D vfs_mkobj(dentry, mode, bpf_mkprog, raw); 472 break; 473 case BPF_TYPE_MAP: 474 ret =3D vfs_mkobj(dentry, mode, bpf_mkmap, raw); 475 break; 476 case BPF_TYPE_LINK: 477 ret =3D vfs_mkobj(dentry, mode, bpf_mklink, raw); 478 break; 479 default: 480 ret =3D -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(a)lists.01.org --===============8285333421288339135==--