All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: kbuild-all@lists.01.org, Ammar Faizi <ammarfaizi2@gnuweeb.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	linux-kernel@vger.kernel.org
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: <202208250749.ugs8aIcf-lkp@intel.com> (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/202208250749.ugs8aIcf-lkp@intel.com/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 <lkp@intel.com>

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:44 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 \
    --in-reply-to=202208250749.ugs8aIcf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=dhowells@redhat.com \
    --cc=gwml@vger.gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.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.