Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp596712lqz; Sat, 30 Mar 2024 09:53:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnpC+WYzTQHmBN7wQpBfx9kxegN4Nr0zYGjxBoKivPvz5NAdZhAoqGSuT+g43T/gy8WZLXtv/RwEktq7zuxs4KknfHOlAp315493h16w== X-Google-Smtp-Source: AGHT+IGr0Xbpos0N+Hyra7RQ/BN/h7yMsmKsQLZpoBfMSZt55Ki/ItjD31HeaPMfFevZKTafY2cp X-Received: by 2002:a05:622a:491:b0:432:b30b:7fd7 with SMTP id p17-20020a05622a049100b00432b30b7fd7mr6241514qtx.32.1711817598389; Sat, 30 Mar 2024 09:53:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711817598; cv=pass; d=google.com; s=arc-20160816; b=QfCOWlMn5L5gqqYBoo7HKaZoFZpvslWaUoQDitnydDh/Mhlpah8SBm5pzLKEP79M8T 7CFDmoo1RSsQKGw7Kmr7h5RKTpNagPW0kNpu0/FIedW9QUVcIHGGQGmuWghAaDTjHiSf tFV59M4hsSSC+NX4pztploPwfcCnLc1B0xMM/O/KxajIpSYLfXV9RmhJcQLvzuLcTYqh t2eqAAbUvogzXrE+Nqjr2bFucdGIwRb0CuVL7DfTXPk8xDLOnMMfuWOrRq0c2D7Xt963 yc1jiE/GVx40qTabvt0JAi2lC8zgikYBWJcf3nI9bZ1cNIolcJctS+ZzpZlAkvhIC/NY mYfA== 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=12mOhfEACnQyGFold5e2GlfBr4qaG6UXLXc0BoVz+8E=; fh=4bKBIe9izs1mxTrS9zEOnnnVwon5wowpwLcLK5kdg+o=; b=e23y7g/APII8Hj6MfMp1D9JxKAxfOD8tnoTiCEu5UvCL74zhR1Y5SNqKjh9kENQDZE TYFpudZgObl1ye0SOj3lAQUJGadX7nrTCbmmeSqnVUTinLMKCaPaxqmwqGKge5R1yV5K Shx6tH/01NEVbamgOThN54ph1uRD/Zy4LrtFQ+psWgSE28WjbnS1m62LwQPfIgUSmnTx o6faZmbG0NsEMeuDUurwa26/+PHyavkoxFtXq48OfwUI96dbtCruXalHPmltZkG1dTJz UljkRYVONyXmDeI30XbS2idRoa8e2s1qOQcDG1MiSoMCgJivvGE3GIlpTFIhW9vp5IU3 hA7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=UVwvyipm; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-125788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r18-20020a05622a035200b00432d2fad443si1093531qtw.260.2024.03.30.09.53.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 09:53:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=UVwvyipm; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-125788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1FDCB1C21481 for ; Sat, 30 Mar 2024 16:53:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADB9C3BBFB; Sat, 30 Mar 2024 16:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="UVwvyipm" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 513D31DFC5; Sat, 30 Mar 2024 16:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711817589; cv=none; b=qv61lceoNu0tZwEIaPVgaKqoG2H6djKyVUUUimGZw82ZQ/Ewfzm2luYqNnlqkLzK/Aub9TNxLumt3rbBZXrn2BE9uJoXEzsFGYHqc+hxi2Kjel9PGCr9DXX1Na5RBlO+6iSVYQc6gETjBAmk7TRy/OnglsJM6Y8udfL9j499/vc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711817589; c=relaxed/simple; bh=N/kkFVF4XLvTlZanq+KnyI5NRgwQU5kEQUJVAK8hRg8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cyzA326XbTrgIK1qXIcuk45VCya7c9tD5k3TdLV8oEMwtOZWqAJzYBTSILYfqI0LdWBtyiQcwaElhxk6foCvziu5UbIelRWmN6EeFCmV7ReYi4S2tEUDbzY2KPh7mVdOGUGL/7RcU6nHlhLh9mq4VQp2FxLH/uAv6BLv7eOJ78M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=UVwvyipm; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=12mOhfEACnQyGFold5e2GlfBr4qaG6UXLXc0BoVz+8E=; b=UVwvyipmhk/X+OTKxJg4/JQEqp K+nxXxZgIa4ijOfK66c0HfSvKRK1uxkX7vw03Sa3g0Dj4USxCQvBrWqyOELcPeaNW1+exJg21XVM6 t6QmvOxpf25zKVjXkM/RKhez8PWvMOpUpW/e0il1PYysSoyhMRui4UssYkfMk/gl75NY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rqbwj-00BjOd-Mp; Sat, 30 Mar 2024 17:52:45 +0100 Date: Sat, 30 Mar 2024 17:52:45 +0100 From: Andrew Lunn To: Aleksandr Mishin Cc: Divya Koppera , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH net] net: phy: micrel: Fix potential null pointer dereference Message-ID: <9e326e82-d1a6-4058-b9e2-299817fea953@lunn.ch> References: <20240329061631.33199-1-amishin@t-argos.ru> 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: <20240329061631.33199-1-amishin@t-argos.ru> On Fri, Mar 29, 2024 at 09:16:31AM +0300, Aleksandr Mishin wrote: > In lan8814_get_sig_rx() and lan8814_get_sig_tx() ptp_parse_header() may > return NULL as ptp_header due to abnormal packet type or corrupted packet. > Fix this bug by adding ptp_header check. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy") > Signed-off-by: Aleksandr Mishin Reviewed-by: Andrew Lunn Andrew