All of lore.kernel.org
 help / color / mirror / Atom feed
* [jss-tpmdd:master 11/11] security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces))
@ 2020-03-16 22:47 kbuild test robot
  2020-03-17 16:56 ` Waiman Long
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2020-03-16 22:47 UTC (permalink / raw)
  To: kbuild-all

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

tree:   git://git.infradead.org/users/jjs/linux-tpmdd master
head:   86a030855ce6af96f745be6abbf968f9d46506ea
commit: 86a030855ce6af96f745be6abbf968f9d46506ea [11/11] KEYS: Don't write out to userspace while holding key semaphore
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-180-g0558317d-dirty
        git checkout 86a030855ce6af96f745be6abbf968f9d46506ea
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> security/keys/keyring.c:93:27: sparse:    expected long ( *read )( ... )
>> security/keys/keyring.c:93:27: sparse:    got long ( * )( ... )
>> security/keys/keyring.c:469:21: sparse: sparse: dereference of noderef expression
   security/keys/keyring.c:1234:5: sparse: sparse: context imbalance in '__key_link_lock' - wrong count at exit
   security/keys/keyring.c:1256:5: sparse: sparse: context imbalance in '__key_move_lock' - wrong count at exit
   security/keys/keyring.c:1396:9: sparse: sparse: context imbalance in '__key_link_end' - wrong count at exit
   security/keys/keyring.c:1459:9: sparse: sparse: context imbalance in 'key_link' - wrong count at exit
   security/keys/keyring.c:1467:12: sparse: sparse: context imbalance in '__key_unlink_lock' - wrong count at exit
   security/keys/keyring.c:1520:9: sparse: sparse: context imbalance in '__key_unlink_end' - wrong count at exit
   security/keys/keyring.c:1540:5: sparse: sparse: context imbalance in 'key_unlink' - wrong count at exit
   security/keys/keyring.c:1585:5: sparse: sparse: context imbalance in 'key_move' - different lock contexts for basic block
--
>> security/keys/user_defined.c:32:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> security/keys/user_defined.c:32:35: sparse:    expected long ( *read )( ... )
>> security/keys/user_defined.c:32:35: sparse:    got long ( * )( ... )
   security/keys/user_defined.c:171:6: sparse: sparse: symbol 'user_read' redeclared with different type (incompatible argument 2 (different address spaces)):
>> security/keys/user_defined.c:171:6: sparse:    long extern [signed] [addressable] [toplevel] user_read( ... )
>> include/keys/user-type.h:44:13: sparse: note: previously declared as:
>> include/keys/user-type.h:44:13: sparse:    long extern [signed] [addressable] [toplevel] user_read( ... )
--
>> security/keys/big_key.c:77:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> security/keys/big_key.c:77:35: sparse:    expected long ( *read )( ... )
>> security/keys/big_key.c:77:35: sparse:    got long ( * )( ... )
   security/keys/big_key.c:355:6: sparse: sparse: symbol 'big_key_read' redeclared with different type (incompatible argument 2 (different address spaces)):
>> security/keys/big_key.c:355:6: sparse:    long extern [signed] [addressable] [toplevel] big_key_read( ... )
>> include/keys/big_key-type.h:20:13: sparse: note: previously declared as:
>> include/keys/big_key-type.h:20:13: sparse:    long extern [signed] [addressable] [toplevel] big_key_read( ... )
--
>> net/rxrpc/key.c:48:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> net/rxrpc/key.c:48:27: sparse:    expected long ( *read )( ... )
>> net/rxrpc/key.c:48:27: sparse:    got long ( * )( ... )
--
>> net/dns_resolver/dns_key.c:325:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> net/dns_resolver/dns_key.c:325:27: sparse:    expected long ( *read )( ... )
>> net/dns_resolver/dns_key.c:325:27: sparse:    got long ( * )( ... )
--
>> fs/nfs/nfs4idmap.c:193:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> fs/nfs/nfs4idmap.c:193:27: sparse:    expected long ( *read )( ... )
>> fs/nfs/nfs4idmap.c:193:27: sparse:    got long ( * )( ... )
   fs/nfs/nfs4idmap.c:418:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
   fs/nfs/nfs4idmap.c:418:27: sparse:    expected long ( *read )( ... )
   fs/nfs/nfs4idmap.c:418:27: sparse:    got long ( * )( ... )
--
>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse:    expected long ( *read )( ... )
>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse:    got long ( * )( ... )

vim +93 security/keys/keyring.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  68  
^1da177e4c3f41 Linus Torvalds 2005-04-16  69  /*
973c9f4f49ca96 David Howells  2011-01-20  70   * The keyring key type definition.  Keyrings are simply keys of this type and
973c9f4f49ca96 David Howells  2011-01-20  71   * can be treated as ordinary keys in addition to having their own special
973c9f4f49ca96 David Howells  2011-01-20  72   * operations.
^1da177e4c3f41 Linus Torvalds 2005-04-16  73   */
5d19e20b534ff4 David Howells  2014-07-18  74  static int keyring_preparse(struct key_preparsed_payload *prep);
5d19e20b534ff4 David Howells  2014-07-18  75  static void keyring_free_preparse(struct key_preparsed_payload *prep);
^1da177e4c3f41 Linus Torvalds 2005-04-16  76  static int keyring_instantiate(struct key *keyring,
cf7f601c067994 David Howells  2012-09-13  77  			       struct key_preparsed_payload *prep);
31204ed925b067 David Howells  2006-06-26  78  static void keyring_revoke(struct key *keyring);
^1da177e4c3f41 Linus Torvalds 2005-04-16  79  static void keyring_destroy(struct key *keyring);
^1da177e4c3f41 Linus Torvalds 2005-04-16  80  static void keyring_describe(const struct key *keyring, struct seq_file *m);
^1da177e4c3f41 Linus Torvalds 2005-04-16  81  static long keyring_read(const struct key *keyring,
^1da177e4c3f41 Linus Torvalds 2005-04-16  82  			 char __user *buffer, size_t buflen);
^1da177e4c3f41 Linus Torvalds 2005-04-16  83  
^1da177e4c3f41 Linus Torvalds 2005-04-16  84  struct key_type key_type_keyring = {
^1da177e4c3f41 Linus Torvalds 2005-04-16  85  	.name		= "keyring",
b2a4df200d570b David Howells  2013-09-24  86  	.def_datalen	= 0,
5d19e20b534ff4 David Howells  2014-07-18  87  	.preparse	= keyring_preparse,
5d19e20b534ff4 David Howells  2014-07-18  88  	.free_preparse	= keyring_free_preparse,
^1da177e4c3f41 Linus Torvalds 2005-04-16  89  	.instantiate	= keyring_instantiate,
31204ed925b067 David Howells  2006-06-26  90  	.revoke		= keyring_revoke,
^1da177e4c3f41 Linus Torvalds 2005-04-16  91  	.destroy	= keyring_destroy,
^1da177e4c3f41 Linus Torvalds 2005-04-16  92  	.describe	= keyring_describe,
^1da177e4c3f41 Linus Torvalds 2005-04-16 @93  	.read		= keyring_read,
^1da177e4c3f41 Linus Torvalds 2005-04-16  94  };
7318226ea2931a David Howells  2007-04-26  95  EXPORT_SYMBOL(key_type_keyring);
7318226ea2931a David Howells  2007-04-26  96  

:::::: The code at line 93 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [jss-tpmdd:master 11/11] security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces))
  2020-03-16 22:47 [jss-tpmdd:master 11/11] security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) kbuild test robot
@ 2020-03-17 16:56 ` Waiman Long
  0 siblings, 0 replies; 2+ messages in thread
From: Waiman Long @ 2020-03-17 16:56 UTC (permalink / raw)
  To: kbuild-all

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

On 3/16/20 6:47 PM, kbuild test robot wrote:
> tree:   git://git.infradead.org/users/jjs/linux-tpmdd master
> head:   86a030855ce6af96f745be6abbf968f9d46506ea
> commit: 86a030855ce6af96f745be6abbf968f9d46506ea [11/11] KEYS: Don't write out to userspace while holding key semaphore
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-180-g0558317d-dirty
>         git checkout 86a030855ce6af96f745be6abbf968f9d46506ea
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> security/keys/keyring.c:93:27: sparse:    expected long ( *read )( ... )
>>> security/keys/keyring.c:93:27: sparse:    got long ( * )( ... )
>>> security/keys/keyring.c:469:21: sparse: sparse: dereference of noderef expression
>    security/keys/keyring.c:1234:5: sparse: sparse: context imbalance in '__key_link_lock' - wrong count at exit
>    security/keys/keyring.c:1256:5: sparse: sparse: context imbalance in '__key_move_lock' - wrong count at exit
>    security/keys/keyring.c:1396:9: sparse: sparse: context imbalance in '__key_link_end' - wrong count at exit
>    security/keys/keyring.c:1459:9: sparse: sparse: context imbalance in 'key_link' - wrong count at exit
>    security/keys/keyring.c:1467:12: sparse: sparse: context imbalance in '__key_unlink_lock' - wrong count at exit
>    security/keys/keyring.c:1520:9: sparse: sparse: context imbalance in '__key_unlink_end' - wrong count at exit
>    security/keys/keyring.c:1540:5: sparse: sparse: context imbalance in 'key_unlink' - wrong count at exit
>    security/keys/keyring.c:1585:5: sparse: sparse: context imbalance in 'key_move' - different lock contexts for basic block
> --

I don't quite what is wrong here. I didn't make any change to these
functions.


>>> security/keys/user_defined.c:32:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> security/keys/user_defined.c:32:35: sparse:    expected long ( *read )( ... )
>>> security/keys/user_defined.c:32:35: sparse:    got long ( * )( ... )
>    security/keys/user_defined.c:171:6: sparse: sparse: symbol 'user_read' redeclared with different type (incompatible argument 2 (different address spaces)):
>>> security/keys/user_defined.c:171:6: sparse:    long extern [signed] [addressable] [toplevel] user_read( ... )
>>> include/keys/user-type.h:44:13: sparse: note: previously declared as:
>>> include/keys/user-type.h:44:13: sparse:    long extern [signed] [addressable] [toplevel] user_read( ... )
> --
>>> security/keys/big_key.c:77:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> security/keys/big_key.c:77:35: sparse:    expected long ( *read )( ... )
>>> security/keys/big_key.c:77:35: sparse:    got long ( * )( ... )
>    security/keys/big_key.c:355:6: sparse: sparse: symbol 'big_key_read' redeclared with different type (incompatible argument 2 (different address spaces)):
>>> security/keys/big_key.c:355:6: sparse:    long extern [signed] [addressable] [toplevel] big_key_read( ... )
>>> include/keys/big_key-type.h:20:13: sparse: note: previously declared as:
>>> include/keys/big_key-type.h:20:13: sparse:    long extern [signed] [addressable] [toplevel] big_key_read( ... )
> --

I did missed removing the __user annotation from
include/keys/big_key-type.h and include/keys/user-type.h. I will update
the patch to add those.


>>> net/rxrpc/key.c:48:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> net/rxrpc/key.c:48:27: sparse:    expected long ( *read )( ... )
>>> net/rxrpc/key.c:48:27: sparse:    got long ( * )( ... )
> --
>>> net/dns_resolver/dns_key.c:325:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> net/dns_resolver/dns_key.c:325:27: sparse:    expected long ( *read )( ... )
>>> net/dns_resolver/dns_key.c:325:27: sparse:    got long ( * )( ... )
> --
>>> fs/nfs/nfs4idmap.c:193:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> fs/nfs/nfs4idmap.c:193:27: sparse:    expected long ( *read )( ... )
>>> fs/nfs/nfs4idmap.c:193:27: sparse:    got long ( * )( ... )
>    fs/nfs/nfs4idmap.c:418:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>    fs/nfs/nfs4idmap.c:418:27: sparse:    expected long ( *read )( ... )
>    fs/nfs/nfs4idmap.c:418:27: sparse:    got long ( * )( ... )
> --
>>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@    expected long ( *read )( ... ) @@    got long ( *read )( ... ) @@
>>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse:    expected long ( *read )( ... )
>>> crypto/asymmetric_keys/pkcs7_key_type.c:78:35: sparse:    got long ( * )( ... )

I didn't realize that the keys infrastructure is also used outside of
the security domain. I will create additional patches to remove the
__user annotation for those affected files.

Cheers,
Longman


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-17 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 22:47 [jss-tpmdd:master 11/11] security/keys/keyring.c:93:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) kbuild test robot
2020-03-17 16:56 ` Waiman Long

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.