Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp199879pxb; Wed, 18 Nov 2020 21:30:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGLAJfg7IU3jpZefSojkK+ZaAR7uQ3qSQcU0sjlCMFkL7BWfrrsd0DuG6L9zBiC/HJUGy+ X-Received: by 2002:a17:906:8319:: with SMTP id j25mr28940760ejx.68.1605763806460; Wed, 18 Nov 2020 21:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605763806; cv=none; d=google.com; s=arc-20160816; b=uKJEuksKIim+V2Q69XvaAMnfhl7zdWVwBCEDt13MdLcBs+SadDQT/0+EP1+qJJhAtE jpyUk1VrfK7Gar3UaXCS+oOsRWQf1ukjoI4XU6rFblMc2ZJVmwmZxF+h1c2faPgTMXCP PHkqoS6i6EcchfSq19IZK8YGNq+jbIOLCirJ3BUXcWkgJk6eTuqy9Cg0H/VAMe2usKKJ nvQyh+YybVau9/yAZCjd7g+ytsUuQNk/yjt+e9xhvk2ZnFld/YPOrj2p8A7XkZAkNdCk gTYwe+kEgQy/RzkRRriUP0Ojy6coboD7eR91DJc833BHLOXk0MPO/DDskYeEFS03mA2C mcDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=tOq85J+aurOVp891rQjERQ7En7apApgidAtdxOmnEqQ=; b=kPnzmyyNpNF7knsLdBm3okdPsix3Nq6lzxQ1MzjfykDF0pvTMxniJiUHNQEjYg49Qf jAVHQazTaJu+Z+Fu5SopDJMJl8bSK6DdvuJXoGpivOqcsn0b1IyuiP7nFFKIKeWLFN72 pE6/VM8eD+v5tUEgC55i+1UZYdgMPlITxcG/pYtjRPxgNQQaNaxFBpvZ6Z9fUB9Db7Cq e9oMQdr+hnkZMcqZI7qDQDFxGXEU82V4IdBT8Wt5RdYtjVM5KS1ACDKw9QfAs2alsH33 n6l+oXWd1TEOhq/LaErZ2IqwXskFDYEFWSCD9dBj3YuRQb5pVinOqhcxMFqnre50l71Z FeRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si16191055ejw.297.2020.11.18.21.29.42; Wed, 18 Nov 2020 21:30:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725816AbgKSF2W (ORCPT + 99 others); Thu, 19 Nov 2020 00:28:22 -0500 Received: from mailout05.rmx.de ([94.199.90.90]:58544 "EHLO mailout05.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725648AbgKSF2W (ORCPT ); Thu, 19 Nov 2020 00:28:22 -0500 Received: from kdin01.retarus.com (kdin01.dmz1.retloc [172.19.17.48]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout05.rmx.de (Postfix) with ESMTPS id 4Cc7W6469Vz9t9n; Thu, 19 Nov 2020 06:28:18 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin01.retarus.com (Postfix) with ESMTPS id 4Cc7Vz6WlMz2xZR; Thu, 19 Nov 2020 06:28:11 +0100 (CET) Received: from n95hx1g2.localnet (192.168.54.21) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 19 Nov 2020 06:27:50 +0100 From: Christian Eggers To: Vladimir Oltean CC: Andrew Lunn , Florian Fainelli , Vivien Didelot , "David S . Miller" , Jakub Kicinski , , Subject: Re: [PATCH net-next] net: dsa: avoid potential use-after-free error Date: Thu, 19 Nov 2020 06:27:50 +0100 Message-ID: <2398833.qWU5Cqh0tX@n95hx1g2> Organization: Arnold & Richter Cine Technik GmbH & Co. Betriebs KG In-Reply-To: <20201118233357.ihifojr62ly4pas3@skbuf> References: <20201118154335.1189-1-ceggers@arri.de> <20201118233357.ihifojr62ly4pas3@skbuf> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [192.168.54.21] X-RMX-ID: 20201119-062811-4Cc7Vz6WlMz2xZR-0@kdin01 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, 19 November 2020, 00:33:57 CET, Vladimir Oltean wrote: > On Wed, Nov 18, 2020 at 04:43:35PM +0100, Christian Eggers wrote: > > If dsa_switch_ops::port_txtstamp() returns false, clone will be freed > > immediately. Storing the pointer in DSA_SKB_CB(skb)->clone anyway, > > supports annoying use-after-free bugs. > > Like what? In my own code. I test for DSA_SKB_CB(skb)->clone in order to determine whether a skb has been selected for TX time stamping by ksz9477_ptp_port_txtstamp(). > > > Signed-off-by: Christian Eggers > > Fixes 146d442c2357 ("net: dsa: Keep a pointer to the skb clone for TX > > timestamping") > Not the right format for a Fixes: tag, please try to set up your > .gitconfig to automate the creation of this tag. I think you (or somebody else) already noted this. Sorry for postponing. regards Christian