[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202512140157.ty6KKiij-lkp@intel.com>
Date: Sun, 14 Dec 2025 02:08:47 +0800
From: kernel test robot <lkp@...el.com>
To: Mickaël Salaün <mic@...ikod.net>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: security/landlock/task.c:112:26: sparse: sparse: Initializer entry
defined twice
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@...el.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
Powered by blists - more mailing lists