This is a note to let you know that I've just added the patch titled nfc: nci: fix possible NULL pointer dereference in send_acknowledge() to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nfc-nci-fix-possible-null-pointer-dereference-in-send_acknowledge.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7937609cd387246aed994e81aa4fa951358fba41 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Date: Fri, 13 Oct 2023 20:41:29 +0200 Subject: nfc: nci: fix possible NULL pointer dereference in send_acknowledge() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> commit 7937609cd387246aed994e81aa4fa951358fba41 upstream. Handle memory allocation failure from nci_skb_alloc() (calling alloc_skb()) to avoid possible NULL pointer dereference. Reported-by: 黄思聪 <huangsicong@xxxxxxxxx> Fixes: 391d8a2da787 ("NFC: Add NCI over SPI receive") Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Reviewed-by: Simon Horman <horms@xxxxxxxxxx> Link: https://lore.kernel.org/r/20231013184129.18738-1-krzysztof.kozlowski@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/nfc/nci/spi.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/nfc/nci/spi.c +++ b/net/nfc/nci/spi.c @@ -151,6 +151,8 @@ static int send_acknowledge(struct nci_s int ret; skb = nci_skb_alloc(nspi->ndev, 0, GFP_KERNEL); + if (!skb) + return -ENOMEM; /* add the NCI SPI header to the start of the buffer */ hdr = skb_push(skb, NCI_SPI_HDR_LEN); Patches currently in stable-queue which might be from krzysztof.kozlowski@xxxxxxxxxx are queue-6.1/nfc-nci-fix-possible-null-pointer-dereference-in-send_acknowledge.patch