From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mmCFm-00005n-3u for mharc-grub-devel@gnu.org; Sun, 14 Nov 2021 04:56:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCFk-00005a-BU for grub-devel@gnu.org; Sun, 14 Nov 2021 04:56:48 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:42913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCFh-0004hY-Tj for grub-devel@gnu.org; Sun, 14 Nov 2021 04:56:48 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 80FD63200933; Sun, 14 Nov 2021 04:56:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 14 Nov 2021 04:56:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=hnE4UHPbyfmXNUMe0nlAicKK8fJ zS6Bv1qP1kJH0a8g=; b=cRRLEhgFPtVUwWlKK9L9NxnjmwMkgQtSjATG1QXJM32 PcBX7tjUh+6FslIeZxnHzev99BwAniobJfhfm/EQuBCLdYRvDFbZ5dZGpf+iwc5w uhDiJ4BuekIPvw0XWt4r7CtKolRT2qG4pQtqFKN/5QwZrYXN36pmhin6ccZYiPFE c5xGwXRZUrXXMnp7pA5ienePDeFOus0JGIsMW5f89IfU0t9Q0nHXLj4RwDGZyIdE 7kxyRfvH6XTaWgolz+7uLUCIR3Z+FmCIze8sy9wyF0CCAiQuc7EgCzvENYJ+OoPy X3363sLrf52aAiPkOzgzXLbs3zKOjI/MY2mXr4oluuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hnE4UH PbyfmXNUMe0nlAicKK8fJzS6Bv1qP1kJH0a8g=; b=ZI0lCPxr9i8i6pAM6WWtTg VlU1DrX/0MoGVIEbuUinsrtEJGGOQxW/8bHBOTkdi5nTwSMhrczqyjrm7sYmmFhS rkGQSAgto7stLLCE7TniuRQ5a5lppDdJXmY6ExX9HH9lyovAScsltlJ2FCbKbEs3 +yeAVMsPsqlE6GeYjfwDnTM8k6OxxprYj8vetLfN5HZKQhHBtl8eMuZ5VtANugMj 1im1XNUHft6aljqv/uFcEbPSOW9bxu0rwpYCTRJcK4JeDMdLo2oACOqtaSfJ7aoa MITGvcTa1EqCl+/dXOaqAKX9Kd6MPGHmh0oZu2AtGnTxwvbNfwcL5aU/eR8+KmMQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvdejgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfhnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkh hsrdhimh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Nov 2021 04:56:41 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id af069b73 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 14 Nov 2021 11:39:56 +0000 (UTC) Date: Sun, 14 Nov 2021 10:56:15 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: Daniel Kiper , grub-devel@gnu.org, Denis 'GNUtoo' Carikli , James Bottomley Subject: Re: [PATCH v3 3/4] cryptodisk: Move global variables into grub_cryptomount_args struct Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Wa9I4EeDzOsca3+e" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.20; envelope-from=ps@pks.im; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2021 09:56:48 -0000 --Wa9I4EeDzOsca3+e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 12, 2021 at 06:26:28PM -0500, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > --- > grub-core/disk/cryptodisk.c | 26 +++++++++----------------- > grub-core/disk/geli.c | 9 ++++----- > grub-core/disk/luks.c | 11 +++++------ > grub-core/disk/luks2.c | 6 +++--- > include/grub/cryptodisk.h | 10 ++++++++-- > 5 files changed, 29 insertions(+), 33 deletions(-) >=20 > diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c > index a5f7b860c..5b38606ed 100644 > --- a/grub-core/disk/cryptodisk.c > +++ b/grub-core/disk/cryptodisk.c > @@ -984,9 +984,6 @@ grub_util_cryptodisk_get_uuid (grub_disk_t disk) > =20 > #endif > =20 > -static int check_boot, have_it; > -static char *search_uuid; > - > static void > cryptodisk_close (grub_cryptodisk_t dev) > { > @@ -1014,7 +1011,7 @@ grub_cryptodisk_scan_device_real (const char *name, > =20 > FOR_CRYPTODISK_DEVS (cr) > { > - dev =3D cr->scan (source, search_uuid, check_boot); > + dev =3D cr->scan (source, cargs); > if (grub_errno) > return grub_errno; > if (!dev) > @@ -1049,7 +1046,7 @@ grub_cryptodisk_scan_device_real (const char *name, > =20 > grub_cryptodisk_insert (dev, name, source); > =20 > - have_it =3D 1; > + cargs->found_uuid =3D 1; > =20 > goto cleanup; > } > @@ -1091,7 +1088,7 @@ grub_cryptodisk_cheat_mount (const char *sourcedev,= const char *cheat) > =20 > FOR_CRYPTODISK_DEVS (cr) > { > - dev =3D cr->scan (source, search_uuid, check_boot); > + dev =3D cr->scan (source, NULL); If I didn't get this wrong, then all scan implementations unconditionally dereference the `grub_cryptomount_args_t` pointer. So why does this work, and shouldn't we pass down a struct which has the `search_uuid` and `check_boot` parameters properly set up? Patrick --Wa9I4EeDzOsca3+e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAmGQ3T4ACgkQVbJhu7ck PpR8Kg/+L+Arbc+rHUk7U4oF2A+T9QkAX5kwCAUB2xgkCa/DTGFi9TazwzdMa5AI Ahkwe5DvpC0WkFncf/Yh7Lvbr8wU0+VPz8EsLbAbOYs2o+PHm0ot0k5T39Mv7l/T Td7E0TZE3y5IkAOTC3C8H1A0LncJhhaShfoKsS0BvsqGpA1b5nqT8ZQ/7tzeJr+f IWpN6GLVRfLrAyHgTP2r6Ao1MVXTs/mazk9JgxuOFYVMZzy6QDZEUruIec1U3n31 yK+tZ5DUREzESozGYgth9EW7yHOHycY4tYpmn0P/I2qgXnZ+m+GWszMzAgOq/sBZ 2ARAR4sHAcrGCpHL4y3PkxTbha+e9oRCv1PZyRED/rxf++RPYaP7MB5Gr879k5RB MMg8Hpk92700U+SC7p+pkdMgxZ0ZBusoDLY8Bvefnpx8ZwUN/0JA0JRs5O9q1Hj0 k6SLYf2Sxm+cZ+f8EopUC55E2+BmYl5Ln6xIMdugKSwUrnEhLYVfRSUlNnNuL2an FMe9GWYHbwqr/BvmCOiJMyWnuK3wjSuZNddfNyirtx61x+G49usXTVv4SSrUEZAt PhCNEU9D78HkD77HxgM9HvppINrKqdD5g3Hnv40Mb8DBZIiZrZnyJ6MiEcVcZhmO gYiFhoyiYbskB1QyOgJTmAPimRtQiN6aaXJvjGauOkVVrxIo/DE= =LfFD -----END PGP SIGNATURE----- --Wa9I4EeDzOsca3+e--