linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* security/smack/smack_lsm.c:2498:27: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-08-07 22:22 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-07 22:22 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel, Casey Schaufler

[-- Attachment #1: Type: text/plain, Size: 4756 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5631c5e0eb9035d92ceb20fcd9cdb7779a3f5cc7
commit: 00720f0e7f288d29681d265c23b22bb0f0f4e5b4 smack: avoid unused 'sip' variable warning
date:   3 months ago
config: s390-randconfig-s032-20200808 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-118-ge1578773-dirty
        git checkout 00720f0e7f288d29681d265c23b22bb0f0f4e5b4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

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


sparse warnings: (new ones prefixed by >>)

   security/smack/smack_lsm.c:1780:61: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct cred const *cred @@     got struct cred const [noderef] <asn:4> *cred @@
   security/smack/smack_lsm.c:1780:61: sparse:     expected struct cred const *cred
   security/smack/smack_lsm.c:1780:61: sparse:     got struct cred const [noderef] <asn:4> *cred
>> security/smack/smack_lsm.c:2498:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] dport @@     got unsigned short [usertype] @@
   security/smack/smack_lsm.c:2498:27: sparse:     expected restricted __be16 [usertype] dport
>> security/smack/smack_lsm.c:2498:27: sparse:     got unsigned short [usertype]
   security/smack/smack_lsm.c:4751:30: sparse: sparse: cast removes address space '<asn:4>' of expression

vim +2498 security/smack/smack_lsm.c

e114e473771c84 Casey Schaufler 2008-02-04  2475  
21abb1ec414c75 Casey Schaufler 2015-07-22  2476  /**
21abb1ec414c75 Casey Schaufler 2015-07-22  2477   * smk_ipv6_check - check Smack access
21abb1ec414c75 Casey Schaufler 2015-07-22  2478   * @subject: subject Smack label
21abb1ec414c75 Casey Schaufler 2015-07-22  2479   * @object: object Smack label
21abb1ec414c75 Casey Schaufler 2015-07-22  2480   * @address: address
21abb1ec414c75 Casey Schaufler 2015-07-22  2481   * @act: the action being taken
21abb1ec414c75 Casey Schaufler 2015-07-22  2482   *
21abb1ec414c75 Casey Schaufler 2015-07-22  2483   * Check an IPv6 access
21abb1ec414c75 Casey Schaufler 2015-07-22  2484   */
21abb1ec414c75 Casey Schaufler 2015-07-22  2485  static int smk_ipv6_check(struct smack_known *subject,
21abb1ec414c75 Casey Schaufler 2015-07-22  2486  				struct smack_known *object,
21abb1ec414c75 Casey Schaufler 2015-07-22  2487  				struct sockaddr_in6 *address, int act)
21abb1ec414c75 Casey Schaufler 2015-07-22  2488  {
21abb1ec414c75 Casey Schaufler 2015-07-22  2489  #ifdef CONFIG_AUDIT
21abb1ec414c75 Casey Schaufler 2015-07-22  2490  	struct lsm_network_audit net;
21abb1ec414c75 Casey Schaufler 2015-07-22  2491  #endif
21abb1ec414c75 Casey Schaufler 2015-07-22  2492  	struct smk_audit_info ad;
21abb1ec414c75 Casey Schaufler 2015-07-22  2493  	int rc;
21abb1ec414c75 Casey Schaufler 2015-07-22  2494  
21abb1ec414c75 Casey Schaufler 2015-07-22  2495  #ifdef CONFIG_AUDIT
21abb1ec414c75 Casey Schaufler 2015-07-22  2496  	smk_ad_init_net(&ad, __func__, LSM_AUDIT_DATA_NET, &net);
21abb1ec414c75 Casey Schaufler 2015-07-22  2497  	ad.a.u.net->family = PF_INET6;
21abb1ec414c75 Casey Schaufler 2015-07-22 @2498  	ad.a.u.net->dport = ntohs(address->sin6_port);
21abb1ec414c75 Casey Schaufler 2015-07-22  2499  	if (act == SMK_RECEIVING)
21abb1ec414c75 Casey Schaufler 2015-07-22  2500  		ad.a.u.net->v6info.saddr = address->sin6_addr;
21abb1ec414c75 Casey Schaufler 2015-07-22  2501  	else
21abb1ec414c75 Casey Schaufler 2015-07-22  2502  		ad.a.u.net->v6info.daddr = address->sin6_addr;
21abb1ec414c75 Casey Schaufler 2015-07-22  2503  #endif
21abb1ec414c75 Casey Schaufler 2015-07-22  2504  	rc = smk_access(subject, object, MAY_WRITE, &ad);
21abb1ec414c75 Casey Schaufler 2015-07-22  2505  	rc = smk_bu_note("IPv6 check", subject, object, MAY_WRITE, rc);
21abb1ec414c75 Casey Schaufler 2015-07-22  2506  	return rc;
21abb1ec414c75 Casey Schaufler 2015-07-22  2507  }
21abb1ec414c75 Casey Schaufler 2015-07-22  2508  

:::::: The code at line 2498 was first introduced by commit
:::::: 21abb1ec414c75abe32c3854848ff30e2b4a6113 Smack: IPv6 host labeling

:::::: TO: Casey Schaufler <casey@schaufler-ca.com>
:::::: CC: Casey Schaufler <casey@schaufler-ca.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27007 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-07 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 22:22 security/smack/smack_lsm.c:2498:27: sparse: sparse: incorrect type in assignment (different base types) kernel test robot

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).