Patch "nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION" has been added to the 5.15-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: st-nci: fix incorrect validating logic in EVT_TRANSACTION

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-st-nci-fix-incorrect-validating-logic-in-evt_tra.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.



commit 0dd703d5509e7ef52542392ab3a91d8adf5c6fce
Author: Martin Faltesek <mfaltesek@xxxxxxxxxx>
Date:   Mon Nov 21 18:42:44 2022 -0600

    nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION
    
    [ Upstream commit c60c152230828825c06e62a8f1ce956d4b659266 ]
    
    The first validation check for EVT_TRANSACTION has two different checks
    tied together with logical AND. One is a check for minimum packet length,
    and the other is for a valid aid_tag. If either condition is true (fails),
    then an error should be triggered. The fix is to change && to ||.
    
    Reported-by: Denis Efremov <denis.e.efremov@xxxxxxxxxx>
    Reviewed-by: Guenter Roeck <groeck@xxxxxxxxxx>
    Fixes: 5d1ceb7f5e56 ("NFC: st21nfcb: Add HCI transaction event support")
    Signed-off-by: Martin Faltesek <mfaltesek@xxxxxxxxxx>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nfc/st-nci/se.c b/drivers/nfc/st-nci/se.c
index 5fd89f72969d..522b7a128f4c 100644
--- a/drivers/nfc/st-nci/se.c
+++ b/drivers/nfc/st-nci/se.c
@@ -326,7 +326,7 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,
 		 * AID          81      5 to 16
 		 * PARAMETERS   82      0 to 255
 		 */
-		if (skb->len < NFC_MIN_AID_LENGTH + 2 &&
+		if (skb->len < NFC_MIN_AID_LENGTH + 2 ||
 		    skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG)
 			return -EPROTO;
 



[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