Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp635957lqb; Wed, 17 Apr 2024 06:56:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwYjrO8AxloK2C+f1qVg9DGcdKdYH5dxAeuCJ8s1OpqCRfKZoESoDNyMZ5LuO/8+ow2uit6BX1GxmsG+crOfiNBx59U7Cm+TFbhmi/Pg== X-Google-Smtp-Source: AGHT+IG2vP0HHXpG0QlOg7wg65YQhfg1qxYMer2ifOScO6c28JwnM41wJ8JXMAgRgdPBV8nuvDoD X-Received: by 2002:a17:902:c40a:b0:1e8:1488:2f9a with SMTP id k10-20020a170902c40a00b001e814882f9amr3510785plk.30.1713362167939; Wed, 17 Apr 2024 06:56:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713362167; cv=pass; d=google.com; s=arc-20160816; b=c3tUIFZC3ByxLhnv28Pt9OVSIVsxVtRfKgd7HZTgsnAxKPJ9C1gGYl/C0FOS6eFhel bg+7Ko+aTtpep3XFC+1X1DJDaY73EktkOa96Mp2SW1Z/FUdihbLAb5bF4gl6V8KTI4Xv uhffH3e+bKiWPp+2YSUa8VRBEF+i6BNIlkBdVYIMX4lpVcgcWQGUsamOrUR1DG40en+e vNaEbKGzO/udnNX9jBDKIgleScQldtj6CgxQkgqWSs6L8oP+7iy3QjHDNZ6iIb7/xHB5 EE88UuaYRTcYabRJ6qxnhNnHnQF3DVZ2Ua3eeyip20PekaMM8cjrUt3ycfDXFUPNNTl5 jtmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Gg6DsZtavNbF4AaR9QA9AS0mzCJNN6YL0yObdCvnqH8=; fh=WkkzK+CBKtEeOgyFwsMpc44oFba90CuMF7VXS4nAIdI=; b=t5Lopgx3uOjklBpeHSZw9a0ytjknfRODO+O37MycP/Pb2u3eobv0zo79bPjEAbu6pf 5R8NGcqqwAL1d5ASwNEN1eQUbfElQPfs25RkKk9mIgl1MCoBkxl46/3d9lDJ7u9dViAg STNabasp43TPMfEU4GHDDf5XOhf3u0IBdre9NTvuidcZYn1+VFTe8HtNCACebKvhdgKF t+rHk5taztodjjtZM5mkQVemK+PQBht/sKwnqcZXbM+DBkK9h+2oB1tL4BHYm9wUAIB3 zq0ZCruqJ7A92OzyqndwagEFQG0K5yl6AcuDkbJJuHW3TbFfIVaOZdYKP+rU0oE5f6Je 1CVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YcUBcPyh; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-148585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i10-20020a170902cf0a00b001e0fe7619b6si11958661plg.480.2024.04.17.06.56.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:56:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YcUBcPyh; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-148585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 51C12B2523E for ; Wed, 17 Apr 2024 13:33:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3069E13FD87; Wed, 17 Apr 2024 13:31:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YcUBcPyh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 524EA13BAFB; Wed, 17 Apr 2024 13:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360660; cv=none; b=qXHId1gUK8u3kW3k5isRNH6w6CEgCUcEuHJPZ2f/5otM77tKmMX3upzcES4KJDHhcl1GHrjh/Rj6x+VptnjgSjbzG+X/UgfXEYWzMAZ7CXY+aM/WqDs4L55ztnn+MiKr4RMqqkuLMr+wa0zsU3FHnjLaotbRchbDuWjW+7bC6xU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360660; c=relaxed/simple; bh=WiX3CxJvr+ydE+u5l5Y9ymhgWQ140YrTzOQJMdduWF4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q1asVjBFNmJt4g7r1mRnoAriOF+TJ6m9e20f1sYu4kcjxx3x02FZH7ps1iJ5YITSavvCBuYU1IS0Aye4pi2AB66miXfauzKR4iD23EW1egci0cyMk15ZgrBFRI31qUJbfoAebAHxKzFIiN7e01N8FrUIeYi3IR/iipRZVW+Yinw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YcUBcPyh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F094C3277B; Wed, 17 Apr 2024 13:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713360659; bh=WiX3CxJvr+ydE+u5l5Y9ymhgWQ140YrTzOQJMdduWF4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YcUBcPyhI4Q5bgipJU27blJaZaL+Tj03m1UM0mrdMcEtndQ5cT6a6OrAqe7vZQhAB E8ZH0w6wvWCkLhcUpDV7WM4ymn1edQrPKuZ+p5Jc5JGYkWXaI89xchjJsANpVBaU+f PDCZS//twwiKmTlXnCYPNiiehyCd0pM1doVMIVZM= Date: Wed, 17 Apr 2024 15:30:56 +0200 From: Greg Kroah-Hartman To: Parker Newman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Parker Newman Subject: Re: [PATCH v3 8/8] serial: exar: fix: fix crash during shutdown if setup fails Message-ID: <2024041730-abstain-dynamite-054a@gregkh> References: <1a21fffe403d7181e0404db1ed92140c306f97b7.1713270624.git.pnewman@connecttech.com> <2024041746-galvanize-satchel-09a4@gregkh> <20240417082413.70397ccf@SWDEV2.connecttech.local> 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: <20240417082413.70397ccf@SWDEV2.connecttech.local> On Wed, Apr 17, 2024 at 08:24:13AM -0400, Parker Newman wrote: > On Wed, 17 Apr 2024 13:19:07 +0200 > Greg Kroah-Hartman wrote: > > > On Tue, Apr 16, 2024 at 08:55:35AM -0400, Parker Newman wrote: > > > From: Parker Newman > > > > > > If a port fails to register with serial8250_register_8250_port() the > > > kernel can crash when shutting down or module removal. > > > > > > This is because "priv->line[i]" will be set to a negative error code > > > and in the exar_pci_remove() function serial8250_unregister_port() is > > > called without checking if the "priv->line[i]" value is valid. > > > > > > Signed-off-by: Parker Newman > > > --- > > > drivers/tty/serial/8250/8250_exar.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c > > > index 501b9f3e9c89..f5a395ed69d1 100644 > > > --- a/drivers/tty/serial/8250/8250_exar.c > > > +++ b/drivers/tty/serial/8250/8250_exar.c > > > @@ -1671,7 +1671,8 @@ static void exar_pci_remove(struct pci_dev *pcidev) > > > unsigned int i; > > > > > > for (i = 0; i < priv->nr; i++) > > > - serial8250_unregister_port(priv->line[i]); > > > + if (priv->line[i] >= 0) > > > + serial8250_unregister_port(priv->line[i]); > > > > Is this a bug in the current driver? If so, can you resend it on its > > own so we can get it merged now? > > > > Yes it is, I can split this one out and send it on its own. Great! Bonus points if you can find the commit id it fixes and add a "Fixes:" tag to the signed-off-by area. If not, I can guess :) thanks, greg k-h