From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 A38DD30DD11 for ; Thu, 18 Jun 2026 15:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781795038; cv=none; b=Pnj67RvE8lnWY2U4zyyncAJKlnp2YPrOhHIce40EDWTneA9bVFsDuVgwSlZXiCuqmt5HlRRvCOtJXbqxFLLeRs6JB8JCHEH7FLbiZsI+FsJc5XSDn7029V4ZE2kR9vQb208oaWFe7ctI+M2BryfQixWySFK2fK9r3hOWIRDwwjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781795038; c=relaxed/simple; bh=JBaS2Q04aweXvZXdinCzXRPAu6r6BImK2OJJhyEx5oM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IvrkQFVI1EkDsid8Qz1rHfei33xpdvyIscJubND4Nh9AX9n1sFti8yI9xdWqOYcN2fTc1Hm2P3rG5t93ILFdbaTYTmrnHQkVM+OArRZ04OiSaTjvsoXu7gLm+gCwhio0/bxl/SHY9eWsBritn4x76z6pMMUMmDJLEpPYlvcnWK8= 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=fhWNkd4X; arc=none smtp.client-ip=91.218.175.182 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="fhWNkd4X" Date: Thu, 18 Jun 2026 17:03:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781795034; 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=MxMSge6U8hvyu9/832/EnznJ2DrtkqE2xb+8/H+YGPA=; b=fhWNkd4X/h/ypJbhfis2IstvBh8uI7J514JuTfWcWek6GsuH0I+raKAvA2vLvAhURqvpNc YG0eorUUqjC8FfwhVHFsd1IWW3xCzPRB8Ltom+1Eg1Dy3cg8bwsOiwDOuJq7Q5bE4H74dB WHJBF1G1B4aykGvqKxODAOEyW+cREUk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chao Fan , stable@vger.kernel.org, Borislav Petkov , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/boot: Reject truncated acpi_rsdp= values Message-ID: References: <20260617130417.36651-4-thorsten.blum@linux.dev> <20260618045400.GCajN56AKctO0qB-sF@fat_crate.local> 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: <20260618045400.GCajN56AKctO0qB-sF@fat_crate.local> X-Migadu-Flow: FLOW_OUT On Wed, Jun 17, 2026 at 09:54:00PM -0700, Borislav Petkov wrote: > On Wed, Jun 17, 2026 at 03:04:18PM +0200, Thorsten Blum wrote: > > cmdline_find_option() returns the full length of the argument value even > > if it is truncated. However, get_cmdline_acpi_rsdp() only checks whether > > acpi_rsdp= is present and does not reject truncated values that do not > > fit in the buffer. > > > > Reject truncated values early to prevent boot_kstrtoul() from parsing a > > partial value and thus from silently using the wrong RSDP address. > > And? > > If it uses the wrong address, it'll crash'n'burn later. As it should be. The problem is that we don't necessarily use the user-supplied address. get_cmdline_acpi_rsdp() can truncate it into a different, parseable address and use that instead. That might not crash at all. We already return 0 and fail gracefully when boot_kstrtoul() cannot parse the value; this does the same when cmdline_find_option() reports the value was truncated because it didn't fit the buffer.