From: kernel test robot <lkp@intel.com>
To: " Thiébaud Weksteen" <tweek@google.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Paul Moore <paul@paul-moore.com>,
Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: mm/memfd.c:452:26: sparse: sparse: Initializer entry defined twice
Date: Thu, 03 Dec 2026 09:56:42 +0100 [thread overview]
Message-ID: <20261203094828.YwLaEPBb-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
commit: 094e94d13b606b820e3d1383e3a361f680ff023a memfd,selinux: call security_inode_init_security_anon()
date: 1 year, 1 month ago
config: um-randconfig-r2308-20261203 (https://download.01.org/0day-ci/archive/20261203/20261203094828.YwLaEPBb-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261203/20261203094828.YwLaEPBb-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
| Fixes: 094e94d13b60 ("memfd,selinux: call security_inode_init_security_anon()")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261203094828.YwLaEPBb-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> mm/memfd.c:452:26: sparse: sparse: Initializer entry defined twice
mm/memfd.c:452:26: sparse: also defined here
vim +452 mm/memfd.c
431
432 static struct file *alloc_file(const char *name, unsigned int flags)
433 {
434 unsigned int *file_seals;
435 struct file *file;
436 struct inode *inode;
437 int err = 0;
438
439 if (flags & MFD_HUGETLB) {
440 file = hugetlb_file_setup(name, 0, VM_NORESERVE,
441 HUGETLB_ANONHUGE_INODE,
442 (flags >> MFD_HUGE_SHIFT) &
443 MFD_HUGE_MASK);
444 } else {
445 file = shmem_file_setup(name, 0, VM_NORESERVE);
446 }
447 if (IS_ERR(file))
448 return file;
449
450 inode = file_inode(file);
451 err = security_inode_init_security_anon(inode,
> 452 &QSTR(MEMFD_ANON_NAME), NULL);
453 if (err) {
454 fput(file);
455 file = ERR_PTR(err);
456 return file;
457 }
458
459 file->f_mode |= FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
460 file->f_flags |= O_LARGEFILE;
461
462 if (flags & MFD_NOEXEC_SEAL) {
463 inode->i_mode &= ~0111;
464 file_seals = memfd_file_seals_ptr(file);
465 if (file_seals) {
466 *file_seals &= ~F_SEAL_SEAL;
467 *file_seals |= F_SEAL_EXEC;
468 }
469 } else if (flags & MFD_ALLOW_SEALING) {
470 /* MFD_EXEC and MFD_ALLOW_SEALING are set */
471 file_seals = memfd_file_seals_ptr(file);
472 if (file_seals)
473 *file_seals &= ~F_SEAL_SEAL;
474 }
475
476 return file;
477 }
478
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-12-03 8:56 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=20261203094828.YwLaEPBb-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=paul@paul-moore.com \
--cc=stephen.smalley.work@gmail.com \
--cc=tweek@google.com \
/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
all inboxes | Powered by JetHome®