All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ma Ke <make24@iscas.ac.cn>
Cc: ajd@linux.ibm.com, arnd@arndb.de, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, manoj@linux.vnet.ibm.com,
	imunsie@au1.ibm.com, fbarrat@linux.ibm.com,
	linuxppc-dev@lists.ozlabs.org, clombard@linux.vnet.ibm.com
Subject: Re: [PATCH v4] cxl: Fix possible null pointer dereference in read_handle()
Date: Mon, 15 Jul 2024 07:12:32 +0200	[thread overview]
Message-ID: <2024071500-certainly-kick-11c8@gregkh> (raw)
In-Reply-To: <20240715025442.3229209-1-make24@iscas.ac.cn>

On Mon, Jul 15, 2024 at 10:54:42AM +0800, Ma Ke wrote:
> In read_handle(), of_get_address() may return NULL if getting address and
> size of the node failed. When of_read_number() uses prop to handle
> conversions between different byte orders, it could lead to a null pointer
> dereference. Add NULL check to fix potential issue.
> 
> Found by static analysis.

You need to describe the tool that found this.  And how did you test
that your fix is correct?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Ma Ke <make24@iscas.ac.cn>
Cc: fbarrat@linux.ibm.com, ajd@linux.ibm.com, arnd@arndb.de,
	mpe@ellerman.id.au, manoj@linux.vnet.ibm.com,
	imunsie@au1.ibm.com, clombard@linux.vnet.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v4] cxl: Fix possible null pointer dereference in read_handle()
Date: Mon, 15 Jul 2024 07:12:32 +0200	[thread overview]
Message-ID: <2024071500-certainly-kick-11c8@gregkh> (raw)
In-Reply-To: <20240715025442.3229209-1-make24@iscas.ac.cn>

On Mon, Jul 15, 2024 at 10:54:42AM +0800, Ma Ke wrote:
> In read_handle(), of_get_address() may return NULL if getting address and
> size of the node failed. When of_read_number() uses prop to handle
> conversions between different byte orders, it could lead to a null pointer
> dereference. Add NULL check to fix potential issue.
> 
> Found by static analysis.

You need to describe the tool that found this.  And how did you test
that your fix is correct?

thanks,

greg k-h

  reply	other threads:[~2024-07-15  5:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15  2:54 [PATCH v4] cxl: Fix possible null pointer dereference in read_handle() Ma Ke
2024-07-15  2:54 ` Ma Ke
2024-07-15  5:12 ` Greg KH [this message]
2024-07-15  5:12   ` Greg KH
2024-07-15  6:28 ` Michael Ellerman
2024-07-15  6:28   ` Michael Ellerman
2024-07-15 17:11   ` Dan Carpenter
2024-07-15 17:11     ` Dan Carpenter
2024-07-16 13:27   ` Ma Ke
2024-07-16 13:27     ` Ma Ke
2024-07-19  1:23     ` Michael Ellerman
2024-07-19  1:23       ` Michael Ellerman
2024-07-15 13:18 ` Markus Elfring
2024-07-15 13:18   ` Markus Elfring
2024-07-15 13:32   ` Greg Kroah-Hartman
2024-07-15 13:32     ` Greg Kroah-Hartman
2024-07-19  1:25 ` Michael Ellerman
2024-07-19  1:25   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024071500-certainly-kick-11c8@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ajd@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=clombard@linux.vnet.ibm.com \
    --cc=fbarrat@linux.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=make24@iscas.ac.cn \
    --cc=manoj@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.