mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: security/landlock/task.c:112:26: sparse: sparse: Initializer entry defined twice
Date: Sun, 14 Dec 2025 02:08:47 +0800	[thread overview]
Message-ID: <202512140157.ty6KKiij-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9d9c1cfec01cdbf24bd9322ed555713a20422115
commit: 33e65b0d3add6bdc731e9298995cbbc979349f51 landlock: Add AUDIT_LANDLOCK_ACCESS and log ptrace denials
date:   9 months ago
config: arm64-randconfig-r112-20251213 (https://download.01.org/0day-ci/archive/20251214/202512140157.ty6KKiij-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251214/202512140157.ty6KKiij-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/202512140157.ty6KKiij-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> security/landlock/task.c:112:26: sparse: sparse: Initializer entry defined twice
   security/landlock/task.c:113:34: sparse:   also defined here
   security/landlock/task.c:158:18: sparse: sparse: Initializer entry defined twice
   security/landlock/task.c:159:26: sparse:   also defined here

vim +112 security/landlock/task.c

    71	
    72	/**
    73	 * hook_ptrace_access_check - Determines whether the current process may access
    74	 *			      another
    75	 *
    76	 * @child: Process to be accessed.
    77	 * @mode: Mode of attachment.
    78	 *
    79	 * If the current task has Landlock rules, then the child must have at least
    80	 * the same rules.  Else denied.
    81	 *
    82	 * Determines whether a process may access another, returning 0 if permission
    83	 * granted, -errno if denied.
    84	 */
    85	static int hook_ptrace_access_check(struct task_struct *const child,
    86					    const unsigned int mode)
    87	{
    88		const struct landlock_cred_security *parent_subject;
    89		const struct landlock_ruleset *child_dom;
    90		int err;
    91	
    92		/* Quick return for non-landlocked tasks. */
    93		parent_subject = landlock_cred(current_cred());
    94		if (!parent_subject)
    95			return 0;
    96	
    97		scoped_guard(rcu)
    98		{
    99			child_dom = landlock_get_task_domain(child);
   100			err = domain_ptrace(parent_subject->domain, child_dom);
   101		}
   102	
   103		if (!err)
   104			return 0;
   105	
   106		/*
   107		 * For the ptrace_access_check case, we log the current/parent domain
   108		 * and the child task.
   109		 */
   110		if (!(mode & PTRACE_MODE_NOAUDIT))
   111			landlock_log_denial(parent_subject, &(struct landlock_request) {
 > 112				.type = LANDLOCK_REQUEST_PTRACE,
   113				.audit = {
   114					.type = LSM_AUDIT_DATA_TASK,
   115					.u.tsk = child,
   116				},
   117				.layer_plus_one = parent_subject->domain->num_layers,
   118			});
   119	
   120		return err;
   121	}
   122	

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

             reply	other threads:[~2025-12-13 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13 18:08 kernel test robot [this message]
2026-01-17  3:10 kernel test robot

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=202512140157.ty6KKiij-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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

Powered by JetHome