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/master)
Merge: 6070dcc8e5b1 124e7c61deb2
Author: Linus Torvalds <torvalds(a)linux-foundation.org>
Date: Wed Nov 10 17:05:37 2021 -0800
Merge tag 'ext4_for_linus' of
[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-file-inode...
base: DEBUG invalid remote for branch v5.15 8bb7eca972ad531c9b149c0a51ab43a417385813
config: microblaze-buildonly-randconfig-r001-20211111 (attached as .config)
compiler: microblaze-linux-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/3e94c8631307bf28c635eceedd868fe56...
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=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
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_secctx_header *fsecctx_header;
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(*fsecctx_header) + 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 fsecctx_header = (struct fuse_secctx_header*) ptr;
496 fsecctx_header->nr_secctx = 1;
497 fsecctx_header->size = full_ctxlen;
498 ptr += sizeof(*fsecctx_header);
499
500 fsecctx = (struct fuse_secctx*) ptr;
501 fsecctx->size = ctxlen;
502 ptr += sizeof(*fsecctx);
503
504 strcpy(ptr, name);
505 ptr += strlen(name) + 1;
506 memcpy(ptr, ctx, ctxlen);
507 kfree(ctx);
508 } else {
509 full_ctxlen = sizeof(*fsecctx_header);
510 full_ctx = kzalloc(full_ctxlen, GFP_KERNEL);
511 if (!full_ctx) {
512 err = -ENOMEM;
513 goto out_err;
514 }
515 fsecctx_header = full_ctx;
516 fsecctx_header->size = full_ctxlen;
517 }
518
519 *security_ctxlen = full_ctxlen;
520 *security_ctx = 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@lists.01.org