| Message ID | 20251116212334.1603490-14-simon.glass@canonical.com |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org>
X-Original-To: u-boot-concept@u-boot.org
Delivered-To: u-boot-concept@u-boot.org
Authentication-Results: mail.u-boot.org;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256
header.s=google header.b=aXboxl+x;
dkim-atps=neutral
Received: from localhost (localhost [127.0.0.1])
by mail.u-boot.org (Postfix) with ESMTP id 4263D6862A
for <u-boot-concept@u-boot.org>; Sun, 16 Nov 2025 14:24:24 -0700 (MST)
X-Virus-Scanned: Debian amavis at
Received: from mail.u-boot.org ([127.0.0.1])
by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id 2jTun-ewT2wG for <u-boot-concept@u-boot.org>;
Sun, 16 Nov 2025 14:24:24 -0700 (MST)
Received: from mail.u-boot.org (localhost [127.0.0.1])
by mail.u-boot.org (Postfix) with ESMTP id 31023685EA
for <u-boot-concept@u-boot.org>; Sun, 16 Nov 2025 14:24:24 -0700 (MST)
Received: from localhost (localhost [127.0.0.1])
by mail.u-boot.org (Postfix) with ESMTP id 85825685BF
for <concept@u-boot.org>; Sun, 16 Nov 2025 14:24:22 -0700 (MST)
X-Virus-Scanned: Debian amavis at
Received: from mail.u-boot.org ([127.0.0.1])
by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id BEyXS82HE4zh for <concept@u-boot.org>;
Sun, 16 Nov 2025 14:24:22 -0700 (MST)
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.54;
helo=mail-io1-f54.google.com; envelope-from=sjg@chromium.org;
receiver=u-boot.org
Received: from mail-io1-f54.google.com (mail-io1-f54.google.com
[209.85.166.54])
by mail.u-boot.org (Postfix) with ESMTPS id E9C1B6858A
for <concept@u-boot.org>; Sun, 16 Nov 2025 14:24:17 -0700 (MST)
Received: by mail-io1-f54.google.com with SMTP id
ca18e2360f4ac-948614ceac0so144674339f.0
for <concept@u-boot.org>; Sun, 16 Nov 2025 13:24:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1763328256; x=1763933056; darn=u-boot.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=JXKL8obfGSIwqvtTShlsZyxSX5OyrhUvX5iR5f8Lcgk=;
b=aXboxl+xhPV8OrXaKBxcuAv378eCtPgbRz13RIvvpTZn+7+2MZHiDUu/1Iimg1sJcR
3AHOWiMua9ebGTRNzzSuubLRxHpWa1ywsvnj9CQDh73ToKdwNksyX7ZAZxs442mvbUaE
sDdzENWJeSnIdzmgzBq+VqyPfeeA8+3mmBK5o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1763328256; x=1763933056;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to;
bh=JXKL8obfGSIwqvtTShlsZyxSX5OyrhUvX5iR5f8Lcgk=;
b=RJQklScUViVAKa6VXsrM/HXhh1NpdNhmxnD9zr6GDZVzHnNOGkw6xEZ9o5JYljlkJV
+mG6Jdppp3N4AFVquQdAmvym3zMjaKWioWSG3Fnfb4P5PSKkNG3dPtcYkmMOot7CqXCm
XeURRLsq/Kbmjm/Umq6vevTGchyGY6vztdrH7xbb2IOfvLxoSsBlVKxxOqRpvqgCKELI
UDbAeIWkGuwnWnOqMr+Bg6M86Hy45xZ9lGVOan9gJnjB6QKyoSR9NwlA1YoPWOyxanDh
yT/7D6sMkbFUbRtotQk1baEmyQVyPyu1QnpzMpiuPo+tqxb4Uj+Q7ka3cICvWeGR5K7p
wfxg==
X-Gm-Message-State: AOJu0YzaiKBit5tohdTnMheaKqm1gZot9prdn6BLDfAnJQnF1CJ8D0oP
MvFe6CAIVJiNCIG2Fgzmq6BeMiJ6s3Ko1rGcI7i4i5POaBWacCh3jWpsn4/fHybPbYtCNNxIhw/
X0X4=
X-Gm-Gg: ASbGnctzaeeew/b7R/oJnVfmsIjQPwIqciEj8kNFkdb8dfAfWza5TF4DNOO4C2OVOzG
LASTE8CJX5rpcflfF9aK1pjSv161iWRInav/K++YXBdIiDdMHw3bjyhWkWW6Csv80QlK6UjMnQ+
n0WrfmwzQ9T5IWKLtDlyey21TLk1ECL6GoVIpVPnHMi/knGF7TA4Zige1g2HLLFW14Pc4s8cE9M
hU3QMBuQ9P6rwhsDEkoU79vfpG9Ufr7SIONwUD6HhfUTklo1Et68fziY55Jc98tGjmaEOvLxGsO
ZLbkpMB27oCEeqE1+UixcD3oIU6a7/HtmFc6t0NpvCrTnG6mIT36fVIPNltzYgwgL5EgdOj+2kn
b1sjfYXqY5+dxzs2jeRZCMou41JOgU3mZB+NNRJ2uIxGjdEK8CQa87Jtj5j87gneoQIJn//hHdC
Rnbjc1Eoi4nkJQgPmLXiFlDaRxsRn2f6U6R2fwNg==
X-Google-Smtp-Source:
AGHT+IHRSCsLXmwCVQr+PkgWPxKtO+NmxNfbBOn81U8/YmWfBu8GzdWdwu9bq1/Z6Jmsc0mupCNKMQ==
X-Received: by 2002:a05:6638:aa10:b0:5b7:40b5:7ba8 with SMTP id
8926c6da1cb9f-5b7c9de90fdmr6639356173.16.1763328256432;
Sun, 16 Nov 2025 13:24:16 -0800 (PST)
Received: from chromium.org ([73.34.74.121])
by smtp.gmail.com with ESMTPSA id
ca18e2360f4ac-948d2d162dcsm577962339f.13.2025.11.16.13.24.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 16 Nov 2025 13:24:15 -0800 (PST)
From: Simon Glass <sjg@chromium.org>
X-Google-Original-From: Simon Glass <simon.glass@canonical.com>
To: U-Boot Concept <concept@u-boot.org>
Date: Sun, 16 Nov 2025 14:23:27 -0700
Message-ID: <20251116212334.1603490-14-simon.glass@canonical.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20251116212334.1603490-1-simon.glass@canonical.com>
References: <20251116212334.1603490-1-simon.glass@canonical.com>
MIME-Version: 1.0
Message-ID-Hash: PWYRXUQDNVMQQIT4DNWLHAWUEN6TNHCO
X-Message-ID-Hash: PWYRXUQDNVMQQIT4DNWLHAWUEN6TNHCO
X-MailFrom: sjg@chromium.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop;
banned-address; emergency; member-moderation; nonmember-moderation;
administrivia; implicit-dest; max-recipients; max-size; news-moderation;
no-subject; digests; suspicious-header
CC: Simon Glass <simon.glass@canonical.com>
X-Mailman-Version: 3.3.10
Precedence: list
Subject: [Concept] [PATCH 13/14] luks: Check for out-of-memory with Argon2
List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org>
Archived-At:
<https://lists.u-boot.org/archives/list/concept@u-boot.org/message/PWYRXUQDNVMQQIT4DNWLHAWUEN6TNHCO/>
List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/>
List-Help: <mailto:concept-request@u-boot.org?subject=help>
List-Owner: <mailto:concept-owner@u-boot.org>
List-Post: <mailto:concept@u-boot.org>
List-Subscribe: <mailto:concept-join@u-boot.org>
List-Unsubscribe: <mailto:concept-leave@u-boot.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
|
| Series |
luks: Integrate support for a TKey
|
|
Commit Message
Simon Glass
Nov. 16, 2025, 9:23 p.m. UTC
This algorithm can use a lot of memory, so add a check for this condition
and return the correct error.
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
drivers/block/luks2.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/block/luks2.c b/drivers/block/luks2.c index e3f3ac28c34..db5f13badd9 100644 --- a/drivers/block/luks2.c +++ b/drivers/block/luks2.c @@ -676,7 +676,10 @@ static int try_keyslot_argon2(struct udevice *blk, struct disk_partition *pinfo, ks->kdf.salt_len, derived_key, ks->area.key_size); if (ret) { - log_err("Argon2id failed: %s\n", argon2_error_message(ret)); + log_err("Argon2id failed: %s (code=%d)\n", + argon2_error_message(ret), ret); + if (ret == ARGON2_MEMORY_ALLOCATION_ERROR) + return -ENOMEM; return -EPROTO; } log_debug("LUKS2 Argon2: key derivation succeeded\n");