DaeMyung Kang
b5198fcdc1
ntfs: fix NULL dereference in ntfs_index_walk_down()
...
ntfs_index_walk_down() allocates ictx->ib when descending from the root
into an index allocation block. If that allocation fails, the old code
still passes the NULL buffer to ntfs_ib_read(), which can write through
it via ntfs_inode_attr_pread().
Allocate the index block into a temporary pointer and return -ENOMEM
before changing the index context on allocation failure. Also propagate
ERR_PTR() through ntfs_index_next() and ntfs_readdir() so walk-down
allocation or index block read failures are not mistaken for normal
index iteration inside the filesystem.
ntfs_readdir() keeps the existing userspace-visible behavior of
suppressing readdir errors after marking end_in_iterate; this change only
prevents the walk-down failure path from dereferencing NULL internally.
The failure was reproduced with failslab fail-nth injection on getdents64;
the original module hits a NULL pointer dereference in memcpy_orig through
ntfs_ib_read(), while the patched module reaches the same
ntfs_index_walk_down() allocation failure without crashing.
Fixes: 0a8ac0c1fa ("ntfs: update directory operations")
Signed-off-by: DaeMyung Kang <charsyam@gmail.com >
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com >
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org >
2026-04-27 22:29:04 +09:00
..
2026-04-24 13:37:26 -07:00
2026-04-25 07:44:26 -07:00
2026-04-21 07:30:44 -07:00
2026-04-15 12:59:16 -07:00
2026-04-13 14:20:11 -07:00
2026-03-06 14:31:28 +01:00
2026-04-13 12:46:42 -07:00
2026-04-17 09:43:12 -07:00
2026-04-13 12:19:01 -07:00
2026-04-24 13:47:19 -07:00
2026-04-21 14:03:10 -07:00
2026-02-21 17:09:51 -08:00
2026-03-06 14:31:28 +01:00
2026-04-13 17:29:12 -07:00
2026-04-02 16:15:23 +02:00
2026-02-21 17:09:51 -08:00
2026-03-29 11:21:22 -07:00
2026-04-20 10:54:17 -07:00
2026-02-21 17:09:51 -08:00
2026-03-06 14:31:28 +01:00
2026-04-21 11:16:04 -07:00
2026-04-13 16:57:31 -07:00
2026-04-21 07:30:44 -07:00
2026-04-15 19:22:16 -07:00
2026-04-17 17:08:31 -07:00
2026-04-21 14:50:04 -07:00
2026-04-13 12:46:42 -07:00
2026-03-06 14:31:28 +01:00
2026-04-23 17:08:04 -07:00
2026-04-15 19:12:04 -07:00
2026-04-13 14:20:11 -07:00
2026-04-13 16:50:38 -07:00
2026-02-21 17:09:51 -08:00
2026-03-06 14:31:28 +01:00
2026-04-15 12:59:16 -07:00
2026-04-13 17:29:12 -07:00
2026-03-06 14:31:30 +01:00
2026-04-17 17:08:31 -07:00
2026-03-06 14:31:28 +01:00
2026-04-15 19:29:18 -07:00
2026-04-13 19:03:11 -07:00
2026-04-20 10:44:02 -07:00
2026-04-13 12:46:42 -07:00
2026-04-15 12:59:16 -07:00
2026-04-24 14:20:03 -07:00
2026-01-02 13:43:41 -05:00
2026-04-20 10:44:02 -07:00
2026-04-15 12:59:16 -07:00
2025-12-01 11:58:06 +02:00
2026-04-21 07:30:44 -07:00
2026-04-27 22:29:04 +09:00
2026-04-20 10:59:47 -07:00
2026-04-21 07:30:44 -07:00
2026-04-13 14:20:11 -07:00
2026-04-17 17:03:43 -07:00
2026-04-21 07:30:44 -07:00
2026-04-16 20:11:56 -07:00
2026-04-15 12:59:16 -07:00
2026-04-13 12:46:42 -07:00
2026-04-13 12:46:42 -07:00
2026-03-25 13:15:36 +01:00
2026-04-05 13:53:07 -07:00
2026-04-15 12:59:16 -07:00
2026-02-18 20:50:32 -08:00
2026-04-23 17:04:18 -07:00
2026-02-24 11:13:27 -08:00
2026-04-19 12:58:08 -07:00
2026-03-18 11:41:53 -07:00
2026-04-22 15:09:01 -07:00
2026-04-16 20:11:56 -07:00
2026-04-15 19:22:16 -07:00
2026-04-13 12:46:42 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-13 12:19:01 -07:00
2026-04-13 17:03:48 -07:00
2026-04-15 12:59:16 -07:00
2026-04-24 00:34:59 +02:00
2025-11-28 12:42:31 +01:00
2026-04-07 11:26:11 +02:00
2026-04-03 16:53:50 -04: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-02-21 17:09:51 -08:00
2026-01-02 12:04:28 -08:00
2026-04-23 17:08:04 -07:00
2026-02-21 17:09:51 -08:00
2026-04-13 14:20:11 -07:00
2026-04-07 12:32:22 +02:00
2026-04-21 14:12:01 -07:00
2026-04-21 07:30:44 -07:00
2026-02-21 17:09:51 -08:00
2026-04-24 00:37:01 +02:00
2026-04-01 12:26:07 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-25 10:34:23 -08:00
2026-04-13 15:17:28 -07:00
2026-04-13 14:20:11 -07:00
2026-01-16 12:52:04 -05: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-04-23 17:08:04 -07: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-04-21 07:30:44 -07:00
2026-04-13 15:17:28 -07:00
2026-02-19 21:51:00 +09:00
2026-04-13 12:46:42 -07:00
2026-04-20 10:44:02 -07:00
2026-02-19 21:51:00 +09:00
2026-04-13 14:20:11 -07:00
2026-02-21 01:02:28 -08:00
2026-01-12 16:52:09 +01:00
2026-04-15 12:59:16 -07:00
2026-04-13 14:20:11 -07:00
2026-04-14 09:30:15 +02:00
2026-04-13 12:19:01 -07:00
2026-01-12 16:52:09 +01:00
2026-03-23 12:41:58 +01:00
2026-04-13 13:27:11 -07:00
2026-03-06 14:31:28 +01:00
2026-02-21 01:02:28 -08:00
2026-01-12 10:55:45 +01:00
2026-03-24 14:44:02 +01:00
2026-04-13 14:20:11 -07:00
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-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-04-18 00:10:56 -07:00
2026-01-16 12:52:03 -05:00
2026-03-02 11:06:42 +01:00