mbox series

[V2,0/2] Added debugfs node initialization and null pointer detection.

Message ID 20240914102418.3879203-1-Yibin.Ding@unisoc.com (mailing list archive)
Headers show
Series Added debugfs node initialization and null pointer detection. | expand

Message

Yibin Ding Sept. 14, 2024, 10:24 a.m. UTC
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 | 9 +++++++--
 fs/debugfs/file.c                     | 4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Greg Kroah-Hartman Sept. 14, 2024, 1:57 p.m. UTC | #1
On Sat, Sep 14, 2024 at 06:24:18PM +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 | 9 +++++++--
>  fs/debugfs/file.c                     | 4 ++++
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> -- 
> 2.25.1
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot