From: Shubham Antil <shubham@octane.security>
To: netdev@vger.kernel.org
Cc: Simon Horman <horms@kernel.org>,
gio@octane.security, David Heidelberg <david@ixit.cz>,
oe-linux-nfc@lists.linux.dev
Subject: [PATCH net v9 0/4] nfc: nci: uart: split lifecycle teardown fixes
Date: Mon, 30 Nov 2026 14:44:52 +0530 [thread overview]
Message-ID: <20261130091456.62379-1-shubham@octane.security> (raw)
The v8 series combined core lifecycle work and its Marvell implementation
in one large patch. This submission keeps the UART lifecycle work
separate from the other reported bugs and divides it into four reviewable
steps:
1. keep NFC request admission closed until registration completes
2. coordinate NCI command shutdown and transport flushing in the core
3. serialize and quiesce the generic NCI UART callbacks
4. adopt those lifecycle helpers in nfcmrvl
This series depends on the two-patch NCI UART driver-selection submission.
Its patch IDs are recorded below so tooling can resolve the prerequisite.
The issues were found during an AI-assisted source audit using OpenAI
Codex, gpt-5.6-sol. The UART teardown issue was reproduced on a clean stock
v7.3-rc1 kernel with 318 KASAN slab-use-after-free reports in
nci_uart_write_work() after nci_uart_tty_close() freed tx_skb. A separate
high-concurrency pre-fix run hit a general-protection fault in
nfcmrvl_nci_uart_tx_start() with nu->drv_data still NULL. The remaining
core timing condition was exercised through repeated lifecycle and
incomplete-RX close tests, but no separate pre-fix failure was isolated.
Patch development and test planning used the same assistant.
The prerequisite mail patches and each patch in this series were applied
to the base below on the Linux test host. The affected NFC objects built
after every patch with W=1 and sparse. A KASAN, UBSAN, and lockdep kernel
completed 20 concurrent driver-selection races, five publication tests,
five open/down/reopen/unregister lifecycle tests, and a partial-RX
close-time regression test without a diagnostic or leaked device. No
physical Marvell controller was available.
Changes since v8:
- move the UART lifecycle work into its own submission
- split NFC admission, NCI core, generic UART, and nfcmrvl changes
- declare the driver-selection series as an explicit prerequisite
- avoid a receive gap while NCI_INIT transitions to NCI_UP
- drain close-time responses before the final command cancel
- combine UART queue admission and wakeup under one transmit lock
- preserve frame boundaries through ordered tty queue acceptance
- reject a close-time reset when an RX frame is incomplete
- reject firmware download on a poisoned UART transport
- add the requested AI-assistance trailer
Shubham Antil (4):
nfc: keep devices shut down until registration completes
nfc: nci: coordinate transport shutdown in the core
nfc: nci: uart: quiesce callbacks during teardown
nfc: nfcmrvl: adopt the NCI UART lifecycle helpers
drivers/nfc/nfcmrvl/main.c | 46 +++++-
drivers/nfc/nfcmrvl/nfcmrvl.h | 4 +
drivers/nfc/nfcmrvl/uart.c | 63 ++++++-
include/net/nfc/nci_core.h | 21 +++
net/nfc/core.c | 7 +-
net/nfc/nci/core.c | 83 +++++++---
net/nfc/nci/rsp.c | 3 +
net/nfc/nci/uart.c | 366 ++++++++++++++++++++++++++++++++++++++----
8 files changed, 532 insertions(+), 61 deletions(-)
base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0
prerequisite-patch-id: da5eea669279340f2925f9be0d203fd3bc407cc5
prerequisite-patch-id: 109c531926f84389d8f1d2030160f6113a749142
--
2.54.0
next reply other threads:[~2026-11-30 9:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 9:14 Shubham Antil [this message]
2026-11-30 9:14 ` [PATCH net v9 1/4] nfc: keep devices shut down until registration completes Shubham Antil
2026-11-30 9:14 ` [PATCH net v9 2/4] nfc: nci: coordinate transport shutdown in the core Shubham Antil
2026-11-30 9:14 ` [PATCH net v9 3/4] nfc: nci: uart: quiesce callbacks during teardown Shubham Antil
2026-11-30 9:14 ` [PATCH net v9 4/4] nfc: nfcmrvl: adopt the NCI UART lifecycle helpers Shubham Antil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130091456.62379-1-shubham@octane.security \
--to=shubham@octane.security \
--cc=david@ixit.cz \
--cc=gio@octane.security \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox