From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796326630; b=OK62txd//mldgSXYehn76zj4Fhb2HCirMCvh8JgH6GICw06dTF7kShV2f0O2VRH0rU0a OW8mNk5LDnM/pu57mzRT4CAWxAYTgijK8W29qWbmAkWDFvDRr+/FartHCp6ibiLnPXawL jWaLewH5NRJLXiS9V2QYsmvGOUA/bxRPaPLIA4o0qlfxanXFGsyplkQScQve9vaGRfQ7m 10f3S1j1WuQ4SeP7DRad9X01ZzuAIgujfjJ4OLsno60jeOOtIJo0KwlmdFauABstFDeM+ Mjaqsq9UehaTaMcMsOOvWPU4+YGlaBLj8qu18n4gaVNdxqiJ4AHr7pU71MAUiwWHQ1g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796326630; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=B1a+tg/XTMfK7G2ftDBxNEg2pwJ+ejl43CsOkrkuk1Y=; b=oVr24xOGYjbXP/hw9UXnpLjyYsS0wwiRcMR2MDKWo75ZqkMRqQoZtRkK6jx8iF3/Z3YZ Xr65PcRF8c9PBykJmCoVZs5KvAOf5SHQEQhSyAoXdvzZaz1ZuhKrAB+5heUz8URtIGDAP CRBJFwzUL3FzvKDwC5/ClUcwM93WbtBRGlEt9/YJFXoQUz9vZFH8dMsEC10Hc+fgnbL8b 3dK/uidErbycMEfvG4ThsthXTYnSSdmphQRsBjC6162PA/RL5FSt7he0K9A6at6UHeFbW XfTy+JL4hiY4g6QIXH5LdiesAgxokvHLQ+i0Fx91+Fc93XlDSFo3UqI/cMN6mabQYSQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=QEPm8caA; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C971960A3808; Thu, 3 Dec 2026 19:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=QEPm8caA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8667B1F000CE; Thu, 3 Dec 2026 19:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796326630; bh=B1a+tg/XTMfK7G2ftDBxNEg2pwJ+ejl43CsOkrkuk1Y=; h=Date:To:From:In-Reply-To:References:Subject; b=QEPm8caAEuVYIJbqAj7JG72WT0J4/JiwjIKSu+SL5uAYBkvB0V0ogrTucsXbjn8Kg lNxANbbylE7Sl8KEa+JsYKuVuBVSEs8tLcZv+3/Gnkud+aybKYU2nY4O5ONpdK/3jY aMJR9nEUcN93jp+XgbwoPqPy1p3rnw+GjM1rZ0r4= Date: Thu, 03 Dec 2026 11:37:10 -0800 To: mm-commits@vger.kernel.org,zohar@us.ibm.com,stable@vger.kernel.org, nicstange@gmail.com,karthik@pereq.eu,herbert@gondor.apana.org.au, ebiggers@kernel.org,dmitry.kasatkin@gmail.com,clement@cryspen.com, dan@pereq.eu,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261202-digsig_send-v1-1-2797f094dac3@pereq.eu> References: <20261202-digsig_send-v1-1-2797f094dac3@pereq.eu> Subject: + lib-digsig-fix-error-pointer-dereference-in-digsig_verify_rsa.patch added to mm-nonmm-unstable branch Message-Id: <20261203193710.8667B1F000CE@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: lib/digsig: fix error pointer dereference in digsig_verify_rsa() has been added to the -mm mm-nonmm-unstable branch. Its filename is lib-digsig-fix-error-pointer-dereference-in-digsig_verify_rsa.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-digsig-fix-error-pointer-dereference-in-digsig_verify_rsa.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Dan Carpenter Subject: lib/digsig: fix error pointer dereference in digsig_verify_rsa() Date: Wed, 02 Dec 2026 15:20:28 +0300 Patch series "lib/digsig: fix some bugs in digsig". Pereq is doing formal verification work. These are some bugs we found. * Dereferencing an error pointer on the error path * Not implementing the RFC correctly * Allowing garbage bytes after a signature Fixing the last two bugs is just about correctness and they don't actually affect real life. This patch (of 3): This error path calls mpi_free() with an error pointer which will crash. Set the "in" pointer to a NULL instead. Link: https://lore.kernel.org/20261202-digsig_send-v1-0-2797f094dac3@pereq.eu Link: https://patch.msgid.link/20261202-digsig_send-v1-1-2797f094dac3@pereq.eu Fixes: 03cdfaad491e ("lib/mpi: mpi_read_from_buffer(): return error code") Signed-off-by: Dan Carpenter Signed-off-by: Andrew Morton Reviewed-by: Eric Biggers Cc: Herbert Xu Cc: Nicolai Stange Cc: Mimi Zohar Cc: Karthik Bhargavan Cc: Clément Blaudeau Cc: Dmitry Kasatkin Cc: lib/digsig.c | 1 + 1 file changed, 1 insertion(+) --- a/lib/digsig.c~lib-digsig-fix-error-pointer-dereference-in-digsig_verify_rsa +++ a/lib/digsig.c @@ -131,6 +131,7 @@ static int digsig_verify_rsa(struct key in = mpi_read_from_buffer(sig, &nret); if (IS_ERR(in)) { err = PTR_ERR(in); + in = NULL; goto err; } _ Patches currently in -mm which might be from dan@pereq.eu are lib-digsig-fix-error-pointer-dereference-in-digsig_verify_rsa.patch lib-digsig-reject-a-signature-larger-than-the-modulus.patch lib-digsig-reject-garbage-bytes-after-the-signature.patch