Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp94490rdg; Wed, 11 Oct 2023 22:54:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMH2dvfCXRaPMjieE7aL3uYTTgAyIn4fAbmLovMkJfqr+nyijP4U49h+l2F0u/FRZBgD6u X-Received: by 2002:aca:1c18:0:b0:3ae:5c89:dcc2 with SMTP id c24-20020aca1c18000000b003ae5c89dcc2mr25277301oic.34.1697090051954; Wed, 11 Oct 2023 22:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697090051; cv=none; d=google.com; s=arc-20160816; b=nRChwnCMve1SMeyOU9TYYYgzSMlSW32bI3RXGJPNTp6fISHNr+2yfcGCdh3YlljdMU 6UU7IEHflGShfU+M14lWf9eUUZ05spTdv6BxLtWRwJRR4uLWVGdSKT+W4nGDrKI7i9Nl jXpUZ8QMbMZZSUifYBQl0bi1rxU502iyTWamjQMnZLYQzAhckH3fv4c0qS1gm/C3nnTj V7yFp2JvIMXA9yz9Y+5h2horZEW0vlxLpluZUICNKsoKZ7v65OptHA8F7fLbwwebl1Vm lI4UPOoVbUz/wSMrzf/2NfWik69tDHVfagK4ZwDjG3insF58rYgkfwXBejIogkOfvDsf +9uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=+rwWdfmAVPF9A3srvcRjvyBAhJChOXQkEzSGyWGu3TQ=; fh=R8sZ5wKsRHQHXmV3PM862Zd7+pQ86Au1tPZ3WN4CZIs=; b=xtlC4vu5Z6ot5DGosv3cUgpfCYhjVB5QmLtEYbvJ9TurzwlFLEXwqHQJwkfDCoW25u VCc+RirTg8JYgv0deqyk3pKLp8/Jmsvs1e1n3mOTpO5eec+oUKgFBldjOOSPg7BiKvvc sPhaAwKpzuJzQKp7fCdPMgBUPK5cGsg09IB6GmpHZkAtGJBD1zk72fma2PuP/uY/y5Rl 9EC6U2ajNv6SNCx1LtCMGawpGtl70EycS945BFHmZCZhbueiYHPhmizbhNuhJC7CG1UP W46CwGHus6/bg3r7NTTt5KshVtwVNRxoRMSUyzlXBQzqnkBG6C+NfgB/T/83Kp4okGu+ 4Rfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d129-20020a633687000000b00588e13f4cc8si1424312pga.519.2023.10.11.22.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 22:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9B86E809FA64; Wed, 11 Oct 2023 22:54:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235197AbjJLFyB (ORCPT + 99 others); Thu, 12 Oct 2023 01:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233976AbjJLFx7 (ORCPT ); Thu, 12 Oct 2023 01:53:59 -0400 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68176C0 for ; Wed, 11 Oct 2023 22:53:58 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-9b2cee55056so95309666b.3 for ; Wed, 11 Oct 2023 22:53:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697090037; x=1697694837; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+rwWdfmAVPF9A3srvcRjvyBAhJChOXQkEzSGyWGu3TQ=; b=ZWkJs7WcjQQQktDaVFEe/eaFwJk4WCwtFVNZ1jUHIyps+QO/yLIsnOAMZ+k8TeQJ55 j+wk7j6Nl6qV7/GCpfnaDeab0KkpfDnWPCxBRxxD8d9mwkCLO2BaYoblQsOv+0UrskmY CmK14hwN1WffCYyhRfIf0ycWvRZ45UflEfQuKtuKlZCIcJCN9/wy32rSU1imHU7cw319 orCH0m0p9j9syc6K9L8vUj9VnA632Z0XkwUMepy1amiUcRs3wa5WG2r3eyLBbYZ2Xo3/ z2gC3v1jJ9i31oINOk0YoHwgpHLOz748W9rMa6itVBneKA5pl81PFA5opymi0yn5VCdy iTLw== X-Gm-Message-State: AOJu0YyUHbFZKquh4sLyeQdGEsKo1BFkag2Gkaq6GrsMGTNKHRHl7nAH VAOKJA9bdRXkQ61TyyTbhMQ= X-Received: by 2002:a17:906:32d5:b0:9ae:6388:e09b with SMTP id k21-20020a17090632d500b009ae6388e09bmr21411116ejk.40.1697090036626; Wed, 11 Oct 2023 22:53:56 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id gh18-20020a170906e09200b009786c8249d6sm10779257ejb.175.2023.10.11.22.53.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Oct 2023 22:53:55 -0700 (PDT) Message-ID: <18944d40-321a-46b2-b97c-a8c3f98daccd@kernel.org> Date: Thu, 12 Oct 2023 07:53:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] printk: Check valid console index for preferred console Content-Language: en-US To: Tony Lindgren , Greg Kroah-Hartman , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org References: <20231011074330.14487-1-tony@atomide.com> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwlvuwyfo5mh7w5iMfnZE+vHFwp/wARAQAB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mX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20231011074330.14487-1-tony@atomide.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 22:54:09 -0700 (PDT) On 11. 10. 23, 9:43, Tony Lindgren wrote: > Let's check for valid console index values to avoid bogus console index > numbers from kernel command line. While struct console uses short for > index, and negative index values are used by some device drivers, we do > not want to allow negative values for preferred console. > > Let's change the idx to short to match struct console, and return an error > on negative values. And let's also constify idx while at it. > > Signed-off-by: Tony Lindgren ... > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2404,12 +2404,19 @@ static void set_user_specified(struct console_cmdline *c, bool user_specified) > console_set_on_cmdline = 1; > } > > -static int __add_preferred_console(char *name, int idx, char *options, > +static int __add_preferred_console(const char *name, const short idx, char *options, This "const char *name" change is somehow not related to 1/2, but to 2/2, I suppose. thanks, -- js suse labs