Content-Type: multipart/mixed; boundary="===============5744721982135454360==" MIME-Version: 1.0 From: Chen, Rong A To: kbuild-all@lists.01.org Subject: Re: [PATCH v2 2/2] fuse: Send security context of inode on file creation Date: Fri, 15 Oct 2021 08:39:59 +0800 Message-ID: <0b33467d-15e1-6403-dc55-2e96a8fc1cfd@intel.com> In-Reply-To: List-Id: --===============5744721982135454360== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 10/13/2021 8:50 PM, Vivek Goyal wrote: > On Wed, Oct 13, 2021 at 12:04:36PM +0800, kernel test robot wrote: >> Hi Vivek, >> >> I love your patch! Yet something to improve: >> >> [auto build test ERROR on v5.15-rc5] >> [also build test ERROR on next-20211012] >> [cannot apply to mszeredi-fuse/for-next] >> [If your patch is applied to the wrong git tree, kindly drop us a note. > = > Actually, this patch series is dependent on another patch which is > posted on mailing list but has not been merged yet. > = > [PATCH v2] security: Return xattr name from security_dentry_init_security= () > https://lore.kernel.org/linux-fsdevel/YWWMO%2FZDrvDZ5X4c(a)redhat.com/ > = > So if you apply this patch first and then apply the patch series, it > should apply cleanly and compile. Hi Vivek, Thanks for the explanation, the bot is not clever on such case, we'll = take a look. Best Regards, Rong Chen > = > Thanks > Vivek > = >> 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/Vivek-Goyal/fuse-Send-f= ile-inode-security-context-during-creation/20211013-020827 >> base: 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc >> config: arc-randconfig-r043-20211012 (attached as .config) >> compiler: arc-elf-gcc (GCC) 11.2.0 >> reproduce (this is a W=3D1 build): >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/s= bin/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> # https://github.com/0day-ci/linux/commit/3671f69d52ea6521c521b= a6052be8e1b07e19ef7 >> git remote add linux-review https://github.com/0day-ci/linux >> git fetch --no-tags linux-review Vivek-Goyal/fuse-Send-file-ino= de-security-context-during-creation/20211013-020827 >> git checkout 3671f69d52ea6521c521ba6052be8e1b07e19ef7 >> # save the attached .config to linux build tree >> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.c= ross ARCH=3Darc >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kernel test robot >> >> All errors (new ones prefixed by >>): >> >> fs/fuse/dir.c: In function 'get_security_context': >>>> fs/fuse/dir.c:473:45: error: passing argument 4 of 'security_dentry_in= it_security' from incompatible pointer type [-Werror=3Dincompatible-pointer= -types] >> 473 | &name, &ctx, &ct= xlen); >> | ^~~~~ >> | | >> | const char ** >> In file included from include/linux/fs_context.h:14, >> from fs/fuse/dir.c:13: >> include/linux/security.h:742:57: note: expected 'void **' but argume= nt is of type 'const char **' >> 742 | void **ctx, >> | ~~~~~~~^~~ >> fs/fuse/dir.c:473:52: error: passing argument 5 of 'security_dentry_= init_security' from incompatible pointer type [-Werror=3Dincompatible-point= er-types] >> 473 | &name, &ctx, &ct= xlen); >> | ^~~~ >> | | >> | void ** >> In file included from include/linux/fs_context.h:14, >> from fs/fuse/dir.c:13: >> include/linux/security.h:743:55: note: expected 'u32 *' {aka 'unsign= ed int *'} but argument is of type 'void **' >> 743 | u32 *ctxlen) >> | ~~~~~^~~~~~ >>>> fs/fuse/dir.c:472:15: error: too many arguments to function 'security_= dentry_init_security' >> 472 | err =3D security_dentry_init_security(entry, mode, &= entry->d_name, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> In file included from include/linux/fs_context.h:14, >> from fs/fuse/dir.c:13: >> include/linux/security.h:739:19: note: declared here >> 739 | static inline int security_dentry_init_security(struct dentr= y *dentry, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> cc1: some warnings being treated as errors >> >> >> vim +/security_dentry_init_security +473 fs/fuse/dir.c >> >> 461 = >> 462 static int get_security_context(struct dentry *entry, umode_t mo= de, >> 463 void **security_ctx, u32 *security_ctxlen) >> 464 { >> 465 struct fuse_secctx *fsecctx; >> 466 struct fuse_secctxs *fsecctxs; >> 467 void *ctx, *full_ctx; >> 468 u32 ctxlen, full_ctxlen; >> 469 int err =3D 0; >> 470 const char *name; >> 471 = >> > 472 err =3D security_dentry_init_security(entry, mode, &entry->d_na= me, >> > 473 &name, &ctx, &ctxlen); >> 474 if (err) { >> 475 if (err !=3D -EOPNOTSUPP) >> 476 goto out_err; >> 477 /* No LSM is supporting this security hook. Ignore error */ >> 478 err =3D 0; >> 479 ctxlen =3D 0; >> 480 } >> 481 = >> 482 if (ctxlen > 0) { >> 483 void *ptr; >> 484 = >> 485 full_ctxlen =3D sizeof(*fsecctxs) + sizeof(*fsecctx) + >> 486 strlen(name) + ctxlen + 1; >> 487 full_ctx =3D kzalloc(full_ctxlen, GFP_KERNEL); >> 488 if (!full_ctx) { >> 489 err =3D -ENOMEM; >> 490 kfree(ctx); >> 491 goto out_err; >> 492 } >> 493 = >> 494 ptr =3D full_ctx; >> 495 fsecctxs =3D (struct fuse_secctxs*) ptr; >> 496 fsecctxs->nr_secctx =3D 1; >> 497 ptr +=3D sizeof(*fsecctxs); >> 498 = >> 499 fsecctx =3D (struct fuse_secctx*) ptr; >> 500 fsecctx->size =3D ctxlen; >> 501 ptr +=3D sizeof(*fsecctx); >> 502 = >> 503 strcpy(ptr, name); >> 504 ptr +=3D strlen(name) + 1; >> 505 memcpy(ptr, ctx, ctxlen); >> 506 kfree(ctx); >> 507 } else { >> 508 full_ctxlen =3D sizeof(*fsecctxs); >> 509 full_ctx =3D kzalloc(full_ctxlen, GFP_KERNEL); >> 510 if (!full_ctx) { >> 511 err =3D -ENOMEM; >> 512 goto out_err; >> 513 } >> 514 } >> 515 = >> 516 *security_ctxlen =3D full_ctxlen; >> 517 *security_ctx =3D full_ctx; >> 518 out_err: >> 519 return err; >> 520 } >> 521 = >> >> --- >> 0-DAY CI Kernel Test Service, Intel Corporation >> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org > = > _______________________________________________ > kbuild-all mailing list -- kbuild-all(a)lists.01.org > To unsubscribe send an email to kbuild-all-leave(a)lists.01.org >=20 --===============5744721982135454360==--