public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected], Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	[email protected]
Subject: [ammarfaizi2-block:dhowells/linux-fs/fscache-fixes 1/4] security/selinux/hooks.c:2772:45: warning: variable 'root_isec' set but not used
Date: Thu, 25 Aug 2022 07:43:35 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/fscache-fixes
head:   900828ab172a767a0819d99718dcceb778be0d63
commit: de284e31dcfda8ae7b56eaef89efe60be34ecdf9 [1/4] vfs, security: Fix automount superblock LSM init problem, preventing NFS sb sharing
config: i386-defconfig (https://download.01.org/0day-ci/archive/20220825/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/ammarfaizi2/linux-block/commit/de284e31dcfda8ae7b56eaef89efe60be34ecdf9
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/fscache-fixes
        git checkout de284e31dcfda8ae7b56eaef89efe60be34ecdf9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash security/selinux/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

   security/selinux/hooks.c: In function 'selinux_fs_context_init':
>> security/selinux/hooks.c:2772:45: warning: variable 'root_isec' set but not used [-Wunused-but-set-variable]
    2772 |         const struct inode_security_struct *root_isec;
         |                                             ^~~~~~~~~


vim +/root_isec +2772 security/selinux/hooks.c

  2767	
  2768	static int selinux_fs_context_init(struct fs_context *fc,
  2769					   struct dentry *reference)
  2770	{
  2771		const struct superblock_security_struct *sbsec;
> 2772		const struct inode_security_struct *root_isec;
  2773		struct selinux_mnt_opts *opts;
  2774	
  2775		if (fc->purpose == FS_CONTEXT_FOR_SUBMOUNT) {
  2776			opts = kzalloc(sizeof(*opts), GFP_KERNEL);
  2777			if (!opts)
  2778				return -ENOMEM;
  2779	
  2780			root_isec = backing_inode_security(reference->d_sb->s_root);
  2781			sbsec = selinux_superblock(reference->d_sb);
  2782			if (sbsec->flags & FSCONTEXT_MNT)
  2783				opts->fscontext_sid	= sbsec->sid;
  2784			if (sbsec->flags & CONTEXT_MNT)
  2785				opts->context_sid	= sbsec->mntpoint_sid;
  2786			if (sbsec->flags & DEFCONTEXT_MNT)
  2787				opts->defcontext_sid	= sbsec->def_sid;
  2788			fc->security = opts;
  2789		}
  2790	
  2791		return 0;
  2792	}
  2793	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-08-24 23:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox