Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp808115imu; Tue, 27 Nov 2018 23:07:59 -0800 (PST) X-Google-Smtp-Source: AJdET5egZErPKiYUK7RCxdVGYKyXvFqWZmnTVngUK9d5F5yeYbHy3XA9ePy+Y+S7ic9KbyqHhSkM X-Received: by 2002:a62:8d4f:: with SMTP id z76mr37497350pfd.2.1543388879370; Tue, 27 Nov 2018 23:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543388879; cv=none; d=google.com; s=arc-20160816; b=WdnltH9dUuXHikUpCkq+7kjav5ISvZha+q9061Bx5kgKPnQrZcxZLj2U30ZJnsr7MS Vjt7WXM0HGlKdej5Kxbjvu0Nr3cPsAez6kpX5rMsb0ASwQB9rVEqWSbHldHWFcrxWyef /Z4ThQRab/CPeHvJ8FoVVOfo0ecIbc/faPZPmLya0ununwx51CgSCKeHmGhRsIdnrCAy yELBgnqVUKKFQr4utoEJokKvuhJxa5aQYuf5TbL4U/DRWcxUgER+I3Q1GThFeI7IN2kp EBU+nTxM2/C23RcAns6CiavPs+Mkd8/BSTyDwmnXUogllQ24o2olOlQo3flYLsV9VXlQ XQrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OZgIK+vqlCt3S9rrJyWonYqb1NBJsFy3Yn7xCtMuMqo=; b=NmsXcBJcqb9gFbMhOuqYBS4yTFGPs5cSLridpCUo63gtJY/uXKcQAhyrh6Fc4F9PUO gMkrypmIrAxYDDjqDyibqr6wV9j6YW71ZgUx5wjyiHrVL7uqR2xJ4HAUI5KhZGOs9ctU FhmA+DUJeh7LgqROcCvJJ1W1Tlk0SK61jW9QiY7ej/LSOwOwtI4aZuIBco3Nx7AjubP0 jviHrYAut8gjsDuMHmzqhf2THAL7flNvsvXJxmnLYknBdCdR+Fx3Dn/6imh3u3iKsQOU ypIgXbJicu7ohMSlT+mRkWilD/QKFFxx/5uasaLRAtkIwRDCe2qKlfX66iXKKYUlJBU3 xkLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XaC4VeyO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si6052323pgu.525.2018.11.27.23.07.43; Tue, 27 Nov 2018 23:07:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XaC4VeyO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727655AbeK1SGC (ORCPT + 99 others); Wed, 28 Nov 2018 13:06:02 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:32916 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbeK1SGC (ORCPT ); Wed, 28 Nov 2018 13:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OZgIK+vqlCt3S9rrJyWonYqb1NBJsFy3Yn7xCtMuMqo=; b=XaC4VeyOz0IrtRuJJEEol5Xhg aMpyBbDziQLcw6WyWN6UULh8COsfWCtHd927YA9E141jyIfD0t/Is1M3t7+VSObiPRT8Ko/9vLJaL 5cqSWF0XIMI2QdP3hsEcXRvwr9Np/bQ3O92R0ahDa0leyy8UBfHH52c84MPggnFnrUS9ezez3BT7/ pyOJRjyTr3/YTOXFNwGIEUz8tqlKba+c1AvAPEotBfL7aY+V5ocd0d592c21B/eRAwl5PeayXzqBD ZiwmKp7wWimVNJdKVS0RaOMPXoIU9oQi79JYOCEv4lxWYhdY+DyPTB8q04yEPInvQDww5UrnNj1sn 7cJKjipvw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRtuW-0000zr-Ks; Wed, 28 Nov 2018 07:05:24 +0000 Date: Tue, 27 Nov 2018 23:05:24 -0800 From: Christoph Hellwig To: Pan Bian Cc: "David S. Miller" , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sis5513: fix potential use after free Message-ID: <20181128070524.GB30936@infradead.org> References: <1543366526-46767-1-git-send-email-bianpan2016@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543366526-46767-1-git-send-email-bianpan2016@163.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 28, 2018 at 08:55:26AM +0800, Pan Bian wrote: > The function sis_find_family drops lpc_bridge reference via pci_dev_put, > however, after that, field lpc_bridge->revision is read. This may result > in a use after free bug. The patch moves the put operation after the > condition check. > > Signed-off-by: Pan Bian Looks good, Reviewed-by: Christoph Hellwig