public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Samuel Ortiz" <sameo@linux.intel.com>,
	"Frederic Danis" <frederic.danis@linux.intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	黄思聪 <huangsicong@iie.ac.cn>,
	stable@vger.kernel.org
Subject: Re: [PATCH net-next] nfc: nci: fix possible NULL pointer dereference in send_acknowledge()
Date: Mon, 16 Oct 2023 13:28:19 +0200	[thread overview]
Message-ID: <20231016112819.GL1501712@kernel.org> (raw)
In-Reply-To: <20231013184129.18738-1-krzysztof.kozlowski@linaro.org>

On Fri, Oct 13, 2023 at 08:41:29PM +0200, Krzysztof Kozlowski wrote:
> Handle memory allocation failure from nci_skb_alloc() (calling
> alloc_skb()) to avoid possible NULL pointer dereference.
> 
> Reported-by: 黄思聪 <huangsicong@iie.ac.cn>
> Fixes: 391d8a2da787 ("NFC: Add NCI over SPI receive")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks,

I agree that nci_skb_alloc() may turn NULL and that this
is an appropriate way to handle that.

As an aside, I observe that the return value of send_acknowledge()
is not checked. But I don't think that affects the correctness of this
change.

Reviewed-by: Simon Horman <horms@kernel.org>

  reply	other threads:[~2023-10-16 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 18:41 [PATCH net-next] nfc: nci: fix possible NULL pointer dereference in send_acknowledge() Krzysztof Kozlowski
2023-10-16 11:28 ` Simon Horman [this message]
2023-10-17  0:50 ` patchwork-bot+netdevbpf

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=20231016112819.GL1501712@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frederic.danis@linux.intel.com \
    --cc=huangsicong@iie.ac.cn \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sameo@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox