Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1057176rwd; Thu, 1 Jun 2023 09:53:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4EfPzO5uMn6V8Ts+ofREF1S0sJ7RPvFqymRBJNlty3REZRLOfGtdomOu7j62au6FHg7aVr X-Received: by 2002:a17:90a:902:b0:24b:52cb:9a31 with SMTP id n2-20020a17090a090200b0024b52cb9a31mr2638284pjn.22.1685638429184; Thu, 01 Jun 2023 09:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638429; cv=none; d=google.com; s=arc-20160816; b=YpoSaUrYtS0Sq3av0NMZiZ/2GfE3MqDr1kCHSV3+becsa6/drVWRftVr/0JVtjkPOi 4mL1cfKfrneEurHKxdcsJkz7hZ9+k2RfiguiQJ6jBUc40m33QFksElZrzuSI2TWHIJhr GcYcL6H4DdGEne3rInJy0zqxlI8TcG8dG/9uiASv+M7dCNH4GRv1c7l6CeVMAHgla75P O60rbbgNwvCKUhnHhjnmS3Ex9hSgyQSwVQ+Lnm1f5/NQoeCR7STtQupb1pu/oQC21xUQ NacOGUcDjc7g1y064g3QHjAFn5s6z8c6afS/hhmMqQkijjt/Uplu8OMnWTJB96nROGA2 zLEQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Mg7IaNHSQ+LrboXIicrmmbD6wb2w7zmAXsX5EaLoZC4=; b=mxWv131Eiz+1vh+aeatEr/LvauYo3zrDztVYMBZL/6rSvVm7Pu4RkJJt0Weou4VxyA M1G/4QJcYKdpBMAO9TdyB8QbJvcOezB0RqKBLyZulOU+FH35oX2PTkVPCZcudZBKp3qF +vw/cvvLCl+WHOjQATc5pR3tQFH02VdayoCU26iFDTv+qYbN+MQm3JTZFzQ5EeqrNqrZ W7cCU50aVwn6LCRiqjvQo1qv/nLHDhSvDh8srnqpB/3mvEVe37o7M8NDTu2V0n6t4CB6 TR20AarAPC/B9ZADQkLgpMWMezQvvgzllYZrppT0xjcaUE4xqC8vP2NTRINxTE3dbQ8b +KgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V9uvnkAw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne10-20020a17090b374a00b002527f171401si227242pjb.182.2023.06.01.09.53.36; Thu, 01 Jun 2023 09:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V9uvnkAw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230399AbjFAQsZ (ORCPT + 99 others); Thu, 1 Jun 2023 12:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjFAQsX (ORCPT ); Thu, 1 Jun 2023 12:48:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B1E18D for ; Thu, 1 Jun 2023 09:48:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4E81864789 for ; Thu, 1 Jun 2023 16:48:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59FEDC433EF; Thu, 1 Jun 2023 16:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685638101; bh=LXnkDTkz1SKqT0x81Y2GOyRdBeWkTbwqHBn8qS6LGFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V9uvnkAwm4gdxD24L445/PkX1e77g1eiZH7cVy6Ob7zFqoG0PPxvERlqorV0WPwc2 dVdtj5swlzdh9t+51Ic4FBiR92OGrfL2V05l1N1sFThj/OKzzTQwMfY4QcYqtHDphx ZXU4IH9X4ee9vUr4wvYi+rJlinI6dbgBHl2zlw6nWq+UwNBgHHD6onV577z8jn/LQS LZdyjmSbbHI9wkEaXyA5FAEQRYraT/9diRWXus6KmybCQdjd5+Aij6LRCbxO78Tf80 cDHZ7YPNA/aKUEdivGQnM9cqDQUHRJeTU3HOaFQPWU2gfp+6huMWBSTE5/SGr5qimL sY4vDsOhKz79A== Date: Thu, 1 Jun 2023 17:48:17 +0100 From: Lee Jones To: Eric Dumazet Cc: Jamal Hadi Salim , xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH 1/1] net/sched: cls_u32: Fix reference counter leak leading to overflow Message-ID: <20230601164817.GH449117@google.com> References: <20230531141556.1637341-1-lee@kernel.org> <20230601140640.GG449117@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 01 Jun 2023, Eric Dumazet wrote: > On Thu, Jun 1, 2023 at 4:06 PM Lee Jones wrote: > > > > On Wed, 31 May 2023, Jamal Hadi Salim wrote: > > > > > On Wed, May 31, 2023 at 11:03 AM Eric Dumazet wrote: > > > > > > > > On Wed, May 31, 2023 at 4:16 PM Lee Jones wrote: > > > > > > > > > > In the event of a failure in tcf_change_indev(), u32_set_parms() will > > > > > immediately return without decrementing the recently incremented > > > > > reference counter. If this happens enough times, the counter will > > > > > rollover and the reference freed, leading to a double free which can be > > > > > used to do 'bad things'. > > > > > > > > > > Cc: stable@kernel.org # v4.14+ > > > > > > > > Please add a Fixes: tag. > > > > Why? > > How have you identified v4.14+ ? > > Probably you did some research/"git archeology". > > By adding the Fixes: tag, you allow us to double check immediately, > and see if other bugs need to be fixed at the same time. > > You can also CC blamed patch authors, to get some feedback. > > Otherwise, we (people reviewing this patch) have to also do this > research from scratch. > > In this case, it seems bug was added in > > commit 705c7091262d02b09eb686c24491de61bf42fdb2 > Author: Jiri Pirko > Date: Fri Aug 4 14:29:14 2017 +0200 > > net: sched: cls_u32: no need to call tcf_exts_change for newly > allocated struct > > > A nice Fixes: tag would then be > > Fixes: 705c7091262d ("net: sched: cls_u32: no need to call > tcf_exts_change for newly allocated struct") Thanks for digging this out. I will add it. -- Lee Jones [李琼斯]