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(a)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