From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A91EC3A589 for ; Sun, 18 Aug 2019 21:19:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C87CC21855 for ; Sun, 18 Aug 2019 21:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726107AbfHRVTl (ORCPT ); Sun, 18 Aug 2019 17:19:41 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:49390 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfHRVTk (ORCPT ); Sun, 18 Aug 2019 17:19:40 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 66C72145F4F53; Sun, 18 Aug 2019 14:19:40 -0700 (PDT) Date: Sun, 18 Aug 2019 14:19:39 -0700 (PDT) Message-Id: <20190818.141939.213294317843832464.davem@davemloft.net> To: horms+renesas@verge.net.au Cc: netdev@vger.kernel.org Subject: Re: [PATCH] ravb: Fix use-after-free ravb_tstamp_skb From: David Miller In-Reply-To: <20190816151702.2677-1-horms+renesas@verge.net.au> References: <20190816151702.2677-1-horms+renesas@verge.net.au> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 18 Aug 2019 14:19:40 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Simon Horman Date: Fri, 16 Aug 2019 17:17:02 +0200 > From: Tho Vu > > When a Tx timestamp is requested, a pointer to the skb is stored in the > ravb_tstamp_skb struct. This was done without an skb_get. There exists > the possibility that the skb could be freed by ravb_tx_free (when > ravb_tx_free is called from ravb_start_xmit) before the timestamp was > processed, leading to a use-after-free bug. > > Use skb_get when filling a ravb_tstamp_skb struct, and add appropriate > frees/consumes when a ravb_tstamp_skb struct is freed. > > Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") > Signed-off-by: Tho Vu > Signed-off-by: Kazuya Mizuguchi > Signed-off-by: Simon Horman > --- > As this is an old bug I am submitting a fix against net-next rather than > net: I do not see any urgency here. I am however, happy for it to be > applied against net instead. Applied to 'net', thanks Simon.