Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] LSM: infrastructure management of mount options
       [not found] <20261124181522.30415-2-casey@schaufler-ca.com>
@ 2026-11-25  2:49 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-25  2:49 UTC (permalink / raw)
  To: Casey Schaufler, paul, linux-security-module
  Cc: llvm, oe-kbuild-all, linux-kernel, jmorris, serge, keescook,
	john.johansen, penguin-kernel, stephen.smalley.work, selinux

Hi Casey,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pcmoore-selinux/next]
[also build test WARNING on linus/master v7.4-rc4 next-20261124]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Casey-Schaufler/LSM-infrastructure-management-of-mount-options/20261124-101522
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git next
patch link:    https://lore.kernel.org/r/20261124181522.30415-2-casey%40schaufler-ca.com
patch subject: [PATCH 1/1] LSM: infrastructure management of mount options
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20261125/20261125104210.ICeMgnNL-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 2012344e5da8e03ea4b8283ecd6fad6e13f09d64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261125/20261125104210.ICeMgnNL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261125104210.ICeMgnNL-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> security/selinux/hooks.c:2887:6: warning: variable 'opts' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    2887 |         if (!fc->security) {
         |             ^~~~~~~~~~~~~
   security/selinux/hooks.c:2903:2: note: uninitialized use occurs here
    2903 |         opts->initialized = true;
         |         ^~~~
   security/selinux/hooks.c:2887:2: note: remove the 'if' if its condition is always true
    2887 |         if (!fc->security) {
         |         ^~~~~~~~~~~~~~~~~~
   security/selinux/hooks.c:2878:31: note: initialize the variable 'opts' to silence this warning
    2878 |         struct selinux_mnt_opts *opts;
         |                                      ^
         |                                       = NULL
   1 warning generated.


vim +2887 security/selinux/hooks.c

  2873	
  2874	static int selinux_fs_context_submount(struct fs_context *fc,
  2875					   struct super_block *reference)
  2876	{
  2877		const struct superblock_security_struct *sbsec = selinux_superblock(reference);
  2878		struct selinux_mnt_opts *opts;
  2879	
  2880		/*
  2881		 * Ensure that fc->security remains NULL when no options are set
  2882		 * as expected by selinux_set_mnt_opts().
  2883		 */
  2884		if (!(sbsec->flags & (FSCONTEXT_MNT|CONTEXT_MNT|DEFCONTEXT_MNT)))
  2885			return 0;
  2886	
> 2887		if (!fc->security) {
  2888			int rc;
  2889	
  2890			rc = lsm_mnt_opts_alloc(&fc->security);
  2891			if (rc)
  2892				return rc;
  2893			opts = selinux_mnt_opts(fc->security);
  2894			opts->initialized = true;
  2895		}
  2896	
  2897		if (sbsec->flags & FSCONTEXT_MNT)
  2898			opts->fscontext_sid = sbsec->sid;
  2899		if (sbsec->flags & CONTEXT_MNT)
  2900			opts->context_sid = sbsec->mntpoint_sid;
  2901		if (sbsec->flags & DEFCONTEXT_MNT)
  2902			opts->defcontext_sid = sbsec->def_sid;
  2903		opts->initialized = true;
  2904		return 0;
  2905	}
  2906	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-25  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261124181522.30415-2-casey@schaufler-ca.com>
2026-11-25  2:49 ` [PATCH 1/1] LSM: infrastructure management of mount options kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox