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=1796326635; b=0FrjOosfWmk6f9GUDfUos1krJIr8PCqaqyoqeMVhhn+kfpiw8aNbhhFdVtEKXeFtMz3Z xwGEti4xCPmZ2dhsxb0usVLcTHh5eaxIO1yFwTKLqmeFYTRZwnoU01aVCOWEvQO6nnOAg b6pQjMJGx7Tg0MRPZSQErNeRICWXyBwEx80G9aCb8Vz1uDz5Ha+IXveg24is8ukzqby4J 6DEILV3cRUclyc1DR+RZbwTC29tJO1OEtUwVGKKmhFWPmOL/qpYWxVb2IOkMYDARpe/l4 vs+oIBEjGQSROlUOEkexkUbZeKR5t0S7vIYxl5eRT4+vhl3FV//bPBPH2Tfma0v7u3g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796326635; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=xprzHU3/97rMgCnYT7LHHsQG5SejvyFeQk5PreFX1Nc=; b=dIPqsdfLNiLlgQHsmND8gECaIsuiYHAd9zp7SYGOovVOY2TzmgvAIEmsPoZ5v9QfAwnp p9vf59QwMaSg1VMIKSce1G6T6ADgU+lqAxgojZk14TFAoURVy1JfBh0vOxjrrqsW+CT9t DE1kNefr60JTHIE0Ep7eQTPP/N/m0CPolbVTAoYhmzmA1zfOkDnJn0kq03SjmYqDZ44mg rNTOLa3eMefyfoUNTW5sbsNTftofxTF9gF7kAj46LkKOljTGMykneANY+SzqXGOxwgvDh OEmFz7vTqiQPIspAYepzTXgFZs0j9SrX7RMxMybhvFdVa3vscHubJlsAc69KBh8PHkg== 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=ukhhPB8B; 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 959C360A3811 for ; Thu, 3 Dec 2026 19:37:15 +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=ukhhPB8B Received: by smtp.kernel.org (Postfix) with ESMTPSA id 235071F000CE; Thu, 3 Dec 2026 19:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796326635; bh=xprzHU3/97rMgCnYT7LHHsQG5SejvyFeQk5PreFX1Nc=; h=Date:To:From:In-Reply-To:References:Subject; b=ukhhPB8BpJ1anJOiSwIWTK42ri0z8cqEPg4/k5+1htTEAfHWPqP0/E95dIxMM+fzr wx7AixY1nOHmeeUOwL2dozjmDxlHr5cxvW2pCZRYztsPSmeWamoHtP51+b15kRS8f8 Rrbj0z4ulc5S0QURV+kZPcxjy3sFf09DOrISKX2I= Date: Thu, 03 Dec 2026 11:37:14 -0800 To: mm-commits@vger.kernel.org,zohar@us.ibm.com,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-3-2797f094dac3@pereq.eu> References: <20261202-digsig_send-v1-3-2797f094dac3@pereq.eu> Subject: + lib-digsig-reject-garbage-bytes-after-the-signature.patch added to mm-nonmm-unstable branch Message-Id: <20261203193715.235071F000CE@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: lib/digsig: reject garbage bytes after the signature has been added to the -mm mm-nonmm-unstable branch. Its filename is lib-digsig-reject-garbage-bytes-after-the-signature.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-digsig-reject-garbage-bytes-after-the-signature.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: reject garbage bytes after the signature Date: Wed, 02 Dec 2026 15:20:30 +0300 The digsig_verify_rsa() function accepts signatures with garbage after the end. Reject signatures that aren't the correct length. evmctl writes the header, the bit count and the RSA output and nothing else, so no one is affected by this in real life. It's just a correctness issue. Link: https://patch.msgid.link/20261202-digsig_send-v1-3-2797f094dac3@pereq.eu Fixes: 051dbb918c7f ("crypto: digital signature verification support") 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 lib/digsig.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/lib/digsig.c~lib-digsig-reject-garbage-bytes-after-the-signature +++ a/lib/digsig.c @@ -135,6 +135,11 @@ static int digsig_verify_rsa(struct key goto err; } + if (nret != siglen) { + err = -EINVAL; + goto err; + } + if (mpi_cmp(in, pkey[0]) >= 0) { err = -EINVAL; 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