From nobody Tue Dec 2 02:41:46 2025 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.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 B66322E1747 for ; Tue, 18 Nov 2025 19:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763492856; cv=none; b=YWPw6VDByTSM2Ysf7RAg8CU+/XG/yTQSZUNuQr1RU2+tCYAMZFvbE1ux2/84H2pf6NpJ2rcw9CXAMlzzNxbKtGF763m1si76ToNXz6DeBgPhbaDcTWjW6+adzGE5uoB4hpm360sdq3ydhxpc9+CjXSpH2KjzK5SKRBHOtvdm8+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763492856; c=relaxed/simple; bh=zv1xmi1xOTFtCeM+OyGTFFLuTPMVGxxPDKrfjbolSn8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XkaYGykQkeEEjn3ANtFvxiNx2VNovs+yncT6co5T/catQ8jY0fDM8uye8uWob9xH2e27Dq/WOQ5H9n022HMxT3MhVgYrsaHlcwCZcM9eKiFzzGkCrw/+HLf34C7u5KpYkVdtxU8gaV2CYRFo66TqKAw6sx+yWfqgGXE3ApRDyWo= 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=lAsF3nJX; arc=none smtp.client-ip=209.85.210.179 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="lAsF3nJX" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-7bf0ad0cb87so2799607b3a.2 for ; Tue, 18 Nov 2025 11:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1763492854; x=1764097654; 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=LGijqZX+hQqk0oTXy8PNUWIkVrEqhd8XSfK1D4tIzhs=; b=lAsF3nJX5IAXnWYlrDPBwnBwxbGBjxcvanv51Q6zr6tG5qCxjAbT5G7eTdr4Rg9Z80 O40Hvldtif2Re73VBOdMG7fZxpVo2OmbE4rRt1pJvkQ+O21imcdsh9box3ZFBoOT6cET jASpOT8kO8GzuHi/iEn9IkykM6bfh2wyFbO2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763492854; x=1764097654; 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=LGijqZX+hQqk0oTXy8PNUWIkVrEqhd8XSfK1D4tIzhs=; b=ZH9v97fu/oXqKZ57pjv45XarZfpHTCc7/18FaIbzl2a9Ggy/yxF7OtaDa4MiBGl87i f85H10RCsdJ/R4nI/q/4PHlBUeet/Fm81NN4u99H9l7UCTi/3O0MZeUAbfBUSQAl6ysn YK1OmDgFBBrWDdMbxwQHTfM2NH9P2NOASQ4rykw9+Uat9WGhvLn2ncD37ypSsruZUHzP DfJYg/cd0MyAzmhvkJI/f3JRDOZ5ydlYp1Cz8GnxGzoQz/3MU1ecMx9RQCN/QxxkGmKF dGr8moKeC33wTEd0BmGoxTIYm1IUvbesGSRfXmPdpaGBh5TadLxwTgTH+qgUkiddEWZW NMjg== X-Gm-Message-State: AOJu0YwiRMIX6nliIQ9WvHfsxIyEYAwbpJvtcZSH//5Cl+b6Iw9G9Gx8 LVSNRVFv/36wADGSrHgb2FCPqsK6Sp4JqjyQDDQs7x+FZF13zmz3DUnzpJYHEReDbEk= X-Gm-Gg: ASbGncuyPZYLOvGLOiP1aGtkYfcskOIrNPnHHWlnKS45SFlz/t7ecTTALctsV1vn8nB lDAkR530fXlruBnyJocf6v/6wrZlv/zRjoACOxu4IRo2RdsWcdcHiVKiYh1LPpY4d/nRF82OAM1 mfecXhuAJ0q7gPCla60aPyqscq9FhsIvaV9YO7GRV7Gvt5dLazXo/Rbu5IvWgJAudQvp5egGWO2 n6CeDywV/waJSg4D8DNAQSCztTB0Rap3DH2BHmFktAsq0x3MlE2JnPZIT2uRthfogWThXt09B/N 3bidPaTNEHls/AVbRGJVrQUP3/ZwK0Gj31ANQwma+J4kkIztYUczKTH8SXjD90J04ym1KV/mCHh rmz0Wt7uORu4IIfRxDtU9qz/izvZMoJC7Xy0jFyXj0BIBuho1S/vjA+FVijl8MC3KuVLjLkZjSZ i688pq4jI/ X-Google-Smtp-Source: AGHT+IGo80tGCBwctehbgu/DKW4CR9Cq+zOaHlhC9Gzy2SOezOgY2koi1dCCpbp3Mw406AOGTa2A8g== X-Received: by 2002:a05:6a21:9988:b0:35e:2a82:fdf4 with SMTP id adf61e73a8af0-35e2a830598mr14014854637.59.1763492854099; Tue, 18 Nov 2025 11:07:34 -0800 (PST) Received: from localhost ([116.86.198.140]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7bba051085esm12776488b3a.42.2025.11.18.11.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 11:07:33 -0800 (PST) Date: Wed, 19 Nov 2025 03:07:31 +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 v7 08/13] 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 62114aa61999..fb54101133d2 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2733,6 +2733,7 @@ static int __init console_setup(char *str) char *devname =3D NULL; char *options; char *s; + char *first_delim; int idx; =20 /* @@ -2748,8 +2749,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