Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4263623ybi; Mon, 29 Jul 2019 22:47:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyajZSAcCsdZ2daFXdYGdV6YTxZrIfVFS3kBxJ+1AD89yGSkBl9QMBq5vQf90C3wf9gwtBg X-Received: by 2002:a65:5c4b:: with SMTP id v11mr64887076pgr.62.1564465621914; Mon, 29 Jul 2019 22:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564465621; cv=none; d=google.com; s=arc-20160816; b=SZz/Hk3vVtZy3ZQ3ksntSArTTO6MFsDhpDRrIK/BbtSGw/y0pc3UVOpRuzTA3oZEFG v4JV9oS6wKoB7iMk+DkSckG+16qcx37C9g9weVwLmylXuCQzN4w0qlTwhYxKSHoddsQt 6GSUuiQb7rMJpKzgqiu1LGRn7/F7mb3j05MXGXW1+lGHAIv8CNPDOc4nicJEV2fp0ITT iNZW02mZzjkdi/5V9TtEYHz6mrA6wD4E8JFrwfHDaDLP5hssN3UXAXZmCrh6yeP7arGd +aDhoNpvlKLCebTaSoDjAaP+Fu9azfmW+YUK917+R2gXZ4Wh+E27sC7UBJ/rce10LjCH BA7w== 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=4mF6Hbr7QczI5PcOmjlA7L0RwfQ/3SFLBSWGVwkXv38=; b=FR7RneNq9mixUK2pEHh1LBDqrt6ePcBp7rSqkzAwClkpZPgKr3wHWKL8SHdwKm2Skx bBbaDuwhDjqYIMKyeT+mp1QCrfk7nzkK/zkDB4gsuc44ldqq4iRxH07N04NIrshXF378 TgHR9fn5Y5a7lkw0XS3nH6eMTozkm5xQdFXz8SaW3JkjGwtbUqsFnNdKGiF/p2o15DXw XUnSR1YeOBWIQW7J1teWuXB6DNoZfIcxnW0lWFmo2UDSIsaSFA9hLvXgDl8PYLvPH/4j hIucwZJmostaCR5CQERv5v+LQgFGckKxi6ongI5XLgIb4Y1MGZfQoI5k+5PM+w9cFUVR y9mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=gl2jYAwR; 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 s14si30928276pgj.347.2019.07.29.22.46.47; Mon, 29 Jul 2019 22:47:01 -0700 (PDT) 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=@lunn.ch header.s=20171124 header.b=gl2jYAwR; 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 S1726964AbfG3Dcf (ORCPT + 99 others); Mon, 29 Jul 2019 23:32:35 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46524 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfG3Dcf (ORCPT ); Mon, 29 Jul 2019 23:32:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; 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=4mF6Hbr7QczI5PcOmjlA7L0RwfQ/3SFLBSWGVwkXv38=; b=gl2jYAwRKtxW1hFrk0nYA0J6zJ VXk4mYKObWiOxItwiQkA0ZRZa/vns5vAAeVzGlYH5e1vUs3T5kyKnHtxGP9x+ISgb4y6Rm3mSnvcg Fjo7hOYf8XIHQ5z2wpIoit01PZFX3y5HFOpxmEyex+fVfykWCBO24O+s/A5WWlSz/9yg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hsIsH-0005Te-Ox; Tue, 30 Jul 2019 05:32:29 +0200 Date: Tue, 30 Jul 2019 05:32:29 +0200 From: Andrew Lunn To: Jia-Ju Bai Cc: f.fainelli@gmail.com, hkallweit1@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: phy_led_triggers: Fix a possible null-pointer dereference in phy_led_trigger_change_speed() Message-ID: <20190730033229.GA20628@lunn.ch> References: <20190729092424.30928-1-baijiaju1990@gmail.com> <20190729134553.GC4110@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 10:25:36AM +0800, Jia-Ju Bai wrote: > > > On 2019/7/29 21:45, Andrew Lunn wrote: > >On Mon, Jul 29, 2019 at 05:24:24PM +0800, Jia-Ju Bai wrote: > >>In phy_led_trigger_change_speed(), there is an if statement on line 48 > >>to check whether phy->last_triggered is NULL: > >> if (!phy->last_triggered) > >> > >>When phy->last_triggered is NULL, it is used on line 52: > >> led_trigger_event(&phy->last_triggered->trigger, LED_OFF); > >> > >>Thus, a possible null-pointer dereference may occur. > >> > >>To fix this bug, led_trigger_event(&phy->last_triggered->trigger, > >>LED_OFF) is called when phy->last_triggered is not NULL. > >> > >>This bug is found by a static analysis tool STCheck written by us. > >Who is 'us'? > > Me and my colleague... Well, we can leave it very vague, giving no idea who 'us' is. But often you want to name the company behind it, or the university, or the sponsor, etc. Andrew