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@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-file-inode...
>> base: 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc
>> config: arc-randconfig-r043-20211012 (attached as .config)
>> compiler: arc-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/3671f69d52ea6521c521ba6052be8e1b0...
>> 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/20211013-020827
>> git checkout 3671f69d52ea6521c521ba6052be8e1b07e19ef7
>> # save the attached .config to linux build tree
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross
ARCH=arc
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp(a)intel.com>
>>
>> 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_init_security' from incompatible pointer type
[-Werror=incompatible-pointer-types]
>> 473 | &name, &ctx,
&ctxlen);
>> | ^~~~~
>> | |
>> | 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_init_security' from incompatible pointer type
[-Werror=incompatible-pointer-types]
>> 473 | &name, &ctx,
&ctxlen);
>> | ^~~~
>> | |
>> | 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 = 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 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_secctxs *fsecctxs;
>> 467 void *ctx, *full_ctx;
>> 468 u32 ctxlen, full_ctxlen;
>> 469 int err = 0;
>> 470 const char *name;
>> 471
>> > 472 err = security_dentry_init_security(entry, mode,
&entry->d_name,
>> > 473 &name, &ctx, &ctxlen);
>> 474 if (err) {
>> 475 if (err != -EOPNOTSUPP)
>> 476 goto out_err;
>> 477 /* No LSM is supporting this security hook. Ignore error */
>> 478 err = 0;
>> 479 ctxlen = 0;
>> 480 }
>> 481
>> 482 if (ctxlen > 0) {
>> 483 void *ptr;
>> 484
>> 485 full_ctxlen = sizeof(*fsecctxs) + sizeof(*fsecctx) +
>> 486 strlen(name) + ctxlen + 1;
>> 487 full_ctx = kzalloc(full_ctxlen, GFP_KERNEL);
>> 488 if (!full_ctx) {
>> 489 err = -ENOMEM;
>> 490 kfree(ctx);
>> 491 goto out_err;
>> 492 }
>> 493
>> 494 ptr = full_ctx;
>> 495 fsecctxs = (struct fuse_secctxs*) ptr;
>> 496 fsecctxs->nr_secctx = 1;
>> 497 ptr += sizeof(*fsecctxs);
>> 498
>> 499 fsecctx = (struct fuse_secctx*) ptr;
>> 500 fsecctx->size = ctxlen;
>> 501 ptr += sizeof(*fsecctx);
>> 502
>> 503 strcpy(ptr, name);
>> 504 ptr += strlen(name) + 1;
>> 505 memcpy(ptr, ctx, ctxlen);
>> 506 kfree(ctx);
>> 507 } else {
>> 508 full_ctxlen = sizeof(*fsecctxs);
>> 509 full_ctx = kzalloc(full_ctxlen, GFP_KERNEL);
>> 510 if (!full_ctx) {
>> 511 err = -ENOMEM;
>> 512 goto out_err;
>> 513 }
>> 514 }
>> 515
>> 516 *security_ctxlen = full_ctxlen;
>> 517 *security_ctx = 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@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
>