Re: [PATCH net v3] nfc: nci: fix use of uninitialized memory in NFC-DEP general bytes

Muhammad Bilal <[email protected]>
Newsgroups org.kernel.vger.netdev,dev.linux.lists.oe-linux-nfc,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CADqcGBmqXjyb1PJH=bBZAtuMLM9+GMehtPCGbQ-PNLHZ6VEQ+g@mail.gmail.com>
Hi David, Lekë,

After analyzing the caller execution paths and commit history, here are
two technical details worth noting:

1. Fixes tags:
   - 767f19ae698e ("NFC: Implement NCI dep_link_up and dep_link_down")
     introduced the POLL-mode atr_res_len subtraction (2012).
   - a99903ec4566 ("NFC: NCI: Handle Target mode activation")
     refactored the code into nci_store_general_bytes_nfc_dep() and
     added the LISTEN-mode atr_req_len branch (2014).
   Since the fix addresses both branches, including both Fixes tags is
   necessary for proper stable backporting.

2. Return status:
   Returning NCI_STATUS_RF_PROTOCOL_ERROR (as proposed by Lekë) is the
   correct behavior. In nci_rf_intf_activated_ntf_packet(), a non-OK
   return value properly skips nci_target_auto_activated(), propagates
   the error via nci_req_complete(), and prevents nfc_tm_activated()
   from firing. Falling through with NCI_STATUS_OK would incorrectly
   treat a malformed ATR as a successful activation.

I have submitted v4 [1], which incorporates the NCI_STATUS_RF_PROTOCOL_ERROR
return value, includes both Fixes tags, and credits Lekë with a
Suggested-by tag.

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
Muhammad
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.