linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Added debugfs node initialization and null pointer detection.
@ 2024-08-30 10:21 Yibin Ding
  2024-08-30 10:32 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Yibin Ding @ 2024-08-30 10:21 UTC (permalink / raw)
  To: djakov, gregkh, rafael
  Cc: yibin.ding01, niuzhiguo84, linux-pm, linux-kernel, Hao_hao.Wang,
	Ke.Wang

From: Yibin Ding <Yibin.ding@unisoc.com>

The two debugfs nodes (/sys/kernel/debug/interconnect/test_client/dst_node,
src_node) do not initialize the character pointers before creation. For
such uninitialized nodes, direct access will cause a crash due to accessing
a null pointer.
For example, directly execute the following command after booting:
    cat /sys/kernel/debug/interconnect/test_client/dst_node.

Therefore, for the problem nodes, it is necessary to add initialization
operations and null pointer detection when accessing.

Yibin Ding (2):
  interconnect: Add character pointer initialization
  debugfs: Fix crash problem caused by accessing uninitialized nodes

 drivers/interconnect/debugfs-client.c | 10 ++++++++--
 fs/debugfs/file.c                     |  4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0/2] Added debugfs node initialization and null pointer detection.
  2024-08-30 10:21 [PATCH 0/2] Added debugfs node initialization and null pointer detection Yibin Ding
@ 2024-08-30 10:32 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2024-08-30 10:32 UTC (permalink / raw)
  To: Yibin Ding
  Cc: djakov, rafael, yibin.ding01, niuzhiguo84, linux-pm, linux-kernel,
	Hao_hao.Wang, Ke.Wang

On Fri, Aug 30, 2024 at 06:21:53PM +0800, Yibin Ding wrote:
> From: Yibin Ding <Yibin.ding@unisoc.com>
> 
> The two debugfs nodes (/sys/kernel/debug/interconnect/test_client/dst_node,
> src_node) do not initialize the character pointers before creation. For
> such uninitialized nodes, direct access will cause a crash due to accessing
> a null pointer.
> For example, directly execute the following command after booting:
>     cat /sys/kernel/debug/interconnect/test_client/dst_node.
> 
> Therefore, for the problem nodes, it is necessary to add initialization
> operations and null pointer detection when accessing.
> 
> Yibin Ding (2):
>   interconnect: Add character pointer initialization
>   debugfs: Fix crash problem caused by accessing uninitialized nodes
> 
>  drivers/interconnect/debugfs-client.c | 10 ++++++++--
>  fs/debugfs/file.c                     |  4 ++++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> -- 
> 2.25.1
> 

This series is not properly threaded for some reason.  Can you resend
using a tool (like git send-email or something else) that preserves it
so that our tools can correctly pick them up?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-30 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30 10:21 [PATCH 0/2] Added debugfs node initialization and null pointer detection Yibin Ding
2024-08-30 10:32 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).