lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230607135746.92995-1-hch@lst.de>
Date:   Wed,  7 Jun 2023 15:57:46 +0200
From:   Christoph Hellwig <hch@....de>
To:     axboe@...nel.dk
Cc:     linux-kernel@...r.kernel.org, Fabio Estevam <festevam@...il.com>
Subject: [PATCH] block: fix rootwait=

Failures to look up the gendisk must return -ENODEV so that rootwait
retries the lookup instead of -EINVAL which exits early.

Fixes: cf056a431215 ("init: improve the name_to_dev_t interface")
Reported-by: Fabio Estevam <festevam@...il.com>
Signed-off-by: Christoph Hellwig <hch@....de>
Tested-by: Fabio Estevam <festevam@...il.com>
---

[Jens, if you need to rebase for any reason it might make sense to fold
 this into the offending patch]

 block/early-lookup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/early-lookup.c b/block/early-lookup.c
index 3ff0d2e4dcbfb8..48ea3e982419cc 100644
--- a/block/early-lookup.c
+++ b/block/early-lookup.c
@@ -181,7 +181,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
 	*p = '\0';
 	*devt = blk_lookup_devt(s, part);
 	if (*devt)
-		return 0;
+		return -ENODEV;
 
 	/* try disk name without p<part number> */
 	if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
@@ -190,7 +190,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
 	*devt = blk_lookup_devt(s, part);
 	if (*devt)
 		return 0;
-	return -EINVAL;
+	return -ENODEV;
 }
 
 static int __init devt_from_devnum(const char *name, dev_t *devt)
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ