]> git.ipfire.org Git - thirdparty/linux.git/commit
fs: improve dump_inode() to safely access inode fields
authorYuto Ohnuki <ytohnuki@amazon.com>
Mon, 12 Jan 2026 18:14:43 +0000 (18:14 +0000)
committerChristian Brauner <brauner@kernel.org>
Wed, 14 Jan 2026 15:50:38 +0000 (16:50 +0100)
commit7c0225003317bd6e2107784a83c7099de8b2b28c
tree6a25e96f04506d2f1c3dcde1bc455b810940e345
parent58ecde96e8b8d85754c664c3d9814e6ffd38a788
fs: improve dump_inode() to safely access inode fields

Use get_kernel_nofault() to safely access inode and related structures
(superblock, file_system_type) to avoid crashing when the inode pointer
is invalid. This allows the same pattern as dump_mapping().

Note: The original access method for i_state and i_count is preserved,
as get_kernel_nofault() is unnecessary once the inode structure is
verified accessible.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Link: https://patch.msgid.link/20260112181443.81286-1-ytohnuki@amazon.com
Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/inode.c