[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y35Qgw4Q8XYD5Did@slm.duckdns.org>
Date: Wed, 23 Nov 2022 06:55:31 -1000
From: Tejun Heo <tj@...nel.org>
To: Zhen Lei <thunder.leizhen@...wei.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernfs: fix potential null-ptr-deref in
kernfs_path_from_node_locked()
On Wed, Nov 23, 2022 at 10:04:19AM +0800, Zhen Lei wrote:
> Ensure that the 'buf' is not empty before strlcpy() uses it.
>
> Commit bbe70e4e4211 ("fs: kernfs: Fix possible null-pointer dereferences
> in kernfs_path_from_node_locked()") first noticed this, but it didn't
> fix it completely.
>
> Fixes: 9f6df573a404 ("kernfs: Add API to generate relative kernfs path")
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
I think the right thing to do is removing that if. It makes no sense to call
that function with NULL buf and the fact that nobody reported crashes on
NULL buf indicates that we in fact never do.
Thanks.
--
tejun
Powered by blists - more mailing lists