Muchun Song 9ab96b524d hugetlb: fix NULL pointer dereference in trace_hugetlbfs_alloc_inode
hugetlb_file_setup() will pass a NULL @dir to hugetlbfs_get_inode(), so we
will access a NULL pointer for @dir.  Fix it and set __entry->dr to 0 if
@dir is NULL.  Because ->i_ino cannot be 0 (see get_next_ino()), there is
no confusing if user sees a 0 inode number.

Link: https://lkml.kernel.org/r/20250106033118.4640-1-songmuchun@bytedance.com
Fixes: 318580ad7f28 ("hugetlbfs: support tracepoint")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reported-by: Cheung Wall <zzqq0103.hey@gmail.com>
Closes: https://lore.kernel.org/linux-mm/02858D60-43C1-4863-A84F-3C76A8AF1F15@linux.dev/T/#
Reviewed-by: Hongbo Li <lihongbo22@huawei.com>
Cc: cheung wall <zzqq0103.hey@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-12 19:03:36 -08:00
..
2024-10-29 08:54:06 +01:00
2023-07-04 19:40:16 +01:00
2023-07-04 19:40:16 +01:00
2024-04-25 20:56:20 -07:00
2024-05-08 10:39:26 +01:00
2024-10-29 13:43:27 -06:00
2023-03-24 11:01:29 +01:00
2024-07-10 12:14:54 -07:00
2023-12-29 11:58:27 -08:00
2023-07-17 08:18:17 -06:00
2024-11-11 00:26:46 -08:00
2024-05-14 07:22:35 -06:00
2024-11-18 10:26:49 -08:00
2024-09-11 20:44:31 -07:00
2024-09-28 15:13:56 +02:00
2022-07-30 14:01:30 -04:00
2024-06-20 15:19:17 -06:00
2024-06-19 12:44:22 +01:00
2023-07-17 08:18:17 -06:00
2023-09-19 07:04:49 +02:00