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=1796280279; b=HOjLFlcUQsKz8t9u9p8dfVFKLkkXqsyhET/AwoT9aU905bQ1mY8TuudLRo7N89coYjof AFXvcHkwqRbro+HyffNLT7YrmM121qfImVZI3iTGa4zKGaEv0vvcI1mesMCri0t1bucKQ YWVTJSs7wLmZnq1uWoj5s55Zzaf7FSiSp0qo2ji414EOxZWALYLDWYHQBkbQ/n60hzutW hMIR7Q357sj/t58tcaFEP2W6qjKINHLMhoXvsTrzlR98JigN9kBUedBOEm3ah2FvgvViS qTNYzIHy2ZSIwytwTH2/mYwPzCkdoSBx0ifDhP3rqz7+SKmQfLHcnjmOBS0uRaqJp0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796280279; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=DYqT1QPmFJEYloZjH761/2z/3T2tcDeZMm5/5cjZy4A=; b=0XohyYg73BVBL4by0V06oHV88+mCs6W9ku3kilbLdh6b5Ssxyy9VQs+QwN+UTCw3JW75 9/s+fCWZklWdONDVRUwT3jork681HHW1PHq4JeHpb11XdBlt0Gqg8mBWOm09j6Y3llh1v wEBfuKD1Og//ezkMi7FmSF+GRl39QeHFDLu8fgfBViIusdXcsRxd4fEN32cu6z/OlIc7h 5YzSnywRnEabb47C5aIcMgJZVwbhh4kjKFlQXsbhWN1i03bdndd78ahno4MhuAKXIJqqL nZi1Jmaonr+suBIRPTSWk9PAU6qjs+pgjUC1LsU6F+2KfpZZyR/YuWU4HjV9v+8yjXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="K/yOa6rL"; 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 BC946606A322; Thu, 3 Dec 2026 06:44:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=K/yOa6rL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B4041F000C1; Thu, 3 Dec 2026 06:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796280279; bh=DYqT1QPmFJEYloZjH761/2z/3T2tcDeZMm5/5cjZy4A=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=K/yOa6rLWyaZaFmC6N0lKnTi0Lo4vIjhVnMwiBTe4LkaTp5XpsBItgQuQj32Utuk4 /nzFknYNg+JFQmfG47XRv22Z4P3p+JHoBCf1tmBVYgRylz6hg8NcR3dYyt6O6Ujtzf 0Y1ahBBKkgoLTMestjh4vi3ZfnXy8sYDCG43Xdwq1SbS7GrVANn/BRtLzMJgZTOFBT H7evriVNTp2qYvHB+DLwXEejIg9uA7djTOcfUhDoi4DGJdp4bfaqCBIYJJnti8Q/9b sibgrWgKQ/aChDfzGTETrsk4ak5cwK+2vIQl6w/EqYwmaXmEJlVvqvdD+RYxuVQHM5 E39WQWSLlQ3lQ== Date: Wed, 2 Dec 2026 22:44:37 -0800 From: Eric Biggers To: Dan Carpenter Cc: Andrew Morton , Herbert Xu , Nicolai Stange , Mimi Zohar , Karthik Bhargavan , =?iso-8859-1?Q?Cl=E9ment?= Blaudeau , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, Roberto Sassu , Dmitry Kasatkin Subject: Re: [PATCH 0/3] lib/digsig: fix some bugs in digsig Message-ID: <20261203064437.GA69004@sol> References: <20261202-digsig_send-v1-0-2797f094dac3@pereq.eu> <20261202125716.6d3b02ad55f627a480550617@linux-foundation.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: [ +Cc linux-crypto@vger.kernel.org and linux-integrity@vger.kernel.org ] On Thu, Dec 03, 2026 at 09:18:53AM +0300, Dan Carpenter wrote: > On Wed, Dec 02, 2026 at 12:57:16PM -0800, Andrew Morton wrote: > > On Wed, 02 Dec 2026 15:20:27 +0300 Dan Carpenter wrote: > > > > > 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. > > > > > > lib/digsig.c | 11 +++++++++++ > > > > Thanks. > > > > hp2:/usr/src/mm> scripts/get_maintainer.pl -f lib/digsig.c > > Andrew Morton (maintainer:LIBRARY CODE) > > linux-kernel@vger.kernel.org (open list:LIBRARY CODE) > > LIBRARY CODE status: Supported > > hp2:/usr/src/mm> > > > > Someone please change this!! > > Someone needs to summon Greg. Say his name three times. :P > > Realistically, it's probably going to fall to Mimi or maybe we could put > it under crypto? > > regards, > dan carpenter lib/crypto/ is for standalone cryptographic algorithm implementations. lib/digsig.c is a high-level keyring consumer (using the keyrings subsystem, which lib/crypto/ has no dependency on) that implements support for the IMA/EVM-specific obsolete v1 IMA/EVM signature format, hardcodes SHA-1 hashing, and uses a bespoke implementation of RSA PKCS#1 v1.5 on top of the MPI library. Only that last part is a cryptographic algorithm implementation (of an obsolete algorithm, of course). I think it should be moved to be alongside its only caller in security/integrity/ and renamed to digsig_v1.c. That would make it be owned by "INTEGRITY MEASUREMENT ARCHITECTURE" in MAINTAINERS. Likewise, include/linux/digsig.h should be a local header in security/integrity/. Documentation/security/digsig.rst should just be deleted, I think. Mimi, Roberto, Dmitry: does that sound good to you? Note: at some point I'd like to fix the kernel's RSA code, in which case digsig_v1.c would have something better to call than the MPI library. But security/integrity/ is still the right place for this file. - Eric