This is a note to let you know that I've just added the patch titled nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done to the 5.15-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-fix-potential-null-pointer-deref-in-nfc_genl_dump_ses_done.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4cd8371a234d051f9c9557fcbb1f8c523b1c0d10 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx> Date: Thu, 9 Dec 2021 09:13:07 +0100 Subject: nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx> commit 4cd8371a234d051f9c9557fcbb1f8c523b1c0d10 upstream. The done() netlink callback nfc_genl_dump_ses_done() should check if received argument is non-NULL, because its allocation could fail earlier in dumpit() (nfc_genl_dump_ses()). Fixes: ac22ac466a65 ("NFC: Add a GET_SE netlink API") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20211209081307.57337-1-krzysztof.kozlowski@xxxxxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/nfc/netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -1392,8 +1392,10 @@ static int nfc_genl_dump_ses_done(struct { struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0]; - nfc_device_iter_exit(iter); - kfree(iter); + if (iter) { + nfc_device_iter_exit(iter); + kfree(iter); + } return 0; } Patches currently in stable-queue which might be from krzysztof.kozlowski@xxxxxxxxxxxxx are queue-5.15/nfc-fix-potential-null-pointer-deref-in-nfc_genl_dump_ses_done.patch