Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp339523rdb; Thu, 5 Oct 2023 07:29:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaMRf/i6Aa1gdtNQf5IRhMVv7bwYBGcL6swQb7noKfF7nTG3Et+EQgZFmxX5kT7Ep0wHX7 X-Received: by 2002:a05:6a21:71c1:b0:14c:d5d8:9fed with SMTP id ay1-20020a056a2171c100b0014cd5d89fedmr5312446pzc.54.1696516191221; Thu, 05 Oct 2023 07:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516191; cv=none; d=google.com; s=arc-20160816; b=yIohlQup9lQlagTUKXMg64cEIZ/6uX58kBCNtaSr69xvHL2j6RgEKUhZlv6EjlrMeM pE/2H3UkNREjQjUSQx9yhV4DHejTSRjBjrCKOrJW/ievJE4Sn3ozfIrcUXu2V9w7HJT3 aWU05sQfMYRikPgJzv+ceZuywujtK2D4BjNr4Mo57VekNwHH+0NCNyaffzsO+sGr//n/ +ZPYFmpvZKSQJ1/0iWzCjFsOhCjFsQsjQpmBobYCdpKnLQZkjQIyyDfptn385MIvHNhj C86ewbpQfhcHmbJFNDtTTmr1F2zmoe+mgdWv9H8i2/agpKBNN0bke1R1dZQ+XKp3bOi3 pMrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AtJcLwhf2nYC+Oq4sBteaSFSpLY2A4lFyIo/1xW75ME=; fh=+pEOKK4xluj0DFGnswAzUpS/5uIsoOZyK/cWca0wJEs=; b=mkzOJQbO3w1+HivdSjLIUjYtkGto7Iqe1tJ5CkoKcNW28H9NYososZSuRT+2/1wiL+ hcrjx/ltiaXObCmU3pCx79Td2YELtbsVv7Cznw+Qmz2o5kRKBLk0ynx6u4MT+aGow9p9 qLM1Odc3S2hlV8xP9WVql1jtAul1SdCwX5wIafpBMXEgGGnNmBynWxD1w74W4+GLGZmA 0qx78QVoGHYHj+g5kQfbuoUZx041loqOQ483y1T/zFK1t05ESOw2pSPZf47z1Lkaa5RH +nMfvrIXK/gwCjTGk6krOQphhQQZ6ptWUQH17DXUnSRhTs1/RuEWPQxUFxpNB158RaHj WVdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="fH6mc/wp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fd39-20020a056a002ea700b00690f9e835d8si1556238pfb.132.2023.10.05.07.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:29:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="fH6mc/wp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 625BE832DCCD; Thu, 5 Oct 2023 07:29:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233778AbjJEO1g (ORCPT + 99 others); Thu, 5 Oct 2023 10:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233715AbjJEOZS (ORCPT ); Thu, 5 Oct 2023 10:25:18 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFC8C28112; Thu, 5 Oct 2023 06:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696513496; x=1728049496; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=aRAusKFOHxTcivReObj21Yhl56rRDgruWVPVeRzCnw8=; b=fH6mc/wpYzsAQCIfNimwZDO6ue3m4KHSpSNvoe7lt7S8G2drO2fFTu1p C8kY5oi8l/uJRq960pW+CCMaBo7kFmY7mhLXBRX69OV8L0LQHSvwsMVkN TjStILJKmA3BBt0Mx0lbhYQd9hAQ7vjvGG+B+t+qnD4if2tK3l7fenkge f0tsNX8wpMWYE9xWqJiBKgBEhztrgZpkJZpYM4xyrrNM+zMqHoG9+itQg EloQ8LlD8xumAbgRbB5UaSEeJzMHyOIogcZArl2imWp6y28CrTBD7I+wq PLir+AgQpX4j/uVIp6ZYGPYuqpS42LEcdF6SUM0h6vozsfDVJNm0L3koO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="447633641" X-IronPort-AV: E=Sophos;i="6.03,202,1694761200"; d="scan'208";a="447633641" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 02:08:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="867817764" X-IronPort-AV: E=Sophos;i="6.03,202,1694761200"; d="scan'208";a="867817764" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 02:08:28 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qoKLJ-00000002z0x-2FGX; Thu, 05 Oct 2023 12:08:25 +0300 Date: Thu, 5 Oct 2023 12:08:25 +0300 From: Andy Shevchenko To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Dhruva Gole , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH] serial: 8250: Check for valid console index Message-ID: References: <20231004085511.42645-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004085511.42645-1-tony@atomide.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:29:39 -0700 (PDT) On Wed, Oct 04, 2023 at 11:55:10AM +0300, Tony Lindgren wrote: > Let's not allow negative numbers for console index. ... > - if (co->index >= UART_NR) > + if (co->index < 0 || co->index >= UART_NR) > co->index = 0; in_range() ? -- With Best Regards, Andy Shevchenko