[pcmoore-selinux:working-selinuxns 7/12] security/selinux/hooks.c:7275:42: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git working-selinuxns
head:   7bde0cc97700a0abfbfa0ef5f00f9abb0ec0073c
commit: e9711bb4912b792b6ec307932cd08329d4a973ff [7/12] selinux: dynamically allocate selinux namespace
config: x86_64-randconfig-s021-20201116 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-107-gaf3512a6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git/commit/?id=e9711bb4912b792b6ec307932cd08329d4a973ff
        git remote add pcmoore-selinux https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
        git fetch --no-tags pcmoore-selinux working-selinuxns
        git checkout e9711bb4912b792b6ec307932cd08329d4a973ff
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
   security/selinux/hooks.c:215:30: sparse: sparse: cast removes address space '__rcu' of expression
   security/selinux/hooks.c:2541:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   security/selinux/hooks.c:2541:39: sparse:     expected struct spinlock [usertype] *lock
   security/selinux/hooks.c:2541:39: sparse:     got struct spinlock [noderef] __rcu *
   security/selinux/hooks.c:2549:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   security/selinux/hooks.c:2549:41: sparse:     expected struct spinlock [usertype] *lock
   security/selinux/hooks.c:2549:41: sparse:     got struct spinlock [noderef] __rcu *
   security/selinux/hooks.c:2555:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *real_parent @@
   security/selinux/hooks.c:2555:42: sparse:     expected struct task_struct *parent
   security/selinux/hooks.c:2555:42: sparse:     got struct task_struct [noderef] __rcu *real_parent
   security/selinux/hooks.c:5315:22: sparse: sparse: restricted __be16 degrades to integer
   security/selinux/hooks.c:5316:22: sparse: sparse: restricted __be16 degrades to integer
>> security/selinux/hooks.c:7275:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct selinux_policy *policy @@     got struct selinux_policy [noderef] __rcu *policy @@
>> security/selinux/hooks.c:7275:42: sparse:     expected struct selinux_policy *policy
>> security/selinux/hooks.c:7275:42: sparse:     got struct selinux_policy [noderef] __rcu *policy

vim +7275 security/selinux/hooks.c

  7265	
  7266	static void selinux_state_free(struct work_struct *work)
  7267	{
  7268		struct selinux_state *parent, *state =
  7269			container_of(work, struct selinux_state, work);
  7270	
  7271		do {
  7272			parent = state->parent;
  7273			if (state->status_page)
  7274				__free_page(state->status_page);
> 7275			selinux_policy_free(state->policy);
  7276			selinux_avc_free(state->avc);
  7277			kfree(state);
  7278			state = parent;
  7279		} while (state && refcount_dec_and_test(&state->count));
  7280	}
  7281	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux