All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Glenn Washburn <development@efficientek.com>
Cc: Daniel Kiper <dkiper@net-space.pl>,
	grub-devel@gnu.org,
	Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH v3 3/4] cryptodisk: Move global variables into grub_cryptomount_args struct
Date: Sun, 14 Nov 2021 10:56:15 +0100	[thread overview]
Message-ID: <YZDdP9mTMC3XalkB@ncase> (raw)
In-Reply-To: <fed38b3dc76fdbc70d4d0907715211c30aa9bc06.1634081029.git.development@efficientek.com>

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

On Tue, Oct 12, 2021 at 06:26:28PM -0500, Glenn Washburn wrote:
> Signed-off-by: Glenn Washburn <development@efficientek.com>
> ---
>  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(-)
> 
> 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)
>  
>  #endif
>  
> -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,
>  
>    FOR_CRYPTODISK_DEVS (cr)
>    {
> -    dev = cr->scan (source, search_uuid, check_boot);
> +    dev = cr->scan (source, cargs);
>      if (grub_errno)
>        return grub_errno;
>      if (!dev)
> @@ -1049,7 +1046,7 @@ grub_cryptodisk_scan_device_real (const char *name,
>  
>      grub_cryptodisk_insert (dev, name, source);
>  
> -    have_it = 1;
> +    cargs->found_uuid = 1;
>  
>      goto cleanup;
>    }
> @@ -1091,7 +1088,7 @@ grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat)
>  
>    FOR_CRYPTODISK_DEVS (cr)
>    {
> -    dev = cr->scan (source, search_uuid, check_boot);
> +    dev = 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-11-14  9:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 23:26 [PATCH v3 0/4] Refactor/improve cryptomount data passing to crypto modules Glenn Washburn
2021-10-12 23:26 ` [PATCH v3 1/4] cryptodisk: Add infrastructure to pass data from cryptomount to cryptodisk modules Glenn Washburn
2021-11-17 17:29   ` Daniel Kiper
2021-12-01 21:18     ` Glenn Washburn
2021-12-03 15:43       ` Daniel Kiper
2021-10-12 23:26 ` [PATCH v3 2/4] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk Glenn Washburn
2021-11-17 19:10   ` Daniel Kiper
2021-12-01 21:48     ` Glenn Washburn
2021-12-03 15:54       ` Daniel Kiper
2021-12-03 21:04     ` Glenn Washburn
2021-12-03 21:35       ` Daniel Kiper
2021-12-04  6:55         ` Glenn Washburn
2021-10-12 23:26 ` [PATCH v3 3/4] cryptodisk: Move global variables into grub_cryptomount_args struct Glenn Washburn
2021-11-14  9:56   ` Patrick Steinhardt [this message]
2021-12-01 22:07     ` Glenn Washburn
2021-11-18 14:06   ` Daniel Kiper
2021-12-01 22:29     ` Glenn Washburn
2021-10-12 23:26 ` [PATCH v3 4/4] cryptodisk: Remove unneeded found_uuid from cryptomount args Glenn Washburn
2021-11-18 14:25   ` Daniel Kiper
2021-12-02  6:51     ` Glenn Washburn
2021-12-03 13:29       ` Daniel Kiper
2021-11-14  9:57 ` [PATCH v3 0/4] Refactor/improve cryptomount data passing to crypto modules Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZDdP9mTMC3XalkB@ncase \
    --to=ps@pks.im \
    --cc=GNUtoo@cyberdimension.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.