From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 1A6DB46AF1E for ; Fri, 15 May 2026 10:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778842078; cv=none; b=eGRYBG0SyatCvEkkewaEHP5yQWPlGDENv6sty4TvJ8oWa32txjQTxxsfysPqKTzmZWtTLHaeW147YVZyHKpkyKAlE6raqKCb/MnIZ3TomFytOWDM8mc9wD00VgNPOwqAyGGr/LDBPqZN4JW7AOy61DUSPzj+xierMWPArqnxd6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778842078; c=relaxed/simple; bh=KNBnbsugoqWvA9uwMaM0naABf0whmQJaIylfKSnTIP4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=C/0j1XmuDcXPeb1N2sQpXx3bE+1CyiWtVZv2paWh2fFs6V3pDTrNH8xaKey90v74y6S5xPQVre4PzkcKyGVcBqhCo8le9LUyhP/pLa7q84Sxjxuh09oshnWwAMPssClEmhQ1/TN/JAUIwKWyZAoNqJT/T8qYoGZ0HOOt9BeT/z4= 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=k4JtRdAF; arc=none smtp.client-ip=91.218.175.177 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="k4JtRdAF" Date: Fri, 15 May 2026 12:47:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1778842074; 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=omvpmLN1rXnpPLDRc8UHC+Xh40996iyFosSqAaUo5JE=; b=k4JtRdAFFlMYTMbaMBnT99Utls4fW5ljnI4smCheCj+vH+p7eGrd126J83RO+o/x+1nRge NIXC0Ahez+6I7y6Ywx6tqzj9kJ4xBE0FaTFdClCcvgXpkasyBs5EiDtfeRQX/H91mx2eir Auubz58u6Or5RVRTjkanYiJ8ZYYzyFY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Dave Hansen Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND 1/2] x86/boot: validate earlyprintk= baud rate Message-ID: References: <20260513164844.449910-4-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: X-Migadu-Flow: FLOW_OUT Hi Dave, On Wed, May 13, 2026 at 10:05:30AM -0700, Dave Hansen wrote: > > Values greater than BASE_BAUD would produce divisor 0, and > > baud 1 would produce divisor BASE_BAUD, which exceeds 16 bits. > > My inclination would be to leave this code as simple as possible. If > users screw up a baud rate, they'll get no output and have to go fix it. > > Why does this need to be robust against bad user input? OK, I guess any baud rate that doesn't crash or hang the system is acceptable. Let's drop patch 1/2 then and I'll resend patch 2/2 as a standalone patch. I've also sent another patch yesterday that prevents the same division by zero and thus early boot hang in early_serial_init() when using console=uart8250: https://lore.kernel.org/lkml/20260514143014.516303-3-thorsten.blum@linux.dev/ Thanks, Thorsten