WenTao Liang
c3e64079d8
ceph: fix refcount leak in ceph_readdir()
...
The ceph_readdir() function allocates a ceph_mds_request via
ceph_mdsc_create_request() and stores it in dfi->last_readdir. In
the directory entry processing loop, if the entry's offset is less
than ctx->pos or if the inode pointer is unexpectedly NULL, the
function returns -EIO without releasing the reference held by
dfi->last_readdir, causing a refcount leak.
Fix this by adding ceph_mdsc_put_request(dfi->last_readdir) before
returning on these error paths. Also set dfi->last_readdir to NULL
for safety, matching the cleanup done at the normal exit.
Cc: stable@vger.kernel.org
Fixes: af9ffa6df7 ("ceph: add support to readdir for encrypted names")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn >
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com >
Reviewed-by: Alex Markuze <amarkuze@redhat.com >
Signed-off-by: Ilya Dryomov <idryomov@gmail.com >
2026-07-23 20:29:41 +02:00
..
2026-06-21 10:26:31 -07:00
2026-04-25 07:44:26 -07:00
2026-05-21 13:39:35 +02:00
2026-07-01 15:26:29 +02:00
2026-04-13 14:20:11 -07:00
2026-05-21 13:39:35 +02:00
2026-05-28 13:58:14 +02:00
2026-07-14 09:10:27 -07:00
2026-07-01 15:26:28 +02:00
2026-07-23 20:29:41 +02:00
2026-04-21 14:03:10 -07:00
2026-06-15 04:28:20 +05:30
2026-05-03 09:12:23 -06:00
2026-06-22 12:12:11 -07:00
2026-04-02 16:15:23 +02:00
2026-02-21 17:09:51 -08:00
2026-05-08 08:38:03 -05:00
2026-06-26 08:24:06 -07:00
2026-04-28 12:30:59 +02:00
2026-06-11 11:42:21 -07:00
2026-07-13 16:41:42 +08:00
2026-07-01 15:26:47 +02:00
2026-06-05 00:34:55 -04:00
2026-06-02 10:56:16 +02:00
2026-06-18 09:42:02 -07:00
2026-06-22 19:55:27 +00:00
2026-07-01 15:26:25 +02:00
2026-07-01 15:26:26 +02:00
2026-07-01 15:26:47 +02:00
2026-06-26 15:13:06 -07:00
2026-06-16 12:27:23 +05:30
2026-06-16 12:27:23 +05:30
2026-02-21 17:09:51 -08:00
2026-06-15 03:59:45 +05:30
2026-06-21 11:37:38 -07:00
2026-07-01 15:26:47 +02:00
2026-06-16 11:58:52 +05:30
2026-06-18 09:42:02 -07:00
2026-03-06 14:31:28 +01:00
2026-06-15 03:59:45 +05:30
2026-06-15 12:41:17 +05:30
2026-06-09 16:32:59 -04:00
2026-07-01 15:26:24 +02:00
2026-07-03 11:52:41 +02:00
2026-07-08 14:43:40 -04:00
2026-01-02 13:43:41 -05:00
2026-07-13 08:38:01 -07:00
2026-06-16 12:14:20 +05:30
2025-12-01 11:58:06 +02:00
2026-06-16 11:56:43 +05:30
2026-07-10 18:20:15 -07:00
2026-07-01 15:26:47 +02:00
2026-06-21 13:20:19 -07:00
2026-05-21 13:39:36 +02:00
2025-10-20 20:22:26 +02:00
2026-07-01 15:26:27 +02:00
2026-07-01 15:26:25 +02:00
2026-07-06 18:51:36 -07:00
2026-04-15 12:59:16 -07:00
2026-05-21 13:39:35 +02:00
2026-05-28 14:16:33 +02:00
2026-05-27 15:12:22 +02:00
2026-04-05 13:53:07 -07:00
2026-07-06 19:05:49 -07:00
2026-02-18 20:50:32 -08:00
2026-07-17 21:41:54 -07:00
2026-02-24 11:13:27 -08:00
2026-06-15 12:41:17 +05:30
2026-03-18 11:41:53 -07:00
2026-06-05 01:12:15 -04:00
2026-05-11 23:12:28 +02:00
2026-06-16 11:58:52 +05:30
2026-04-13 12:46:42 -07:00
2026-02-21 17:09:51 -08:00
2026-05-11 16:50:29 +02:00
2026-06-17 09:18:14 +01:00
2026-07-16 09:40:03 -07:00
2026-05-12 07:53:20 +09:00
2026-06-04 10:10:49 +02:00
2026-06-04 10:10:49 +02:00
2026-05-15 19:24:32 +02:00
2026-06-10 09:49:25 +02:00
2026-01-12 14:01:32 +01:00
2026-04-13 12:19:01 -07:00
2026-04-05 13:53:39 -07:00
2026-05-28 13:58:14 +02:00
2026-07-01 15:26:27 +02:00
2026-06-15 03:59:45 +05:30
2026-02-21 17:09:51 -08:00
2026-06-15 03:59:45 +05:30
2026-04-07 12:32:22 +02:00
2026-04-21 14:12:01 -07:00
2026-06-15 04:15:31 +05:30
2026-05-26 11:01:55 -06:00
2025-10-20 20:22:26 +02:00
2026-02-21 17:09:51 -08:00
2026-06-04 13:53:50 +02:00
2026-07-01 15:26:27 +02:00
2026-06-15 03:59:45 +05:30
2026-07-01 15:26:32 +02:00
2026-05-11 16:50:27 +02:00
2026-06-15 04:15:31 +05:30
2026-05-28 14:27:00 +02:00
2026-06-12 14:26:27 +02:00
2026-04-13 14:20:11 -07:00
2025-11-05 09:51:30 +01:00
2026-02-19 14:34:26 +01:00
2026-01-14 16:50:37 +01:00
2026-06-04 10:16:51 +02:00
2026-03-06 14:31:28 +01:00
2026-02-21 17:09:51 -08:00
2026-02-09 16:58:28 -08:00
2026-06-23 12:03:44 -07:00
2026-06-15 14:06:20 +02:00
2026-05-28 21:24:42 -07:00
2026-06-15 04:21:00 +05:30
2026-05-15 19:24:32 +02:00
2026-06-04 14:45:03 -07:00
2026-04-13 14:20:11 -07:00
2026-05-11 14:19:01 +02:00
2026-06-15 04:07:58 +05:30
2026-04-15 12:59:16 -07:00
2026-07-01 15:26:18 +02:00
2026-06-15 04:07:58 +05:30
2026-06-15 03:59:45 +05:30
2026-01-12 16:52:09 +01:00
2026-06-23 12:03:44 -07:00
2026-06-16 11:56:43 +05:30
2026-05-28 14:33:24 +02:00
2026-05-15 19:24:32 +02:00
2026-06-05 14:46:20 +02:00
2026-03-24 14:44:02 +01:00
2026-06-15 03:59:45 +05:30
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-16 12:52:04 -05:00
2026-01-16 12:52:04 -05:00
2026-06-15 04:15:31 +05:30
2026-05-21 13:39:36 +02:00
2026-05-01 21:36:13 +02:00
2026-01-16 12:52:03 -05:00
2026-06-17 12:34:16 +01:00