Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp29650pxb; Wed, 18 Nov 2020 15:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJysysvvqiIuJOn3h2eaak638CWFxiA0v115wuW+xkTNAHO+iypffvgRdqa+zFw5oIdD3vLI X-Received: by 2002:a17:906:2313:: with SMTP id l19mr24152855eja.443.1605742589139; Wed, 18 Nov 2020 15:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605742589; cv=none; d=google.com; s=arc-20160816; b=xWMTLZqs+30J+eN9ZvkMBiqVMSpwZlstZuMT5XQ6YhSRIAlzzkEPwktcrd+PMffx8O UE4hcGNGvUDaTOEURFYccWFBQyEvprWvDBvabETQCIlJnVqBsfDdPeXuVMb54dSKgPwt AmkVK7j3xM6jjRccLg7VXo6+gJyS7XhdIiLVRNyQ0CgnbffI0FHQ4bQCWTTyyMBtxjEz 63zF3mVnfzcstskdMXTNyiIQlN/1atITaUN7FmVeq9H0iovnFAF4au9IseUcr+One9Ct cLBJCALpdKfVuuA4xcWCICVZ3LqqfoELyekTA83u+Wwbpas8fV6o3KAMheiRQTqs+AL2 nkUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1xsMrKCOLxV9P6mZP+3GBaf95z88hZLl0UpnSDVLBMg=; b=SjA8cX/d6QKwcJg8YhbG3sejhtspyyov0wKjQ9BvYEKdQE5Ov8mltt62jidPBNKD2d H8u1VWLApgaWv8YppuGUK3wKSLK7tM35kYb1yO6T52xZ81z5IFwR4cyjjaUYSHH/kTzF vFHSNSjQKESKU/A3zANV0GdxqklkVZXmA+6m8dFyD0xg3HqovUpV9RkhfzY0vO5WIefE N2IewTXPap9NLkgQ5EACnQsVjhodJz2M4L6CbkcBH7T9iVrW2ozRE9KKrMhmr6oJJhc3 Fj1cD7wIpO3jlVQsVXtIS0xVVgriJNDJV7LKTJfSUoc8AgsXMK8/vDjQW1pgEIeZyhza QbJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="H1s+/Dzs"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d25si17723521eds.401.2020.11.18.15.35.42; Wed, 18 Nov 2020 15:36:29 -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=@gmail.com header.s=20161025 header.b="H1s+/Dzs"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbgKRXeB (ORCPT + 99 others); Wed, 18 Nov 2020 18:34:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgKRXeB (ORCPT ); Wed, 18 Nov 2020 18:34:01 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 015AAC0613D4; Wed, 18 Nov 2020 15:34:01 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id f20so5223400ejz.4; Wed, 18 Nov 2020 15:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1xsMrKCOLxV9P6mZP+3GBaf95z88hZLl0UpnSDVLBMg=; b=H1s+/DzsM/5rYDrY6z3rNfusQOKMDUdgB88vGqvzIucm2I6BgUAMlll98LTx0h0TPw 9EiQEfkxSiDIZwbHU/UUBzbop99zbjCrnrNvF55EL8bG3gecj3aytBx93yKZRCJYrT8h t4i8QL2qtA0furiT+xE8xCFNatnVHfjAd6nRhbnO0roPvE6GH2VnzJMQQar6rRRkx6+/ jt5BDSuDz6Lr+HqXTwZqW5PPYF0sSdePUQ09uBRq9XUIOtPMsC8hpWpNy4Vg6isY5b9j RrFVygq8fAHMmDOu4iN7MQRaQekfNFJQDz8NUAf2/YkBcq+eK6wk69P00+9o+dGNEn2F WAiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1xsMrKCOLxV9P6mZP+3GBaf95z88hZLl0UpnSDVLBMg=; b=dDWjBi2vtYq0y7ivE1KDbAEi2hedaIKT0X3RdG42hrvAJ7DgzsX3kyaRZbdayteSCd whVB6ELSKjP/WK06cJJx4u62KwDVdeMmL0dZwp+fiTtOnKvq0nOW/UPHWMS2l+DDyvgE dvJR+gMjsfVSA3KWYC29iymVXXxlX6rIkaQ1aILwuNn0Vcv8QXxJ9TkigInTgUNfEpeX jIPxr3cXT++t9KPyOb76XZSp7JKwtrTmAJgif68lrij+DyRnZeEo4kre1m5YfEL52DAy +nu30T6crqk3EXVnO2FlEYwmAH0BRuS6gVUpiOeUJ/ajBHVsUfFNuPKlIEfKAu1BS1ZX P04g== X-Gm-Message-State: AOAM530mCiCm7vzI/hJ+BmA3Cyfidg5Pf2jGG/9WGE5zWMN1XWQIEvc3 WalrU2gn5k0fydv9NVXsUCI= X-Received: by 2002:a17:906:c084:: with SMTP id f4mr12013899ejz.4.1605742439706; Wed, 18 Nov 2020 15:33:59 -0800 (PST) Received: from skbuf ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id q19sm13753113ejz.90.2020.11.18.15.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 15:33:58 -0800 (PST) Date: Thu, 19 Nov 2020 01:33:57 +0200 From: Vladimir Oltean To: Christian Eggers Cc: Andrew Lunn , Florian Fainelli , Vivien Didelot , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: dsa: avoid potential use-after-free error Message-ID: <20201118233357.ihifojr62ly4pas3@skbuf> References: <20201118154335.1189-1-ceggers@arri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118154335.1189-1-ceggers@arri.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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.