Content-Type: multipart/mixed; boundary="===============1221918941419855083==" MIME-Version: 1.0 From: Vivek Goyal To: kbuild-all@lists.01.org Subject: Re: [PATCH v3 1/1] fuse: Send security context of inode on file creation Date: Thu, 11 Nov 2021 09:40:24 -0500 Message-ID: In-Reply-To: <202111111755.DIXzLpgO-lkp@intel.com> List-Id: --===============1221918941419855083== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, Nov 11, 2021 at 05:54:20PM +0800, kernel test robot wrote: > Hi Vivek, > = > I love your patch! Yet something to improve: > = > [auto build test ERROR on v5.15] > [cannot apply to mszeredi-fuse/for-next next-20211111] Hi, Please apply the patch on latest upstream Linus tree instead. I have now updated this patch again because it had a conflict with another fuse patch. So please take the newly posted patch in same thread and apply on top of following commit in Linus's tree. commit debe436e77c72fcee804fb867f275e6d31aa999c (HEAD -> master, upstream/m= aster) Merge: 6070dcc8e5b1 124e7c61deb2 Author: Linus Torvalds Date: Wed Nov 10 17:05:37 2021 -0800 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel= /git/tytso/ext4 Thanks Vivek > [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/Vivek-Goyal/fuse-Send-fi= le-inode-security-context-during-creation/20211111-065645 > base: DEBUG invalid remote for branch v5.15 8bb7eca972ad531c9b149c0a51a= b43a417385813 > config: microblaze-buildonly-randconfig-r001-20211111 (attached as .confi= g) > compiler: microblaze-linux-gcc (GCC) 11.2.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/3e94c8631307bf28c635ece= edd868fe561666da5 > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Vivek-Goyal/fuse-Send-file-inode= -security-context-during-creation/20211111-065645 > git checkout 3e94c8631307bf28c635eceedd868fe561666da5 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cro= ss ARCH=3Dmicroblaze = > = > 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, &ctxl= en); > | ^~~~~ > | | > | 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 argument= is of type 'const char **' > 742 | void **ctx, > | ~~~~~~~^~~ > fs/fuse/dir.c:473:52: error: passing argument 5 of 'security_dentry_in= it_security' from incompatible pointer type [-Werror=3Dincompatible-pointer= -types] > 473 | &name, &ctx, &ctxl= en); > | ^~~~ > | | > | 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 'unsigned= 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, &en= try->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 dentry = *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 mode, > 463 void **security_ctx, u32 *security_ctxlen) > 464 { > 465 struct fuse_secctx *fsecctx; > 466 struct fuse_secctx_header *fsecctx_header; > 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_name, > > 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(*fsecctx_header) + 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 fsecctx_header =3D (struct fuse_secctx_header*) ptr; > 496 fsecctx_header->nr_secctx =3D 1; > 497 fsecctx_header->size =3D full_ctxlen; > 498 ptr +=3D sizeof(*fsecctx_header); > 499 = > 500 fsecctx =3D (struct fuse_secctx*) ptr; > 501 fsecctx->size =3D ctxlen; > 502 ptr +=3D sizeof(*fsecctx); > 503 = > 504 strcpy(ptr, name); > 505 ptr +=3D strlen(name) + 1; > 506 memcpy(ptr, ctx, ctxlen); > 507 kfree(ctx); > 508 } else { > 509 full_ctxlen =3D sizeof(*fsecctx_header); > 510 full_ctx =3D kzalloc(full_ctxlen, GFP_KERNEL); > 511 if (!full_ctx) { > 512 err =3D -ENOMEM; > 513 goto out_err; > 514 } > 515 fsecctx_header =3D full_ctx; > 516 fsecctx_header->size =3D full_ctxlen; > 517 } > 518 = > 519 *security_ctxlen =3D full_ctxlen; > 520 *security_ctx =3D full_ctx; > 521 out_err: > 522 return err; > 523 } > 524 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1221918941419855083==--