Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v5 15/24] landlock: Log scoped denials
       [not found] <20250131163059.1139617-16-mic@digikod.net>
@ 2025-02-01  3:02 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-01  3:02 UTC (permalink / raw)
  To: Mickaël Salaün; +Cc: llvm, oe-kbuild-all

Hi Mickaël,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 69e858e0b8b2ea07759e995aa383e8780d9d140c]

url:    https://github.com/intel-lab-lkp/linux/commits/Micka-l-Sala-n/lsm-Add-audit_log_lsm_data-helper/20250201-004434
base:   69e858e0b8b2ea07759e995aa383e8780d9d140c
patch link:    https://lore.kernel.org/r/20250131163059.1139617-16-mic%40digikod.net
patch subject: [PATCH v5 15/24] landlock: Log scoped denials
config: powerpc-randconfig-001-20250201 (https://download.01.org/0day-ci/archive/20250201/202502011045.pZMKNT2k-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 355d0b186f178668b103068537e517f3d52ad639)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250201/202502011045.pZMKNT2k-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/202502011045.pZMKNT2k-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> security/landlock/task.c:414:28: warning: variable 'handle_layer' is uninitialized when used here [-Wuninitialized]
     414 |                 request.layer_plus_one = handle_layer + 1;
         |                                          ^~~~~~~~~~~~
   security/landlock/task.c:382:21: note: initialize the variable 'handle_layer' to silence this warning
     382 |         size_t handle_layer;
         |                            ^
         |                             = 0
   1 warning generated.


vim +/handle_layer +414 security/landlock/task.c

   378	
   379	static int hook_file_send_sigiotask(struct task_struct *tsk,
   380					    struct fown_struct *fown, int signum)
   381	{
   382		size_t handle_layer;
   383		const struct landlock_cred_security *subject;
   384		struct landlock_request request = {
   385			.type = LANDLOCK_REQUEST_SCOPE_SIGNAL,
   386			.audit = {
   387				.type = LSM_AUDIT_DATA_TASK,
   388				.u.tsk = tsk,
   389			},
   390		};
   391		bool is_scoped = false;
   392	
   393		/* Lock already held by send_sigio() and send_sigurg(). */
   394		lockdep_assert_held(&fown->lock);
   395		subject = &landlock_file(fown->file)->fown_subject;
   396	
   397		/*
   398		 * Quick return for unowned socket.
   399		 *
   400		 * subject->domain has already been filtered when saved by
   401		 * hook_file_set_fowner(), so there is no need to call
   402		 * landlock_get_applicable_subject() here.
   403		 */
   404		if (!subject->domain)
   405			return 0;
   406	
   407		scoped_guard(rcu)
   408		{
   409			is_scoped = domain_is_scoped(subject->domain,
   410						     landlock_get_task_domain(tsk),
   411						     signal_scope.scope);
   412		}
   413		if (is_scoped) {
 > 414			request.layer_plus_one = handle_layer + 1;
   415			landlock_log_denial(subject, &request);
   416			return -EPERM;
   417		}
   418	
   419		return 0;
   420	}
   421	

-- 
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:[~2025-02-01  3:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250131163059.1139617-16-mic@digikod.net>
2025-02-01  3:02 ` [PATCH v5 15/24] landlock: Log scoped denials 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