From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0B29395D8F for ; Tue, 7 Jul 2026 06:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783407580; cv=none; b=HEd23K0jVeKobAinGWSmW6zPod1ozjKOEM4BUzw1OgUmn7XiFJMWiDiemgyIuNocT5WD6rNtfPHruYiZmH8B0e8Kdl9qvesBLbODuo7ar/kKV/rhMqinx9uNsOInz7kDdU8le0bKnw1oEY04Gb2n6f9GmDW5EKSySYRWNpTPaP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783407580; c=relaxed/simple; bh=vIxIQqpTIhDDpxaWL/KxlpymPgYqFIm+IIELYKWx95k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TCn96W3McH6AOdSvbDCsT9XXHJyAmyky4fBsea+g72cz4e0HsiE9optfBB2iTvlfkGGvXWU4Zg7E3W7MJPuU6Dzisssg+oTLjvi/J1VJFP8Sp5Upbey+hdBZScg/JbXMWnTd/SITL1uKHhluCi7BInuEOj2FgrOcAA8SpeQsi/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VrFm2b+0; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VrFm2b+0" Date: Tue, 7 Jul 2026 08:59:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783407567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Z3mZO7NTFKwd7aHo5QwYs5BUY5MkVsANllXsSCa2qZE=; b=VrFm2b+0l3DoRENXcu2oq2+VoUSPORFXWwBWSpMDShvNzdUzeQux2FVSRMbWyi7PZesnE6 icAHh1s7Y8EC9bFxgk5HBn+5/6R8DbllGINY5Ep+Q8u3x1nqo3F9hwlX7k5FYRHJPoIweP J25P0up1nNwqJCdsByOUKUsimX69ZmA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chao Fan Cc: stable@vger.kernel.org, Borislav Petkov , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] x86/boot: Reject overlong acpi_rsdp= values Message-ID: References: <20260621170010.276591-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260621170010.276591-2-thorsten.blum@linux.dev> X-Migadu-Flow: FLOW_OUT On Sun, Jun 21, 2026 at 07:00:10PM +0200, Thorsten Blum wrote: > cmdline_find_option() returns the full length of the acpi_rsdp= value > even if it is truncated. However, get_cmdline_acpi_rsdp() only checks > whether acpi_rsdp= is present and does not reject overlong values that > do not fit in the buffer. > > Reject overlong values and warn to prevent boot_kstrtoul() from parsing > a truncated value and thus from silently using the wrong RSDP address. > > Fixes: 3c98e71b42a7 ("x86/boot: Add "acpi_rsdp=" early parsing") > Cc: stable@vger.kernel.org > Signed-off-by: Thorsten Blum > --- > Changes in v3: > - Drop the newline as warn() already prints newlines around the message > - v2: https://lore.kernel.org/r/20260621131836.175468-2-thorsten.blum@linux.dev/ > > Changes in v2: > - Warn on overlong acpi_rsdp= values (Boris) > - v1: https://lore.kernel.org/r/20260617130417.36651-4-thorsten.blum@linux.dev/ > --- > arch/x86/boot/compressed/acpi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c > index f196b1d1ddf8..aed27604c11f 100644 > --- a/arch/x86/boot/compressed/acpi.c > +++ b/arch/x86/boot/compressed/acpi.c > @@ -184,10 +184,15 @@ static unsigned long get_cmdline_acpi_rsdp(void) > char val[MAX_ADDR_LEN] = { }; > int ret; > > - ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN); > + ret = cmdline_find_option("acpi_rsdp", val, sizeof(val)); > if (ret < 0) > return 0; > > + if (ret >= sizeof(val)) { > + warn("acpi_rsdp= value too long; ignoring"); > + return 0; > + } > + > if (boot_kstrtoul(val, 16, &addr)) > return 0; > #endif Hi Boris, Could you please take another look at this when you get a chance? Thanks, Thorsten