Yang Erkun
be8f982c36
nfsd: make sure exp active before svc_export_show
...
The function `e_show` was called with protection from RCU. This only
ensures that `exp` will not be freed. Therefore, the reference count for
`exp` can drop to zero, which will trigger a refcount use-after-free
warning when `exp_get` is called. To resolve this issue, use
`cache_get_rcu` to ensure that `exp` remains active.
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 3 PID: 819 at lib/refcount.c:25
refcount_warn_saturate+0xb1/0x120
CPU: 3 UID: 0 PID: 819 Comm: cat Not tainted 6.12.0-rc3+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.1-2.fc37 04/01/2014
RIP: 0010:refcount_warn_saturate+0xb1/0x120
...
Call Trace:
<TASK>
e_show+0x20b/0x230 [nfsd]
seq_read_iter+0x589/0x770
seq_read+0x1e5/0x270
vfs_read+0x125/0x530
ksys_read+0xc1/0x160
do_syscall_64+0x5f/0x170
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Fixes: bf18f163e89c ("NFSD: Using exp_get for export getting")
Cc: stable@vger.kernel.org # 4.20+
Signed-off-by: Yang Erkun <yangerkun@huawei.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2024-11-18 20:23:05 -05:00
..
2024-10-25 15:25:02 -07:00
2024-10-02 17:23:23 -04:00
2024-09-16 13:07:59 +02:00
2024-11-01 07:37:10 -10:00
2024-10-28 13:16:56 +01:00
2024-11-07 16:48:21 -05:00
2024-05-31 12:31:39 +02:00
2024-08-07 11:33:21 +02:00
2024-11-08 07:31:03 -10:00
2024-09-27 18:29:19 +02:00
2024-10-04 10:10:23 -07:00
2024-08-19 13:45:03 +02:00
2024-06-17 20:42:57 +02:00
2024-07-15 11:14:59 -07:00
2024-10-02 17:23:23 -04:00
2024-09-27 08:18:43 -07:00
2024-09-27 08:18:43 -07:00
2024-10-02 17:23:23 -04:00
2024-09-27 08:18:43 -07:00
2024-07-15 11:14:59 -07:00
2024-10-21 14:30:27 +02:00
2024-10-02 17:23:23 -04:00
2024-05-28 15:57:23 +02:00
2024-09-16 09:14:02 +02:00
2024-10-04 17:36:28 -04:00
2024-10-11 15:12:07 +00:00
2024-10-17 00:28:06 -07:00
2024-03-26 09:04:53 +01:00
2024-10-25 17:05:49 +02:00
2024-09-23 11:55:17 -07:00
2024-08-07 11:33:21 +02:00
2024-10-02 17:23:23 -04:00
2024-08-07 11:33:21 +02:00
2024-10-02 17:23:23 -04:00
2024-08-07 11:33:21 +02:00
2024-11-01 07:45:00 -10:00
2024-10-02 17:23:23 -04:00
2024-08-26 23:49:15 -04:00
2024-08-19 13:40:00 +02:00
2024-10-22 09:40:37 -05:00
2024-05-04 19:02:39 +02:00
2024-11-18 20:23:04 -05:00
2024-08-07 11:33:36 +02:00
2024-10-17 15:33:42 +02:00
2024-11-04 10:24:19 -05:00
2024-11-04 10:24:19 -05:00
2024-11-18 20:23:05 -05:00
2024-10-30 20:14:12 -07:00
2024-10-02 17:23:23 -04:00
2024-10-02 15:14:29 +02:00
2024-10-08 10:53:06 -07:00
2024-11-07 14:14:59 -08:00
2024-08-07 11:33:21 +02:00
2024-06-20 09:46:01 +02:00
2024-10-02 17:23:23 -04:00
2024-10-16 13:17:45 +02:00
2024-11-10 09:04:27 -08:00
2024-09-19 10:18:15 +02:00
2024-05-28 11:52:53 +02:00
2024-08-07 11:31:56 +02:00
2024-09-23 10:49:28 -07:00
2024-04-25 20:56:25 -07:00
2024-10-02 17:23:23 -04:00
2024-08-21 22:32:58 +02:00
2024-11-09 12:58:23 -08:00
2024-10-30 20:14:12 -07:00
2024-04-23 13:27:43 +02:00
2024-08-07 11:33:36 +02:00
2024-07-22 18:25:47 -07:00
2024-11-01 08:38:14 -04:00
2024-09-27 08:18:43 -07:00
2024-10-02 14:32:37 +02:00
2024-10-02 00:05:09 -04:00
2024-10-09 13:34:01 -04:00
2024-08-07 11:32:02 +02:00
2024-08-20 14:03:18 -04:00
2024-11-02 09:22:16 -10:00
2024-10-02 12:02:15 -07:00
2024-08-19 13:45:03 +02:00
2024-04-26 10:33:05 +02:00
2024-08-29 06:20:44 +12:00
2024-10-16 13:17:45 +02:00
2024-08-26 13:00:38 -07:00
2024-09-26 11:39:02 -07:00
2024-10-02 17:23:23 -04:00
2024-07-15 11:14:59 -07:00
2024-05-28 12:06:51 +02:00
2024-08-07 11:26:54 -07:00
2024-09-16 08:54:30 +02:00
2024-09-26 11:39:02 -07:00
2024-10-07 13:51:47 +02:00
2024-09-16 08:35:09 +02:00
2024-08-19 13:45:02 +02:00
2024-07-24 20:59:29 +02:00
2024-08-12 22:00:43 -04:00
2024-09-23 09:35:36 -07:00
2024-09-21 07:29:05 -07:00
2024-09-23 09:35:36 -07:00
2024-09-23 09:35:36 -07:00
2024-09-18 08:53:53 +02:00
2024-09-29 21:52:29 -04:00
2024-07-02 06:20:49 +02:00
2024-08-30 08:22:39 +02:00
2024-09-27 08:18:43 -07:00
2024-10-09 12:47:18 -07:00
2024-08-28 13:05:39 +02:00
2024-08-12 22:00:43 -04:00
2024-10-03 16:19:51 -04:00
2024-06-19 13:13:55 -07:00
2024-08-12 22:00:43 -04:00
2024-09-16 08:54:30 +02:00
2024-09-23 09:35:36 -07:00
2024-08-06 09:01:41 -07:00
2024-09-24 15:29:42 -07:00
2024-09-16 11:15:26 +02:00
2024-05-31 12:31:43 +02:00
2024-09-23 09:35:36 -07:00
2024-10-17 15:33:43 +02:00
2024-09-27 08:18:43 -07:00
2024-10-10 12:09:03 +02:00
2024-09-27 18:29:19 +02:00
2024-09-27 08:18:43 -07:00
2024-08-30 08:22:37 +02:00
2024-06-28 14:36:43 +02:00
2024-09-23 09:35:36 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-09-23 09:35:36 -07:00
2024-05-02 16:28:20 +02:00
2024-09-23 09:35:36 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-10-21 14:30:26 +02:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-10-28 21:40:38 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00