From patchwork Fri Oct 11 22:48:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Marek X-Patchwork-Id: 834715 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DF2D1D14E0 for ; Fri, 11 Oct 2024 22:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687117; cv=none; b=V2qimEMRrWMenHzZSTPYqHierYO9gc0cEp8Myp82tKLpimfbBs96FxOedzyQZQh69QIDubBOEdrFfIBx4aQ72zwYZwdTwUisJJYeFYbT2Bg//76XyqroVoTIylPdmoBK+uFNDh52ILTVFQmKqBhE9VB423VcEtsjHB90aSCH/YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687117; c=relaxed/simple; bh=PGqGRVa6i6CZ3/pmHFL6eZ8DIO1wDLUvbIri95jeNdk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pYATUH+5BJKpXlH10v9i10zBTBBoHvRJTRfEBDYGtQ9/S0Xa4cavRXD0fl9Ulqyq2zY683+TBJ2msKbWs4SiRkRAima0KN10sJbSwneTp57K0OYa4YQ4FepvCgg5WLZlqiGuTlazh0JotjRuM4r2EYwO4NigLQ4KExdNg/5IPog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca; spf=pass smtp.mailfrom=marek.ca; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b=bDXzvV2X; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marek.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b="bDXzvV2X" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7b10f298052so127050485a.1 for ; Fri, 11 Oct 2024 15:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek.ca; s=google; t=1728687114; x=1729291914; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BMUWZ3q7Ti8/RCuTsETxNisdsE3nA1AwrhUgKEomt6E=; b=bDXzvV2X1l8m29PUJxETiSHgOqspDSyRsQvj0OaCIJKotRD8U+xY8acprv7CIrdbfJ xXvECJ23EWLzQ5ngLruVlyqG4pYTm4JQwpLx8XwlFPxdbajm3MqmF/Qxt6XFQOLLzfsv +wvtaIQfNuseFkO63GZL5DDPIxkY3bFzNq6sF5yc1sTMaHRlNXC3RaRTIZR0d7DTfsru UTJCrYhUswzIBWUXiEOwI6KSA5K/RIDqfMVTVpkpUuLNn/W8vnVMj7HQIYFSlRhQmb8K HlAIQnDJ8pb24NhX4hAin2CTGcWhe/Rxi98dICO7Vn+qGz2UfcWk6EBZ+IT3fpJizkl6 0s9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728687114; x=1729291914; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BMUWZ3q7Ti8/RCuTsETxNisdsE3nA1AwrhUgKEomt6E=; b=Z6JFCwrTN/jIatohoQMK1vwWeOfkkOp3rwGCObKnq118pR6bN9q0+nqswWT2PaYrEg kZw471VEQtzbKkruENcLv53MTeN7ITWIoy5Ayism6K0aD68mmr0LPVecnmPFzvRMxpXl poFNGlukvaqQjZRQTIFNpfrUW9uYuCa8N9vrM2IIqSMKhUk/ZlyHKZy4ZgMzwJUHvmkt fRbSn7P56WntJaUrf6D5nRCMYXzQSFpa8b3ZnbKxZyjwaU32DHn4x4s6CuC49ZpOjJnv W1P9YMe4gUL94Vezqg6afeHG286v/cpzCKoMG3qD99qMT89r099P1JW4stAh2pMSRYHP 9K6g== X-Gm-Message-State: AOJu0YzdSCmtpPHekx5bMptxvD6wBmekVkf+n+IUo5Rpt88TSKuCEZFv RseWbmdiNJqnHxUikeE15kjw3GZz461oMpimUlEa8oT2dxlE1kpr/2a4gV4VhXcEYQnuX4Qeuty WYdY= X-Google-Smtp-Source: AGHT+IHSbs0r4KzmUdFCsDosn4fsYLvCrF1f3B/mUVR/2u6PmRwI4ys1SiD6Ibt8c4zS0l4tREf9Rg== X-Received: by 2002:a05:620a:4489:b0:7b1:e64:902d with SMTP id af79cd13be357-7b11a34ee97mr635211685a.9.1728687114029; Fri, 11 Oct 2024 15:51:54 -0700 (PDT) Received: from localhost.localdomain (modemcable125.110-19-135.mc.videotron.ca. [135.19.110.125]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b1149893basm176499585a.134.2024.10.11.15.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 15:51:53 -0700 (PDT) From: Jonathan Marek To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Kuppuswamy Sathyanarayanan , Ingo Molnar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line Date: Fri, 11 Oct 2024 18:48:00 -0400 Message-ID: <20241011224812.25763-1-jonathan@marek.ca> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 efi_convert_cmdline() always returns a size of at least 1 because it counts the NUL terminator, so the "cmdline_size == 0" condition is not possible. Change it to compare against 1 to get the intended behavior: to use CONFIG_CMDLINE when load_options_size is 0. Fixes: 60f38de7a8d4 ("efi/libstub: Unify command line param parsing") Signed-off-by: Jonathan Marek --- drivers/firmware/efi/libstub/efi-stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index 958a680e0660d..709ae2d41a632 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -129,7 +129,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr) if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || IS_ENABLED(CONFIG_CMDLINE_FORCE) || - cmdline_size == 0) { + cmdline_size == 1) { status = efi_parse_options(CONFIG_CMDLINE); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); From patchwork Fri Oct 11 22:48:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Marek X-Patchwork-Id: 834975 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66EB61D3627 for ; Fri, 11 Oct 2024 22:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687119; cv=none; b=pL1kro47/NrVZAaprUctOGLY9e69RaigOWjaHIejOkAbOO8bsmD10QWMvPK6aJfL90/DT+JY8gXKaimslq1fYvVfHieUtuwaAQXLcsAYo/rg8kWC5Uv4Y7cw1/9eCFFDzUIbhhovyp3d/IFLe2Mw0E6+/QWCrU85Hl1Ig/JEUbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687119; c=relaxed/simple; bh=IoOQ/r0ZEvEc+eVi8klNZRLpo3c1DnP5rtosTnOlVsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XmVsKiFGSqJZmPqGZxg+ayxXGx8iZCpRtwkJnFnccoZaW3H90rrni5MW53m31lUT4vuu3SpSEPEJ5H2isz+k0S81A6XmaKvEnExkLXtC18mq+caEB7iSyc/EvMN9+oGNpTKHm7P4TMy3cjRNFCORhKvBbzm23ZnAKMoRKLyyuf0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca; spf=pass smtp.mailfrom=marek.ca; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b=aXMGFVlw; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marek.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b="aXMGFVlw" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7b10e0fadbcso176599785a.2 for ; Fri, 11 Oct 2024 15:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek.ca; s=google; t=1728687117; x=1729291917; darn=vger.kernel.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=hs8i3hJKqoLYVeCM0Bl+MtsW82Opz2gCCGdl6r+uwhk=; b=aXMGFVlwhTzLJI/Ke7f7CIJOANQLsKA3sbKwoRdL7FE3hZjjETaEChgXfct3cnEfg2 zWTGiw/5uWMYU0VfMdVc9RjPdvuGSdYnw4NiBLTq71oisPkwEBEwFb8+uImyY5S70GEn vn3bEgNtaNAxV0cz2aMpoaK+0OtbR9GxoOSf1ct0McWu79g6B7du76rB+ZOO/vD+da1V nRGEBSSb2CSn1R7TFwkawwhMR6/O6zz/+BX5cALCWPfipK51XyY329v2cgXOGYhuu71l OkNhWVlFZQP/X02h3sD2qgbOSeBVUbZ4+zzaYcnEPoVhFKQTp0bTAiSx3ojEtOyTTpt4 fINQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728687117; x=1729291917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hs8i3hJKqoLYVeCM0Bl+MtsW82Opz2gCCGdl6r+uwhk=; b=H4xTYXQB84wpq6HCbLOP6PL4GDrK51S+aKmnx4S+YxJoP2oTZNdCqX7G1wvqeNJLKG LbbeLp6ez1+Yg54HuuIJsqtKMQpRay6x1Cy8dduHn6GwmBQIBvoVMcVwGqgWh3h4FVzo Cj0JxBT1Ko303IY5tWhxB0oP3rQUbUjkMPr7FXi4l6OcV6SEqfZXgGDLFZk2EIIceHA8 8mTsc5+xfPt89z7v2OZzSTAhmurS4y5C490vAWMUn/IqXYMmQx5cKRV5opCsRUTg8whA es8dfXbB8GdQlHO7k9xYuxF3jOG4DUSgJnA9kYij361Xnt5k1OXqE8EipR3c5WRsO6wZ 929Q== X-Gm-Message-State: AOJu0Yx4jGb4TM2RBTfpwQYJBfkmMCDwdRwj25f1BJ7GhWTHPfBmd/1Y uZHS6ogodFJ8xmv2/3rA4tS25R4OfX06EYgW8v2zI9BHBb8COD4NyT5jbgKYowkKm3KOkdfy9wk 9T/U= X-Google-Smtp-Source: AGHT+IGfcKfQvAo494+ULnaOqrFgouyNS9uXORG9tlC9J5V/tWbUOfuk02kfyO6Euv6sX/AQWC9nhw== X-Received: by 2002:a05:620a:44c2:b0:7a9:a991:f6d7 with SMTP id af79cd13be357-7b11a3ad395mr522173485a.48.1728687117226; Fri, 11 Oct 2024 15:51:57 -0700 (PDT) Received: from localhost.localdomain (modemcable125.110-19-135.mc.videotron.ca. [135.19.110.125]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b1149893basm176499585a.134.2024.10.11.15.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 15:51:56 -0700 (PDT) From: Jonathan Marek To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check Date: Fri, 11 Oct 2024 18:48:01 -0400 Message-ID: <20241011224812.25763-2-jonathan@marek.ca> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20241011224812.25763-1-jonathan@marek.ca> References: <20241011224812.25763-1-jonathan@marek.ca> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 efi_convert_cmdline() always sets cmdline_size to at least 1 on success, so both the initialization to 0 and > 0 comparison are unecessary. Signed-off-by: Jonathan Marek --- drivers/firmware/efi/libstub/efi-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index 709ae2d41a632..f166614ef8432 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -112,7 +112,7 @@ static u32 get_supported_rt_services(void) efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr) { - int cmdline_size = 0; + int cmdline_size; efi_status_t status; char *cmdline; @@ -137,7 +137,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr) } } - if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && cmdline_size > 0) { + if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) { status = efi_parse_options(cmdline); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); From patchwork Fri Oct 11 22:48:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Marek X-Patchwork-Id: 834714 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD2D61E5022 for ; Fri, 11 Oct 2024 22:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687124; cv=none; b=o4bF3rUPnHjFpaTX+VukdYMIsNX8oSuuuqeAjLUjRLgIEWMyGm7MKJ/4bRZk0vqrUDVlvY2PoPyu2Pt/1m+CPM2z+6uTSo+GOMItwOugLFFUHkTEohUDdDik4NZtdxWgWFrwAHwSA+AOBT41i9Zx9U4dg3jcjPn4IoJcJ4siAyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728687124; c=relaxed/simple; bh=L29aB0pF4VVsMx4ptKUs75EonWW99gNI2hdo898WanY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WXn4OQyE0CjJYaTLo18jdA6pTfzQeLNEIG59ag9/dXW4/VCbltTr5tqWzxW49O2JbFKld9QPYOuYCNIAgdCMd7+F4pLNqiTtmV/LWyzi4zdF+WEYJ0ivgaijT5xV5yqTsXRu3lEfhUNrpaIQMYz3nPHFL5emgp5L6u3cvz4sk8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca; spf=pass smtp.mailfrom=marek.ca; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b=YVba/RoN; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marek.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marek.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marek.ca header.i=@marek.ca header.b="YVba/RoN" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7ae3e3db294so132280485a.2 for ; Fri, 11 Oct 2024 15:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek.ca; s=google; t=1728687121; x=1729291921; darn=vger.kernel.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=cZmCRqbf8/hzVSLIg4Tl+xwsidMruzMMIt+xIxBoTDA=; b=YVba/RoNIaMqVcTPMhYCmBbZgjIWjzE5faPl9nKjgtrhyKJijliY52oJBQaKe4kB6n wDNXB2oXL32fQZKTvz9hveBHQ+9oey5n9KtEgRCp7ov/kXjR6Rx5rJGHQ2hJ7fRmPtcD orrz+QvHcVRj/Pv4wYAzRFdX+l75QJ8VdH73r1hNtqPYaZP5NuLUmv1EN3aGxnHy5Drg nfklCo0GY0ZomEG5iQ6/zZAbVAHH4gebtcvhpz9vHkfnFZOiwZggud9c0ThP3t1rO78m 32bfx453S0EL2w2sdrRpeJNzb0Nh2huNmX9dfgmIyLQJl6c0y4V7U0fv11NpAr3nFDjD hpsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728687121; x=1729291921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cZmCRqbf8/hzVSLIg4Tl+xwsidMruzMMIt+xIxBoTDA=; b=psVPm7DKAxf7KnFwA1k3nbzTscbau7+P+dXw2oGpclZx7yvH+wo/G91QIeKO5EEUSd 7XiDwLIQPtdIKJA0xxm8atdTyqN9PLyKv4rOJDGTdhh2RLJl4Q+8P7jDGU9+v7WMVq+o dgZg5XJZduHJ1j6sWCyuCPW60pVxytxtcZr//D9toa/gFcYnId4z+g5mEMTl+Pgv3sTb QF4EWJKjmnxUAcxCkCXGuVqNnKgY0dGFVsmiKNERjm2d7e4uJUwwFT3OgyL6q//LQVES EgOfK5b+llpup3qP9iSuchIxj/V2GkFVNGoJdGcuRQoCAf/n7wDbqpN24YwiaHMdu3LO 0nLw== X-Gm-Message-State: AOJu0YzjSIdawj5hgXU/9PRHbdir+jZWD2dCBH6HB0QVelJxRAPWcVFH r4LkxOnDASEyic4ac0rdZb2RgwEiUc+vDpml3t/zPavzlGBb+OX+AaN/ItRPibq54S0ti3IKQxT 6ZCA= X-Google-Smtp-Source: AGHT+IFFEBaiVXnCVTSt27OreKF3NQPEnOZc6yhYLoOEoHBZA2WYWNsyqtjP28Tel3AafyYWXhhwuQ== X-Received: by 2002:a05:620a:29c3:b0:7b1:12e0:39ef with SMTP id af79cd13be357-7b11a361247mr626548785a.21.1728687120283; Fri, 11 Oct 2024 15:52:00 -0700 (PDT) Received: from localhost.localdomain (modemcable125.110-19-135.mc.videotron.ca. [135.19.110.125]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b1149893basm176499585a.134.2024.10.11.15.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 15:52:00 -0700 (PDT) From: Jonathan Marek To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] efi/libstub: consider CONFIG_CMDLINE for initrd= and dtb= options Date: Fri, 11 Oct 2024 18:48:02 -0400 Message-ID: <20241011224812.25763-3-jonathan@marek.ca> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20241011224812.25763-1-jonathan@marek.ca> References: <20241011224812.25763-1-jonathan@marek.ca> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace cmdline with CONFIG_CMDLINE when it should be used instead of load_options. In the EXTEND case, it may be necessary to combine both CONFIG_CMDLINE and load_options. In that case, keep the old behavior and print a warning about the incorrect behavior. Signed-off-by: Jonathan Marek --- drivers/firmware/efi/libstub/file.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c index d6a025df07dcf..2a69e2b3583d4 100644 --- a/drivers/firmware/efi/libstub/file.c +++ b/drivers/firmware/efi/libstub/file.c @@ -208,6 +208,18 @@ efi_status_t handle_cmdline_files(efi_loaded_image_t *image, if (IS_ENABLED(CONFIG_X86) && !efi_nochunk) efi_chunk_size = EFI_READ_CHUNK_SIZE; + if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || + IS_ENABLED(CONFIG_CMDLINE_FORCE) || + cmdline_len == 0) { + if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && cmdline_len > 0) { + /* both CONFIG_CMDLINE and load_options should be used */ + efi_warn("ignoring %ls from CONFIG_CMDLINE\n", optstr); + } else { + cmdline = L"" CONFIG_CMDLINE; + cmdline_len = ARRAY_SIZE(L"" CONFIG_CMDLINE) - 1; + } + } + alloc_addr = alloc_size = 0; do { struct finfo fi;