From: Vivek Goyal <vgoyal@redhat.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 2/2] fuse: Send security context of inode on file creation
Date: Wed, 13 Oct 2021 08:50:33 -0400 [thread overview]
Message-ID: <YWbWGWiMx5WxnLuS@redhat.com> (raw)
In-Reply-To: <202110131215.1V7LsOM1-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 6376 bytes --]
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.
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-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=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/3671f69d52ea6521c521ba6052be8e1b07e19ef7
> 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@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(a)lists.01.org
next prev parent reply other threads:[~2021-10-13 12:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 18:06 [PATCH v2 0/2] fuse: Send file/inode security context during creation Vivek Goyal
2021-10-12 18:06 ` [Virtio-fs] " Vivek Goyal
2021-10-12 18:06 ` [PATCH v2 1/2] fuse: Add a flag FUSE_SECURITY_CTX Vivek Goyal
2021-10-12 18:06 ` [Virtio-fs] " Vivek Goyal
2021-10-12 19:09 ` Casey Schaufler
2021-10-12 19:09 ` [Virtio-fs] " Casey Schaufler
2021-10-12 20:38 ` Vivek Goyal
2021-10-12 20:38 ` [Virtio-fs] " Vivek Goyal
2021-10-12 18:06 ` [PATCH v2 2/2] fuse: Send security context of inode on file creation Vivek Goyal
2021-10-12 18:06 ` [Virtio-fs] " Vivek Goyal
2021-10-12 18:24 ` Casey Schaufler
2021-10-12 18:24 ` [Virtio-fs] " Casey Schaufler
2021-10-12 18:34 ` Vivek Goyal
2021-10-12 18:34 ` [Virtio-fs] " Vivek Goyal
2021-10-12 18:41 ` Casey Schaufler
2021-10-12 18:41 ` [Virtio-fs] " Casey Schaufler
2021-10-13 4:04 ` kernel test robot
2021-10-13 12:50 ` Vivek Goyal [this message]
2021-10-15 0:39 ` Chen, Rong A
2021-11-02 14:00 ` Miklos Szeredi
2021-11-02 14:00 ` [Virtio-fs] " Miklos Szeredi
2021-11-02 15:30 ` Vivek Goyal
2021-11-02 15:30 ` [Virtio-fs] " Vivek Goyal
2021-11-02 15:38 ` Miklos Szeredi
2021-11-02 15:38 ` [Virtio-fs] " Miklos Szeredi
2021-11-02 19:09 ` Vivek Goyal
2021-11-02 19:09 ` [Virtio-fs] " Vivek Goyal
2021-10-25 15:55 ` [PATCH v2 0/2] fuse: Send file/inode security context during creation Vivek Goyal
2021-10-25 15:55 ` [Virtio-fs] " Vivek Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YWbWGWiMx5WxnLuS@redhat.com \
--to=vgoyal@redhat.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.