Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7D993E0235 for ; Fri, 24 Apr 2026 14:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777042105; cv=none; b=YZR/qyoI8aW2B+S/xahLEjOGHUQ0PM5p583yre0pB/6JgjqBpDE8aE7gohEw27pChr6XAHXVcBGA6SS++ulnSLszdJfSp4Tw+PCKSoyKUFqH4PCR/5SW+Czh3uvc0BKSnkWBOZ1FP5d5BvqOs6L0WjM4v9YM4dFA/HKmBSK0Jyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777042105; c=relaxed/simple; bh=O++i8FHNa7SL3ssq6DGG1dv4KOrSHmJ1atHXZX16qU0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JlTPZvCLDaTwTXKcCSuIAuo60mNmvwEWxna46d+tTpyXlEnQPBTq+MgWt7lg6jyHWsahklpmbC45s+7+tUgvigwFBIvvHpmBt3Y4L2zYZ2snJ06I83JV9zQixMLH1AYPJQdpqcqP8i2Kyr2d8tFM168FtXuq2jUbV/7hJM8NuuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q/8exkNy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="q/8exkNy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FC42C19425; Fri, 24 Apr 2026 14:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777042105; bh=O++i8FHNa7SL3ssq6DGG1dv4KOrSHmJ1atHXZX16qU0=; h=From:To:Cc:Subject:Date:Reply-To:From; b=q/8exkNyOHV30w48U3qm8cwU0gw7l6L1I42L4TmA4rsuKlR555u33YGVnddEKAHk0 dtPIREkh802ZwQsH+sr3CR37xhCoa0rhBrAuGAxdWUg+vijL+QVoGtEGchtZG90asR DDR0eFgxrX/vpjg2e+IydBTPG4uvN+k9CA68JsxE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31660: nfc: pn533: allocate rx skb before consuming bytes Date: Fri, 24 Apr 2026 16:46:22 +0200 Message-ID: <2026042403-CVE-2026-31660-9293@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3772; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=IxBI0EeK94jVmPkZVz7Mrpx+AqhIMXfNPZ93idHxhFQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvm7TjbFuuVDtMVxZ7o1bDdt2Sc76bVVWdxLNfCa5rV G7s6X3cEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMJ1mNYMPeJgfqekxu6b5/e 9/HaMbFarbdrGBnmFxZp7ewpThH1Dw5fvUhqy1fJvVbPAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: nfc: pn533: allocate rx skb before consuming bytes pn532_receive_buf() reports the number of accepted bytes to the serdev core. The current code consumes bytes into recv_skb and may already hand a complete frame to pn533_recv_frame() before allocating a fresh receive buffer. If that alloc_skb() fails, the callback returns 0 even though it has already consumed bytes, and it leaves recv_skb as NULL for the next receive callback. That breaks the receive_buf() accounting contract and can also lead to a NULL dereference on the next skb_put_u8(). Allocate the receive skb lazily before consuming the next byte instead. If allocation fails, return the number of bytes already accepted. The Linux kernel CVE team has assigned CVE-2026-31660 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 5.10.253 with commit 2ca64fb7e2d2ae14619dd204d4f2f0a601f421fb Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 5.15.203 with commit 8b71299d587d9e4c830c18afb884c80ddb30ad28 Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 6.1.169 with commit 16649adc2e19509104245ea1f349b629d858f11f Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 6.6.135 with commit 07cb6c72e66ba548679f22ac29ad588da8999279 Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 6.12.82 with commit a9495069b43b8634c1ae0042e888766c34f66637 Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 6.18.23 with commit 21ae2cda66a55c759607bbf1d23cbaa42019d2de Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 6.19.13 with commit 7e37da42eda45d7859d9273fc7e225d8df458038 Issue introduced in 5.5 with commit c656aa4c27b17a8c70da223ed5ab42145800d6b5 and fixed in 7.0 with commit c71ba669b570c7b3f86ec875be222ea11dacb352 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31660 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/nfc/pn533/uart.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/2ca64fb7e2d2ae14619dd204d4f2f0a601f421fb https://git.kernel.org/stable/c/8b71299d587d9e4c830c18afb884c80ddb30ad28 https://git.kernel.org/stable/c/16649adc2e19509104245ea1f349b629d858f11f https://git.kernel.org/stable/c/07cb6c72e66ba548679f22ac29ad588da8999279 https://git.kernel.org/stable/c/a9495069b43b8634c1ae0042e888766c34f66637 https://git.kernel.org/stable/c/21ae2cda66a55c759607bbf1d23cbaa42019d2de https://git.kernel.org/stable/c/7e37da42eda45d7859d9273fc7e225d8df458038 https://git.kernel.org/stable/c/c71ba669b570c7b3f86ec875be222ea11dacb352