From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 186FBC433EF for ; Tue, 25 Jan 2022 20:27:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Jjz1m3Nlpz3c5j for ; Wed, 26 Jan 2022 07:27:56 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=jfnP7t3V; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=mcgrof@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=jfnP7t3V; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Jjz146j99z2x9M for ; Wed, 26 Jan 2022 07:27:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3Bb23zhtgzU7Wxmk6KGQnnxzZSeCxUCxB/mlyZEzbkg=; b=jfnP7t3Va434azfa7CGwqEJbQ3 qHZG/qaQxtDi2ObBW5J1jYfDwVfVM7ZUb5kf4IPYmQuegN1jWD+hLfCoF4eox6NUOrbMDbRDvd01P JRJWLy/SP3edGvoUXvlMLgzz1kTXs+G5BrMyJV7syMki25lRyu8gdthFr1hhQvQHZupGC5DWg66N/ LEQ1I7WT1IB4ucPJrXH5MM71+fYSk0pRh4AF7UjEH0NX75oo6gxDediH1BwVk6Y3UAqpWY5jK9vW+ tzDWcn98pI0mUU6JoOfNXyWnp1tDG/xMPd+7rh9K+brTE+sbTmSPvJI5KJmcklnDNhzERB4gNoR6J gznneLpg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCSPJ-009Utb-SO; Tue, 25 Jan 2022 20:27:13 +0000 Date: Tue, 25 Jan 2022 12:27:13 -0800 From: Luis Chamberlain To: Michal Suchanek Subject: Re: [PATCH v5 6/6] module: Move duplicate mod_check_sig users code to mod_parse_sig Message-ID: References: <687db74a714d50b9c83d7ac024da4f7dec0d9a1d.1641900831.git.msuchanek@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <687db74a714d50b9c83d7ac024da4f7dec0d9a1d.1641900831.git.msuchanek@suse.de> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nayna , Mimi Zohar , Sven Schnelle , David Howells , keyrings@vger.kernel.org, Paul Mackerras , Alexander Gordeev , Rob Herring , Herbert Xu , Baoquan He , Christian Borntraeger , James Morris , Lakshmi Ramasubramanian , Christian Borntraeger , "Serge E. Hallyn" , Vasily Gorbik , linux-s390@vger.kernel.org, Heiko Carstens , Dmitry Kasatkin , Hari Bathini , Daniel Axtens , Philipp Rudo , Frank van der Linden , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-crypto@vger.kernel.org, Jessica Yu , linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" , Thiago Jung Bauermann , buendgen@de.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Jan 11, 2022 at 12:37:48PM +0100, Michal Suchanek wrote: > Multiple users of mod_check_sig check for the marker, then call > mod_check_sig, extract signature length, and remove the signature. > > Put this code in one place together with mod_check_sig. > > This changes the error from ENOENT to ENODATA for ima_read_modsig in the > case the signature marker is missing. > > This also changes the buffer length in ima_read_modsig from size_t to > unsigned long. This reduces the possible value range on 32bit but the > length refers to kernel in-memory buffer which cannot be longer than > ULONG_MAX. > > Also change mod_check_sig to unsigned long while at it. > > Signed-off-by: Michal Suchanek Reviewed-by: Luis Chamberlain Luis