linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Mickaël Salaün" <mic@digikod.net>,
	"Christian Brauner" <brauner@kernel.org>,
	"Paul Moore" <paul@paul-moore.com>
Cc: oe-kbuild-all@lists.linux.dev, "Mickaël Salaün" <mic@digikod.net>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, selinux@vger.kernel.org,
	"Jan Kara" <jack@suse.cz>, "Al Viro" <viro@zeniv.linux.org.uk>,
	"Casey Schaufler" <casey@schaufler-ca.com>,
	"James Morris" <jmorris@namei.org>,
	"Jann Horn" <jannh@google.com>,
	"Ondrej Mosnacek" <omosnace@redhat.com>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	"Stephen Smalley" <stephen.smalley.work@gmail.com>
Subject: Re: [PATCH] fs,security: Fix file_set_fowner LSM hook inconsistencies
Date: Tue, 13 Aug 2024 19:44:55 +0800	[thread overview]
Message-ID: <202408131900.xhbYFHR4-lkp@intel.com> (raw)
In-Reply-To: <20240812144936.1616628-1-mic@digikod.net>

Hi Mickaël,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pcmoore-selinux/next]
[also build test WARNING on linus/master v6.11-rc3]
[cannot apply to brauner-vfs/vfs.all next-20240813]
[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/Micka-l-Sala-n/fs-security-Fix-file_set_fowner-LSM-hook-inconsistencies/20240813-004648
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git next
patch link:    https://lore.kernel.org/r/20240812144936.1616628-1-mic%40digikod.net
patch subject: [PATCH] fs,security: Fix file_set_fowner LSM hook inconsistencies
config: x86_64-randconfig-122-20240813 (https://download.01.org/0day-ci/archive/20240813/202408131900.xhbYFHR4-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240813/202408131900.xhbYFHR4-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/202408131900.xhbYFHR4-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/file_table.c:153:25: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct cred const [noderef] __rcu *cred @@     got struct cred const * @@
   fs/file_table.c:153:25: sparse:     expected struct cred const [noderef] __rcu *cred
   fs/file_table.c:153:25: sparse:     got struct cred const *
>> fs/file_table.c:157:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct cred const *cred @@     got struct cred const [noderef] __rcu *cred @@
   fs/file_table.c:157:36: sparse:     expected struct cred const *cred
   fs/file_table.c:157:36: sparse:     got struct cred const [noderef] __rcu *cred
   fs/file_table.c:69:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct cred const *cred @@     got struct cred const [noderef] __rcu *cred @@
   fs/file_table.c:69:28: sparse:     expected struct cred const *cred
   fs/file_table.c:69:28: sparse:     got struct cred const [noderef] __rcu *cred
   fs/file_table.c:69:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct cred const *cred @@     got struct cred const [noderef] __rcu *cred @@
   fs/file_table.c:69:28: sparse:     expected struct cred const *cred
   fs/file_table.c:69:28: sparse:     got struct cred const [noderef] __rcu *cred

vim +153 fs/file_table.c

   147	
   148	static int init_file(struct file *f, int flags, const struct cred *cred)
   149	{
   150		int error;
   151	
   152		f->f_cred = get_cred(cred);
 > 153		f->f_owner.cred = get_cred(cred);
   154		error = security_file_alloc(f);
   155		if (unlikely(error)) {
   156			put_cred(f->f_cred);
 > 157			put_cred(f->f_owner.cred);
   158			return error;
   159		}
   160	
   161		rwlock_init(&f->f_owner.lock);
   162		spin_lock_init(&f->f_lock);
   163		mutex_init(&f->f_pos_lock);
   164		f->f_flags = flags;
   165		f->f_mode = OPEN_FMODE(flags);
   166		/* f->f_version: 0 */
   167	
   168		/*
   169		 * We're SLAB_TYPESAFE_BY_RCU so initialize f_count last. While
   170		 * fget-rcu pattern users need to be able to handle spurious
   171		 * refcount bumps we should reinitialize the reused file first.
   172		 */
   173		atomic_long_set(&f->f_count, 1);
   174		return 0;
   175	}
   176	

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

  parent reply	other threads:[~2024-08-13 11:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 18:10 [PATCH v2 0/4] Landlock: Signal Scoping Support Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 1/4] Landlock: Add signal control Tahera Fahimi
2024-08-06 18:56   ` Jann Horn
2024-08-06 21:55     ` Jann Horn
2024-08-07 18:16       ` Mickaël Salaün
2024-08-07 23:36         ` Tahera Fahimi
2024-08-08  1:10           ` Jann Horn
2024-08-08 14:09             ` Mickaël Salaün
2024-08-08 14:42               ` Jann Horn
2024-08-09 10:59                 ` Mickaël Salaün
2024-08-09 12:40                   ` Mickaël Salaün
2024-08-09 12:45                     ` Mickaël Salaün
2024-08-09 12:44                   ` Jann Horn
2024-08-09 13:17                     ` f_modown and LSM inconsistency (was [PATCH v2 1/4] Landlock: Add signal control) Mickaël Salaün
2024-08-09 14:00                       ` Jann Horn
2024-08-09 14:44                         ` Christian Brauner
2024-08-11 22:04                         ` Paul Moore
2024-08-12 13:09                           ` Jann Horn
2024-08-12 14:55                             ` Mickaël Salaün
2024-08-12 14:57                             ` Paul Moore
2024-08-12 15:06                               ` Jann Horn
2024-08-12 16:30                                 ` Paul Moore
2024-08-12 17:27                                   ` Mickaël Salaün
2024-08-12 18:17                                     ` Paul Moore
2024-08-12 14:49                           ` [PATCH] fs,security: Fix file_set_fowner LSM hook inconsistencies Mickaël Salaün
2024-08-12 15:00                             ` Paul Moore
2024-08-13  1:32                             ` kernel test robot
2024-08-13  1:42                             ` kernel test robot
2024-08-13  1:42                             ` kernel test robot
2024-08-13 11:44                             ` kernel test robot [this message]
2024-08-09 13:37                     ` [PATCH v2 1/4] Landlock: Add signal control Mickaël Salaün
2024-08-09 13:57                       ` Jann Horn
2024-08-06 22:00     ` Tahera Fahimi
2024-08-06 22:55       ` Jann Horn
2024-08-06 18:10 ` [PATCH v2 2/4] selftest/Landlock: Signal restriction tests Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 3/4] sample/Landlock: Support signal scoping restriction Tahera Fahimi
2024-08-06 18:10 ` [PATCH v2 4/4] Landlock: Document LANDLOCK_SCOPED_SIGNAL Tahera Fahimi

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=202408131900.xhbYFHR4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=casey@schaufler-ca.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=stephen.smalley.work@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).