From nobody Mon Dec 1 22:03:46 2025 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 514A730C371 for ; Thu, 27 Nov 2025 19:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764272661; cv=none; b=scFEw+WaYVIVR+n/8hqoCrmHbq4eaJKKovaLgvtLMQ5TCAoIo14SZqf6x+QDsioJRISfkylk8GGO/ekdQA+3wNEb86vvNO7YjGeU4mfHUUMWO2Z5b5UGdBDqqtzdJQqQz5aVasXk/2ps4mcEOmFv5o5iV2bd91RgWhurk/0W46w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764272661; c=relaxed/simple; bh=Ta8LuCxkh2FuuVwoXWD+fRn6VkjM4zARPHkT3ixpACw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jLpU6MlLkfG99gtVy/aMiueKNBvGqwobfxCSgLHWCIRKHDE5yTO/WcVEVP4Pi9kcMiPd9vKWBrmawNl6GV/eBOCwkqJqFyCyhAnZHVg8OjWilt+fF3I4DxGCT2JZ9+nKr/WzlgjeHNpB6bZCY7epvznnDoXeJA6l/DFHMiVc3zo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b=O3CRCiZY; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="O3CRCiZY" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2980d9b7df5so13742225ad.3 for ; Thu, 27 Nov 2025 11:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1764272660; x=1764877460; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=EabyV1fjM4q3lug1LQUAw4UVciQEkTxWDMJxhSI2/QQ=; b=O3CRCiZYn2khbphbc3MCh+HWWdI24Rm2d4v5tfljPxzCSo8mI085u0BL0wxr6Rs2Gf qbZxc9IY1ZGTGWq5neLsEPhZDk/QPg/syYutdrpYEN94zAnL1w0h9+1bnenrpe2jA08C JPcwrpjKI/+qK5h3VuGw/L81iESp1Krkp6zTo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764272660; x=1764877460; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EabyV1fjM4q3lug1LQUAw4UVciQEkTxWDMJxhSI2/QQ=; b=PmW6eFPbqL7RkKdmFoO0Jx/CaB5SQApXYV6HzogbEIirhvxlfcqKSX1SX4/J3qmotU DjGHJ+rtoh8JWrF5Y2mbbJISsNB5zQyHnslAtv4m/v5mIdCRZIPFxv6aPnSyzHGXj203 6uu3XaGbENpJC7sVLMG4NhNAZB9UdI/80/DBvxLwXLH11o5CTbzf3WNydIIc5mfyMSsO N1xp58VhQn5U1BgkDfG74hyIHHa8pNVTZs5dOkUGb4IB5jXPePJc+FsP0pMSepsPf+2R 3GCnqTfjieqkJi/He4GwS9UsR/jQGmyQgrh6qdzDdUA+mIL+fLX9nR4h8jGvA+diDvvD F6nA== X-Gm-Message-State: AOJu0YzDiBVU/NoRhcP+uh24ym8vLN2EGNCpIJXY7VnWe7GOlbyllqie VL5ZxEQOWT80OAErB9GcZkw6UwzVMLbM7gsLAC4SGRbF94oz9KPFd5NyWqV/574ZxOU= X-Gm-Gg: ASbGncsW7oQysOCjhcZ8B9ofzc/e7dVMUzd36jNQaR1Hqie32EMl2CDpPFSAipdm7UB xzm1vOA9EELt08BDspPLq6P2rivdsHkvdIb0N7UMMBuMTtd6Oy7kv2sFA2/7C488fh34GKtvUyF VA7no9fk6PXv6Hyc1GyI+prqnrL5VbpyegUA+7BVKF+NQpjNYAyC40eDad1VtNXX7hzNPB72IlG wzP2wGCt/IhNKLYq9WjMxSX8u2ExG1sBhrqqk+NIJtjV/+mDiFFJzmSAKdGoMcDKmwyl+Wdlklc b1z8ZG4G2+BpYonP1TA/Arc5rOV3Ty+PW1uOI7VMfpDK37iYxQO08vHzGeK4RbMG5czFqyLgGlJ O4VzGBe9cInNqu4y6DXoQ0QNWRau8h9tJ8TRPvEF3pfJGIxeNfZoEXt28/Hk/iCnkpXo87RLv6b 7NobPn2sMI X-Google-Smtp-Source: AGHT+IGYZ7QylmyrE9vopXtADBWVBISyZoceLTO5mFYOc0kBrWK4iqd2QD8NkPQRQ4cDGbsLzpk4RQ== X-Received: by 2002:a17:902:ce0a:b0:295:551b:4654 with SMTP id d9443c01a7336-29b6bece6c4mr278642795ad.23.1764272659679; Thu, 27 Nov 2025 11:44:19 -0800 (PST) Received: from localhost ([116.86.198.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb27532sm24800305ad.57.2025.11.27.11.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 11:44:19 -0800 (PST) Date: Fri, 28 Nov 2025 03:44:17 +0800 From: Chris Down To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Sergey Senozhatsky , Steven Rostedt , John Ogness , Geert Uytterhoeven , Tony Lindgren , kernel-team@fb.com Subject: [PATCH v8 16/21] printk: Constrain hardware-addressed console checks to name position Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.15 (2b349c5e) (2025-10-02) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 7640f1a44eba ("printk: Add match_devname_and_update_preferred_console()") adds support for DEVNAME:n:n style console=3D registration. It determines whether or not this is a hardware-addressed console by looking at whether the console=3D string has a colon in it. However, this interferes with loglevel:n and potentially other future named options, which also make use of the character. In order to avoid this, only search positions before options. Reviewed-by: Petr Mladek Reviewed-by: Tony Lindgren Signed-off-by: Chris Down --- kernel/printk/printk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 605e0811cfc6..32ea9b69f515 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2813,6 +2813,7 @@ static int __init console_setup(char *str) char *devname =3D NULL; char *options; char *s; + char *first_delim; int idx; =20 /* @@ -2828,8 +2829,13 @@ static int __init console_setup(char *str) if (_braille_console_setup(&str, &brl_options)) return 1; =20 - /* For a DEVNAME:0.0 style console the character device is unknown early = */ - if (strchr(str, ':')) + /* + * For a DEVNAME:0.0 style console the character device is unknown + * early. We must restrict this to before any comma to avoid interfering + * with named options, like "loglevel". + */ + first_delim =3D strpbrk(str, ":,"); + if (first_delim && *first_delim =3D=3D ':') devname =3D buf; else ttyname =3D buf; --=20 2.51.2