David Howells
0837e49ab3
KEYS: Differentiate uses of rcu_dereference_key() and user_key_payload()
...
rcu_dereference_key() and user_key_payload() are currently being used in
two different, incompatible ways:
(1) As a wrapper to rcu_dereference() - when only the RCU read lock used
to protect the key.
(2) As a wrapper to rcu_dereference_protected() - when the key semaphor is
used to protect the key and the may be being modified.
Fix this by splitting both of the key wrappers to produce:
(1) RCU accessors for keys when caller has the key semaphore locked:
dereference_key_locked()
user_key_payload_locked()
(2) RCU accessors for keys when caller holds the RCU read lock:
dereference_key_rcu()
user_key_payload_rcu()
This should fix following warning in the NFS idmapper
===============================
[ INFO: suspicious RCU usage. ]
4.10.0 #1 Tainted: G W
-------------------------------
./include/keys/user-type.h:53 suspicious rcu_dereference_protected() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 0
1 lock held by mount.nfs/5987:
#0 : (rcu_read_lock){......}, at: [<d000000002527abc>] nfs_idmap_get_key+0x15c/0x420 [nfsv4]
stack backtrace:
CPU: 1 PID: 5987 Comm: mount.nfs Tainted: G W 4.10.0 #1
Call Trace:
dump_stack+0xe8/0x154 (unreliable)
lockdep_rcu_suspicious+0x140/0x190
nfs_idmap_get_key+0x380/0x420 [nfsv4]
nfs_map_name_to_uid+0x2a0/0x3b0 [nfsv4]
decode_getfattr_attrs+0xfac/0x16b0 [nfsv4]
decode_getfattr_generic.constprop.106+0xbc/0x150 [nfsv4]
nfs4_xdr_dec_lookup_root+0xac/0xb0 [nfsv4]
rpcauth_unwrap_resp+0xe8/0x140 [sunrpc]
call_decode+0x29c/0x910 [sunrpc]
__rpc_execute+0x140/0x8f0 [sunrpc]
rpc_run_task+0x170/0x200 [sunrpc]
nfs4_call_sync_sequence+0x68/0xa0 [nfsv4]
_nfs4_lookup_root.isra.44+0xd0/0xf0 [nfsv4]
nfs4_lookup_root+0xe0/0x350 [nfsv4]
nfs4_lookup_root_sec+0x70/0xa0 [nfsv4]
nfs4_find_root_sec+0xc4/0x100 [nfsv4]
nfs4_proc_get_rootfh+0x5c/0xf0 [nfsv4]
nfs4_get_rootfh+0x6c/0x190 [nfsv4]
nfs4_server_common_setup+0xc4/0x260 [nfsv4]
nfs4_create_server+0x278/0x3c0 [nfsv4]
nfs4_remote_mount+0x50/0xb0 [nfsv4]
mount_fs+0x74/0x210
vfs_kern_mount+0x78/0x220
nfs_do_root_mount+0xb0/0x140 [nfsv4]
nfs4_try_mount+0x60/0x100 [nfsv4]
nfs_fs_mount+0x5ec/0xda0 [nfs]
mount_fs+0x74/0x210
vfs_kern_mount+0x78/0x220
do_mount+0x254/0xf70
SyS_mount+0x94/0x100
system_call+0x38/0xe0
Reported-by: Jan Stancek <jstancek@redhat.com >
Signed-off-by: David Howells <dhowells@redhat.com >
Tested-by: Jan Stancek <jstancek@redhat.com >
Signed-off-by: James Morris <james.l.morris@oracle.com >
2017-03-02 10:09:00 +11:00
..
2016-12-14 20:42:45 -08:00
2017-02-08 11:19:43 -08:00
2017-02-06 15:13:24 +01:00
2017-02-24 19:04:57 +01:00
2016-11-02 20:44:20 +01:00
2017-02-20 12:16:11 +01:00
2017-01-25 11:51:39 +05:30
2017-01-09 10:04:09 +09:00
2017-02-10 15:20:44 +01:00
2016-11-29 09:17:20 +01:00
2017-02-23 08:46:04 -08:00
2017-01-24 12:37:43 -08:00
2017-01-28 18:21:49 +00:00
2017-01-31 11:31:49 -08:00
2017-02-22 18:22:53 -08:00
2017-02-27 19:59:21 -08:00
2017-02-23 10:57:56 -05:00
2017-02-23 11:27:49 -08:00
2017-02-22 10:15:09 -08:00
2017-02-27 18:43:46 -08:00
2017-02-12 14:45:11 +01:00
2016-10-03 19:43:08 -07:00
2016-12-14 10:49:33 -08:00
2017-01-26 15:27:54 +01:00
2017-02-27 19:59:21 -08:00
2017-01-12 02:30:13 +01:00
2017-02-19 18:10:42 -05:00
2016-10-07 09:45:43 -07:00
2016-12-05 11:38:30 +00:00
2016-10-18 20:12:05 +05:30
2017-02-06 13:49:29 -08:00
2017-02-01 11:01:30 +01:00
2017-02-23 15:57:04 -08:00
2017-02-27 18:43:46 -08:00
2017-02-28 15:39:09 -08:00
2017-01-20 15:27:35 +08:00
2016-12-06 16:57:33 +01:00
2017-02-20 17:55:15 -08:00
2016-12-05 14:31:24 -05:00
2016-12-22 22:58:37 -05:00
2016-12-01 14:45:08 +01:00
2017-02-08 14:54:12 +00:00
2017-02-16 10:08:41 +05:30
2016-10-19 14:34:36 -04:00
2016-12-15 12:13:31 +00:00
2017-02-21 13:25:50 -08:00
2016-10-11 15:06:31 -07:00
2016-10-11 15:06:31 -07:00
2017-02-02 08:20:50 -07:00
2017-02-02 08:21:32 -07:00
2017-02-15 11:22:05 -08:00
2017-02-10 15:52:24 -05:00
2016-10-07 18:46:26 -07:00
2017-01-31 14:00:44 -07:00
2016-11-01 09:43:26 -06:00
2017-02-23 11:55:46 -07:00
2017-02-17 14:06:45 -07:00
2017-02-02 10:20:16 -07:00
2016-10-07 18:46:28 -07:00
2017-01-25 13:17:47 -05:00
2016-12-08 13:31:11 -05:00
2017-02-12 21:52:19 -05:00
2017-02-17 13:40:05 -05:00
2017-02-07 13:03:10 -05:00
2017-01-27 15:08:35 -07:00
2017-02-08 15:41:43 -08:00
2017-02-24 17:46:56 -08:00
2016-12-22 09:25:45 -08:00
2016-11-22 13:21:00 -06:00
2016-10-25 11:08:28 +08:00
2017-02-14 08:29:56 -07:00
2017-01-10 11:14:27 -05:00
2017-01-10 11:14:27 -05:00
2016-12-27 14:49:05 -05:00
2016-12-27 14:52:47 -05:00
2016-10-17 15:27:27 -07:00
2016-12-08 16:37:33 -08:00
2017-02-07 20:58:30 +01:00
2017-01-14 11:29:43 +01:00
2017-02-24 17:46:55 -08:00
2016-10-07 18:46:29 -07:00
2017-02-27 18:43:45 -08:00
2017-02-28 10:15:59 -08:00
2017-02-27 23:09:29 -08:00
2016-12-21 10:16:05 -08:00
2017-01-25 11:54:02 +01:00
2017-01-14 19:32:40 -05:00
2016-12-25 10:47:43 +01:00
2017-02-04 00:47:59 +01:00
2017-02-22 10:46:44 -08:00
2017-01-31 08:32:13 +11:00
2017-02-20 10:06:32 -08:00
2017-02-01 09:14:07 +01:00
2016-10-07 18:46:30 -07:00
2016-12-17 16:00:34 -08:00
2017-02-02 11:52:14 -05:00
2016-10-11 15:06:30 -07:00
2017-02-24 17:46:54 -08:00
2017-02-27 18:43:46 -08:00
2016-12-05 19:01:16 -05:00
2017-02-23 20:33:51 -08:00
2017-01-20 14:32:39 -08:00
2017-02-07 10:57:47 +01:00
2016-11-23 10:07:35 +08:00
2017-01-31 15:46:49 +09:00
2017-01-27 15:08:35 -07:00
2017-02-25 13:45:43 -08:00
2016-10-28 08:48:16 -06:00
2016-12-30 13:34:16 +01:00
2017-02-24 17:46:55 -08:00
2016-10-25 14:40:39 +02:00
2017-01-09 21:13:49 +05:30
2017-02-06 13:14:10 +01:00
2017-02-25 13:45:43 -08:00
2017-01-31 09:03:20 +05:30
2016-10-27 16:16:09 -04:00
2016-12-25 11:04:12 +01:00
2017-01-06 15:56:18 +01:00
2017-02-01 08:45:46 +01:00
2017-02-07 10:42:10 +01:00
2017-02-10 09:09:59 -07:00
2017-01-29 19:24:12 -05:00
2017-02-03 08:28:25 -08:00
2016-10-06 09:07:44 -04:00
2017-01-09 10:04:58 +09:00
2016-11-25 10:15:13 -08:00
2016-10-03 09:11:14 -07:00
2016-10-20 14:51:10 -04:00
2016-10-15 10:03:15 -07:00
2016-12-05 19:01:16 -05:00
2017-02-21 17:56:45 -08:00
2016-11-11 08:12:37 -08:00
2017-02-27 18:43:46 -08:00
2017-01-31 13:23:09 -05:00
2017-02-06 23:26:43 -05:00
2017-02-06 23:26:43 -05:00
2017-02-06 23:26:43 -05:00
2017-02-10 15:19:48 +01:00
2016-12-05 15:13:58 +01:00
2017-02-06 08:54:01 +01:00
2017-02-20 13:51:07 +01:00
2017-02-23 20:33:51 -08:00
2016-12-05 18:58:32 -05:00
2016-12-15 13:49:34 -08:00
2016-12-25 17:21:22 +01:00
2016-11-29 15:57:42 +00:00
2017-02-02 08:23:19 -07:00
2016-10-27 16:16:09 -04:00
2017-02-24 17:46:55 -08:00
2016-11-07 16:24:29 -08:00
2016-10-20 14:51:09 -04:00
2016-10-17 14:23:46 +02:00
2016-12-03 10:06:13 +00:00
2017-01-05 13:07:24 +00:00
2016-12-14 10:12:26 +01:00
2016-10-20 14:51:10 -04:00
2017-02-10 11:15:08 +01:00
2017-02-24 17:46:54 -08:00
2017-02-22 16:41:28 -08:00
2016-11-21 22:50:45 +08:00
2016-12-09 21:54:22 -08:00
2017-02-14 10:20:35 -08:00
2016-11-24 16:22:06 +01:00
2017-02-25 14:21:18 -08:00
2017-01-31 14:00:44 -07:00
2017-02-13 21:44:03 -05:00
2017-02-08 10:06:24 +01:00
2016-11-27 20:38:47 -05:00
2017-02-03 15:21:21 -05:00
2017-01-27 11:32:26 -05:00
2017-02-11 20:59:41 -05:00
2017-02-11 20:59:41 -05:00
2016-10-07 23:50:39 -04:00
2016-11-15 12:16:13 -05:00
2016-12-20 09:48:44 -08:00
2017-01-27 13:05:26 -08:00
2017-02-07 12:32:52 -08:00
2017-02-10 15:13:10 +01:00
2016-11-09 08:25:09 +01:00
2016-10-26 15:45:38 +10:00
2017-02-24 17:46:54 -08:00
2017-02-10 15:13:10 +01:00
2017-02-24 17:46:56 -08:00
2017-01-05 15:01:55 -06:00
2017-01-27 10:25:34 -05:00
2017-02-20 10:52:23 -08:00
2017-01-23 15:00:45 +00:00
2016-12-24 11:46:01 -08:00
2017-02-01 09:13:45 +01:00
2017-01-12 14:33:16 +01:00
2017-02-27 13:26:17 -08:00
2017-02-24 17:46:56 -08:00
2017-02-27 18:43:47 -08:00
2016-12-14 16:04:08 -08:00
2016-10-09 12:23:38 -07:00
2017-02-01 09:13:58 +01:00
2017-02-24 17:46:57 -08:00
2016-12-27 14:49:03 -05:00
2016-12-16 09:26:42 -08:00
2017-03-02 10:09:00 +11:00
2016-10-11 15:06:33 -07:00
2017-01-19 12:45:33 +01:00
2017-02-27 18:43:45 -08:00
2017-02-10 09:04:19 +01:00
2016-12-12 18:55:06 -08:00
2016-12-25 17:21:23 +01:00
2017-02-17 12:28:01 +01:00
2017-01-29 19:59:42 +01:00
2017-02-21 17:21:32 -08:00
2016-12-06 16:08:10 -08:00
2017-01-31 08:32:13 -07:00
2017-02-03 16:35:42 -05:00
2017-01-23 11:37:13 -08:00
2016-11-30 14:32:25 +11:00
2017-02-03 09:56:43 -08:00
2017-02-10 10:28:49 +11:00
2017-02-24 17:46:57 -08:00
2017-02-02 22:05:28 -05:00
2017-01-14 11:31:50 +01:00
2016-11-18 13:54:21 -05:00
2016-11-29 18:02:58 +01:00
2017-01-04 13:22:38 -07:00
2017-02-07 10:51:46 -05:00
2016-12-06 11:05:46 +01:00
2017-02-24 17:46:54 -08:00
2017-02-22 16:41:27 -08:00
2017-02-03 14:13:19 -08:00
2017-02-24 17:46:56 -08:00
2016-12-12 18:55:07 -08:00
2017-01-24 12:23:35 -05:00
2017-01-27 11:10:50 -05:00
2017-02-24 17:46:55 -08:00
2016-11-02 15:17:09 -04:00
2017-02-23 09:54:19 -08:00
2017-02-24 17:46:54 -08:00
2017-02-27 18:43:48 -08:00
2017-02-24 17:46:56 -08:00
2017-02-24 17:46:54 -08:00
2017-02-24 17:46:54 -08:00
2017-02-07 10:51:46 -05:00
2017-02-22 17:08:33 -08:00
2017-02-02 04:36:12 +13:00
2017-01-18 15:43:59 -05:00
2017-01-12 16:48:26 -05:00
2017-02-23 11:53:22 -08:00
2017-02-20 13:23:30 -08:00
2016-10-07 09:20:53 -07:00
2017-02-03 17:28:29 -05:00
2017-02-16 21:25:49 -05:00
2016-12-06 21:48:21 +01:00
2016-12-06 21:42:16 +01:00
2016-11-16 18:32:02 -05:00
2017-01-24 12:50:47 -05:00
2016-12-19 17:29:44 -05:00
2016-12-09 23:47:10 -05:00
2017-01-24 16:26:14 -08:00
2016-12-24 11:23:24 -08:00
2016-12-06 10:17:56 +02:00
2016-12-06 10:17:56 +02:00
2017-02-22 13:34:00 -07:00
2017-02-22 13:34:00 -07:00
2017-02-22 19:23:14 -08:00
2016-12-12 18:55:07 -08:00
2016-10-03 23:38:11 +02:00
2017-02-15 08:53:32 -06:00
2017-02-10 14:54:37 +01:00
2016-11-29 23:17:02 -05:00
2016-11-14 15:21:14 -06:00
2017-01-17 12:09:33 +00:00
2016-10-07 18:46:28 -07:00
2016-10-07 18:46:27 -07:00
2016-10-07 18:46:27 -07:00
2016-12-29 11:03:15 -08:00
2017-02-22 16:41:30 -08:00
2017-02-03 16:35:42 -05:00
2016-12-06 10:17:03 +02:00
2016-11-17 18:47:58 -06:00
2017-02-09 09:13:20 -06:00
2016-12-06 13:45:48 -06:00
2016-12-06 13:45:50 -06:00
2017-02-23 11:53:22 -08:00
2017-01-28 07:49:42 -05:00
2017-01-14 11:14:35 +01:00
2017-02-10 09:08:09 +01:00
2017-02-24 17:46:54 -08:00
2017-01-25 14:40:19 -05:00
2017-02-20 10:15:11 -05:00
2017-02-24 17:46:56 -08:00
2017-02-27 18:43:45 -08:00
2016-10-31 16:18:30 -04:00
2016-10-05 18:24:00 -04:00
2016-10-14 11:36:59 -07:00
2017-02-09 14:29:27 +01:00
2017-02-09 22:52:17 +01:00
2017-01-27 11:26:58 +01:00
2016-12-13 11:42:18 -08:00
2016-11-29 18:02:58 +01:00
2017-02-06 11:25:55 -07:00
2017-01-14 11:14:53 +01:00
2016-12-24 11:46:01 -08:00
2016-10-08 11:06:08 -04:00
2017-02-01 09:13:55 +01:00
2016-12-06 10:32:40 +01:00
2016-12-27 12:30:56 +01:00
2017-02-08 11:07:11 +01:00
2016-12-13 16:07:55 -08:00
2017-02-07 13:21:15 +01:00
2016-11-15 16:34:26 -08:00
2016-11-15 16:34:27 -08:00
2016-12-12 19:56:15 -08:00
2017-02-20 10:27:56 -05:00
2016-11-22 12:57:38 -06:00
2017-01-30 09:36:42 +01:00
2017-01-04 18:36:41 +00:00
2017-01-16 23:45:04 -06:00
2016-12-19 08:23:53 -08:00
2016-12-05 19:03:06 -05:00
2017-02-13 21:44:09 -05:00
2016-10-15 10:03:15 -07:00
2016-12-20 09:48:47 -08:00
2017-02-24 17:46:57 -08:00
2016-10-31 13:01:57 -07:00
2017-01-25 12:54:22 -08:00
2017-01-23 11:44:18 -08:00
2017-02-01 09:17:51 +01:00
2017-02-24 09:02:10 +01:00
2017-02-03 12:34:59 +01:00
2016-10-11 15:06:32 -07:00
2017-01-30 14:18:54 -08:00
2016-12-12 07:54:43 +01:00
2017-01-20 10:36:15 +01:00
2016-11-11 18:24:16 +00:00
2017-02-17 12:28:35 -05:00
2016-12-02 00:52:34 +01:00
2017-02-24 17:46:55 -08:00
2016-12-12 11:26:47 -08:00
2017-02-27 18:43:48 -08:00
2017-01-18 10:43:15 -08:00
2017-01-27 08:17:44 -07:00
2017-02-27 18:43:48 -08:00
2017-02-19 18:17:59 -05:00
2017-02-23 20:33:51 -08:00
2017-02-23 11:55:41 -07:00
2016-11-09 20:40:06 -05:00
2016-11-09 20:40:06 -05:00
2016-11-09 20:40:06 -05:00
2016-11-09 20:40:06 -05:00
2017-02-27 18:43:46 -08:00
2016-10-07 18:46:30 -07:00
2016-10-25 14:40:39 +02:00
2017-02-03 10:17:02 +01:00
2016-11-16 10:59:38 +01:00
2017-01-12 11:51:24 +01:00
2017-01-19 14:17:05 +01:00
2017-02-24 17:46:56 -08:00
2016-12-14 16:04:07 -08:00
2017-01-09 13:58:57 -05:00
2017-02-10 13:18:33 -05:00
2017-02-22 16:41:27 -08:00
2017-02-22 16:41:27 -08:00
2016-10-18 14:14:20 -04:00
2017-01-09 16:07:38 -05:00
2017-01-12 09:33:39 +01:00
2017-01-12 09:33:39 +01:00
2017-01-12 09:33:39 +01:00
2016-10-05 18:23:36 -04:00
2017-01-25 11:48:03 +01:00
2017-01-25 12:53:20 -08:00
2016-11-22 17:48:04 -05:00
2017-02-08 15:11:22 -05:00
2017-01-20 03:33:57 +01:00
2017-02-22 16:41:30 -08:00
2017-02-22 16:41:30 -08:00
2017-01-06 13:00:01 -05:00
2016-10-25 14:40:39 +02:00
2016-11-10 10:10:37 +01:00
2016-10-17 09:50:56 -07:00
2017-02-13 17:00:06 +13:00
2017-02-03 11:19:34 -05:00
2017-01-04 12:47:28 +08:00
2016-11-11 18:25:08 +00:00
2016-12-25 17:21:22 +01:00
2016-11-16 09:26:34 +01:00
2016-12-25 11:04:12 +01:00
2016-12-25 11:04:12 +01:00
2016-12-25 11:04:12 +01:00
2017-02-27 13:26:17 -08:00
2017-01-10 18:31:55 -08:00
2017-02-22 16:41:26 -08:00
2016-11-22 17:40:00 -05:00
2016-12-09 09:13:30 -05:00
2016-12-09 09:13:30 -05:00
2017-02-03 10:17:02 +01:00
2016-12-25 11:04:12 +01:00
2016-12-09 22:12:21 -05:00
2016-12-16 10:24:44 -08:00
2016-12-11 18:01:51 -08:00
2016-10-24 14:36:25 +02:00
2017-01-24 12:03:07 +13:00
2017-02-24 17:46:55 -08:00
2017-02-10 16:34:17 +00:00
2016-12-01 10:40:05 -07:00
2017-01-20 11:01:17 -05:00
2017-02-07 10:05:12 -05:00
2017-02-22 16:41:29 -08:00
2016-12-12 18:55:08 -08:00
2017-01-11 09:21:41 +01:00
2017-02-03 11:49:06 +01:00
2016-10-27 16:37:44 +02:00
2017-01-14 09:54:13 +01:00
2016-12-25 17:21:22 +01:00
2017-02-24 14:00:23 -08:00
2017-02-02 15:22:18 -05:00
2017-02-24 17:46:54 -08:00
2017-01-14 12:11:59 +01:00
2016-10-07 21:48:36 -04:00