Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1585860pxb; Fri, 20 Nov 2020 13:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzi5LTlIg5teRe55hAPUjuidl6aKd7S/sVPiRptW8k71AeD27l6DazsgO5m7AetNDUJWlq2 X-Received: by 2002:a17:906:17d0:: with SMTP id u16mr3851322eje.452.1605907165349; Fri, 20 Nov 2020 13:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605907165; cv=none; d=google.com; s=arc-20160816; b=hEEZXbEoTX0VyRee5n5R1lUEAYJMQJOHPdOmzsvyUZcCoOUmx/N/JN+7FeSn7OU8R0 nMt1byHOlUrLFx1D6pcIyyMwe3PoMgG8QBFHMv4lNVwJ5lCJSZqrI9Gjhp/3T+R1cbKm kfbWk0tObalr+A+Pd9DzRST4JpjIHSIyw5HUrLamHSjUEFE3j3ySo334ktU8OR0A0jq6 CNzacgmQOo/fvzDG3n2LZxFzqCQXo8DYkp2serrnW9mDUuF++fBxilp9armdkLh0MDLb JqDDggHJWWv3TNbaNrfPwoYjm40kCzVTtV/RdPnJCPDcFASEJIwV2ARSxyQZWRm3YBPS sAFg== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=IoukR4AmtFRlReSvMoG0CiXzF+kt04GpEN0xNyhRS0k=; b=tPfYlATgZSk27/a3LoXVOuBhZ1DHw1gbDMx6XNkOndtZoYYivag6G0lAUQYRI9Cl0k Jn3P40SpNWo9JYdcQsBANBwZzZEMQaOYue7I+gxTxSBw4h7djYmpbzbt9LbGxlksBruP iqUMeKM8awlT0aAD+8y10zoAPI7Eqoy6gCfo9m1IZIe/vKnQcDHsC9sERS2xaqXMEkUC SOUSrd0JeHuIKLtzkCrJ1BcfmISTAZeN/X+G1B1tgb44rw9se4Kudn0sVSaLryHOkV2a YeULwWydr2IDY9QcG4My4JE6wcUuDlUft/6I7e61upHlRmlrzMM9ZoxNoEtkQZ9A/UR9 3E+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bvxQnVUG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca10si2379014edb.170.2020.11.20.13.18.58; Fri, 20 Nov 2020 13:19:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bvxQnVUG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgKTVRD (ORCPT + 99 others); Fri, 20 Nov 2020 16:17:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:47790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbgKTVRC (ORCPT ); Fri, 20 Nov 2020 16:17:02 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 318722224E; Fri, 20 Nov 2020 21:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605907021; bh=3o42xR/oopO/mERodmzHQ9mZqOBed0ZCPYYqPErn++4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bvxQnVUGwQVyDJhUqXAJAgv+z9FNU3wQlWyy20fwspDIwlJ+ksyQUSObJeRFE58MB qt1PX+vx1ADzMz1amtfifndYzTt20vXEoeIMQ2L2n7WgoIHX6jqvRnKsTgyCNhzQGn /fTuAfZwIX2CsAE0vunG6auGjQA97TyymDQ0F9Uc= Date: Fri, 20 Nov 2020 13:17:00 -0800 From: Jakub Kicinski To: Vladimir Oltean Cc: Christian Eggers , Andrew Lunn , Florian Fainelli , Vivien Didelot , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] net: dsa: avoid potential use-after-free error Message-ID: <20201120131700.0bc63655@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201120210436.scmic7ygrzviy53o@skbuf> References: <20201119110906.25558-1-ceggers@arri.de> <20201120180149.wp4ehikbc2ngvwtf@skbuf> <20201120125921.1cb76a12@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201120210436.scmic7ygrzviy53o@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Nov 2020 23:04:36 +0200 Vladimir Oltean wrote: > On Fri, Nov 20, 2020 at 12:59:21PM -0800, Jakub Kicinski wrote: > > On Fri, 20 Nov 2020 20:01:49 +0200 Vladimir Oltean wrote: > > > On Thu, Nov 19, 2020 at 12:09:06PM +0100, Christian Eggers wrote: > > > > If dsa_switch_ops::port_txtstamp() returns false, clone will be freed > > > > immediately. Shouldn't store a pointer to freed memory. > > > > > > > > Signed-off-by: Christian Eggers > > > > Fixes: 146d442c2357 ("net: dsa: Keep a pointer to the skb clone for TX timestamping") > > > > --- > > > > > > IMO this is one of the cases to which the following from > > > Documentation/process/stable-kernel-rules.rst does not apply: > > > > > > - It must fix a real bug that bothers people (not a, "This could be a > > > problem..." type thing). > > > > > > Therefore, specifying "net-next" as the target tree here as opposed to > > > "net" is the correct choice. > > > > The commit message doesn't really explain what happens after. > > > > Is the dangling pointer ever accessed? > > Nothing happens afterwards. He explained that he accessed it once while > working on his ksz9477 PTP series. There's no code affected by this in > mainline. Ah, great, I'll drop the Fixes tag altogether then.