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

From: Muhammad Bilal

Date: Wed Aug 12 2026 - 06:02:32 EST


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/20260812092423.161497-1-meatuni001@xxxxxxxxx/

Thanks,
Muhammad