lkml.org 
[lkml]   [2023]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] nfc: nci: fix possible NULL pointer dereference in send_acknowledge()
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>

\
 
 \ /
  Last update: 2023-10-16 13:29    [W:5.664 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site