From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796030105; b=JOadCqwOsJ1iwqfcjZ4JB2rdzSpCe+0gnLPwvWvFRGaD3+DtwiZLyW9QZBdVDi6SXLm3 vAbrJFGH/aH/LCZl6BfI+vZMuPdLIdk8Q/DcOcHzGtSY5g2ws/PeJ1jo7EfyWGa/NzLzc HxYindfdE/OGnChBPcfAo2t2DI1v4zP4OiJNYZKGL+guSgj5+qGYDB4J3LiUuhYrg2s2n ZEN49Nc0QTisBaNf49YDj9EYoTdSoAwd8+UxETZxsp+rTDPx+m/jyvTB8NocUAZwobvNW nCFJwlP+ehtg032Dgxm55GhhZfHuc1e7OqCWnmt2yMZHIg4OQYUj115OnTAaERzS42w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796030105; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=iB9ME09GW6CmsY+k+yV51/xrYq6/QDBiZWnbJ6v9Vis=; b=aArodyzwx+4vWqx0Vz4xh5IHQJhS09BeR73mNfwLkx5Ls4bF9BC357Pxq79hQhHhsNlM bNTfXHJuM3GX4hT14ntftWcvlVsC6Uxujts9I9BePjbkNeCd20r0lDbHidFtP3oOBDTQc p7R4kJuOH74YWfkXYbrU8PgaXbOsQ2PRcJ+Y3r//f/r/+4eOVH5I8qVi7vV1hnmXd/ZQH g6gIIS/x8NOJb7YTiyK0Au+5xuhTyRDIV5FqBJeWJiuh7skEKPNNrSO6ujfXLq9fx+0GS wV+VTNofKuTHwe4hQclgwFSLsXs7AAl90gTpdI67F7qc28SoZLR3o4lEJuSTdUChenw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=octane.security; spf=pass smtp.mailfrom=octane.security; dkim=pass header.d=octane.security header.i=@octane.security header.a=rsa-sha256 header.s=google header.b=Wl40h5wA; arc=none smtp.remote-ip=74.125.82.172 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A00BA606A325 for ; Mon, 30 Nov 2026 09:15:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A00BA606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=octane.security Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=octane.security Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=octane.security header.i=@octane.security header.a=rsa-sha256 header.s=google header.b=Wl40h5wA Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-385c497bf94so13173680eec.1 for ; Mon, 30 Nov 2026 01:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=octane.security; s=google; t=1796030104; x=1796634904; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=iB9ME09GW6CmsY+k+yV51/xrYq6/QDBiZWnbJ6v9Vis=; b=Wl40h5wAlUa7daZxugUV18yhDkd+DAF/bAqv0h6o54l3TpMky03C0dfWMU0cNpm3EZ U3J8htRHUmi1EtNZ0rHA0ZhwsvqBZixGw1br9y/QbyzwQneRRFjEwvzlNhas1d/KrVzD NnTiB/cTrRcOKwg2HyXMZZZnVc2hVmhA1upzy4WPy0NvZjR5wdvb7rppWxR1i/zsgnae nLpcKIrcRbG6/TJeYiFMl11B8SC+vUzfKDwW5oK+dL+EQNffr36qQiUrMJX3fnALNvkz AIRJEUHLE3LGrdiiEWKCvsTPSRAzC9/CVra6o1Bw0BoshcnY0MpzL0+2XmcRbQeHa/GN 4YPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796030104; x=1796634904; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iB9ME09GW6CmsY+k+yV51/xrYq6/QDBiZWnbJ6v9Vis=; b=i7O685nfzjKKHRCx1sqKy8Mze9lGcxPFyleKQX+zvCBoDNIlygeaoCH/izSnhGjOn7 1ghsSjkzATaWbF+5EpVrhV/3rNuy5CHxKP66HuUyM8sJMvJ5X6CUoSfc2RsD++nwlckw M2X0GRDifdtvGYcsHBu4HA7PDH0DI9L/07SUbidd6B1kdHHr6pgie+o1hVSh358cKbk+ +V9QQWojJ6Cp6gDJn8KsbdRVbZ3bPjZlRSR+VFLm8yXbsqXjWmwPAEWwhKhgcm5cNLbq TQxqw+qXSq0oLu73OLfcdAY5FUKjnSs1IvcDHk2HAxlyqmmg3US86/lDnQhlY3ibRblK ZLeg== X-Gm-Message-State: APuU4Z+MJ52v6zO1uz5oM2iFQdMGrRXPVp6lIeCPyEJ+rsH/LU/J83u5 im+zkBooR7D8Jf0ZmGO1BEFN+XItObDBlZ9AGPam92Q6PWn6a9NS6mwAzE0W66MT0kqM/pzalNi OIi2M X-Gm-Gg: AZFdTZfkXyWQnHR7bYbCcGtFC2E1+lvM7ie+Z83vv0tkz9e8U5VKAZmtWyZyrQUDP6A CNkOtk2izBE/ScpB3RZig/TcvsBt/bvCMyaQspcba6OEq4RXfDZr2tWty5PHUiwK379SBJR6i5h +PRliNoyzQ7GH4aPSnLJcFYNxLjuvC3u2ow50IP2/3S0Ccou2TNRPpfMSBIPBkQcerOOI5Y8yE6 fFo9FvaEDLOzxYGTSCgpoiRb7TqHZbRWmxfdGYSjanBV/Ap8+6RI0N20idW/BzoU7peQq4hFMEd OEPcXjtC8HJ3P89pckBRlZQMlfurUUdJcmZOMG9LQfU1wfHLOm6tpdd05JRAF2TytoHd1t7+YLl IGxuOdfk5kWQWTK0R1G66x3d7W9cWUB2+Tkmj9EbOju1tEMD12KRgH7LzAewBGYHLD0jGry3pto HIYIurJ2XKYMhtkXSqLlmJLgBitBdZZUbipYMJkfuOMxrXzJ/yxc0dpWApU/BWk3BAAM9sfZ6pA tH5vEnZKoY228W6v/ezd1zg3vRZ4w7pVoWB0ninKoEe2GtMyOVISu+injXC3JgD+qjt6+58MPxd wBdvKAWKqIxedHcJKr01qmo+85QhFtBqw3A46GMEDNLttoUXKcaYdLhURhfq+nxlb2rUkXVOC6C YGnjRVQH9H2kTZV94fKboFqH9rrZi1c9XjnQllphisSokac6o X-Received: by 2002:a05:7301:4718:b0:380:9c6f:ad0a with SMTP id 5a478bee46e88-3856e63b224mr31956715eec.10.1796030103303; Mon, 30 Nov 2026 01:15:03 -0800 (PST) Received: from localhost.localdomain ([103.47.169.47]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386ffc4ab65sm13869349eec.22.2026.11.30.01.14.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Nov 2026 01:15:02 -0800 (PST) From: Shubham Antil To: netdev@vger.kernel.org Cc: Simon Horman , gio@octane.security, David Heidelberg , 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 Message-ID: <20261130091456.62379-1-shubham@octane.security> X-Mailer: git-send-email 2.54.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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