Patch "nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()

to the 4.19-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-llcp-fix-possible-use-of-uninitialized-variable-.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 994bdd8700413b10cf79b929542fa04709405edc
Author: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Date:   Sat May 13 13:52:04 2023 +0200

    nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
    
    [ Upstream commit 0d9b41daa5907756a31772d8af8ac5ff25cf17c1 ]
    
    If sock->service_name is NULL, the local variable
    service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(),
    later leading to using value frmo the stack.  Smatch warning:
    
      net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'.
    
    Fixes: de9e5aeb4f40 ("NFC: llcp: Fix usage of llcp_add_tlv()")
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c
index 6dcad7bcf20bb..737c7aa384f44 100644
--- a/net/nfc/llcp_commands.c
+++ b/net/nfc/llcp_commands.c
@@ -406,7 +406,8 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock)
 	const u8 *service_name_tlv = NULL;
 	const u8 *miux_tlv = NULL;
 	const u8 *rw_tlv = NULL;
-	u8 service_name_tlv_length, miux_tlv_length,  rw_tlv_length, rw;
+	u8 service_name_tlv_length = 0;
+	u8 miux_tlv_length,  rw_tlv_length, rw;
 	int err;
 	u16 size = 0;
 	__be16 miux;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux