lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <026f56f6-f299-4cd8-b430-042755cb0141@huawei.com>
Date: Mon, 6 Jan 2025 14:12:25 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: Muchun Song <songmuchun@...edance.com>, <muchun.song@...ux.dev>,
	<brauner@...nel.org>, <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
	<stable@...r.kernel.org>, Cheung Wall <zzqq0103.hey@...il.com>
Subject: Re: [PATCH] hugetlb: fix NULL pointer dereference in
 trace_hugetlbfs_alloc_inode



On 2025/1/6 11:31, Muchun Song wrote:
> 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.
> 

Thanks for fixing!

Reviewed-by: Hongbo Li <lihongbo22@...wei.com>

> Fixes: 318580ad7f28 ("hugetlbfs: support tracepoint")
> Cc: stable@...r.kernel.org
> Reported-by: Cheung Wall <zzqq0103.hey@...il.com>
> Closes: https://lore.kernel.org/linux-mm/02858D60-43C1-4863-A84F-3C76A8AF1F15@linux.dev/T/#
> Signed-off-by: Muchun Song <songmuchun@...edance.com>
> ---
>   include/trace/events/hugetlbfs.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/hugetlbfs.h b/include/trace/events/hugetlbfs.h
> index 8331c904a9ba8..59605dfaeeb43 100644
> --- a/include/trace/events/hugetlbfs.h
> +++ b/include/trace/events/hugetlbfs.h
> @@ -23,7 +23,7 @@ TRACE_EVENT(hugetlbfs_alloc_inode,
>   	TP_fast_assign(
>   		__entry->dev		= inode->i_sb->s_dev;
>   		__entry->ino		= inode->i_ino;
> -		__entry->dir		= dir->i_ino;
> +		__entry->dir		= dir ? dir->i_ino : 0;
>   		__entry->mode		= mode;
>   	),
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ