Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1231271rwr; Thu, 20 Apr 2023 11:47:44 -0700 (PDT) X-Google-Smtp-Source: AKy350avJOjV6qyFY/4BBknlC5w7OKwgWyzfOvz8IR9oTDbMz95QIC/r++SY568EFEy62tfsjmqo X-Received: by 2002:a05:6a20:2590:b0:ef:279d:433d with SMTP id k16-20020a056a20259000b000ef279d433dmr3347416pzd.61.1682016463879; Thu, 20 Apr 2023 11:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682016463; cv=none; d=google.com; s=arc-20160816; b=0YcJ5joWNms0y9smGYP+OAT79rlNelfo47J1cgGgSRh6rB0OeZ9MC+7pflYJhkTf0O cMByNNsJhnu+sFrAtgCOoi3H2vrAmpKl3p5GfO6TH9ZQJ+svd2yIadUyss/qeGAMy3GG ir64KgdJCKgGoGAlpGU8rHajtG7ClKHuh9eXQ8ACruHT8JedWqOifRbqDag64ty44mxr 9847YBsWSQQXc+80IflwKAn8UWA3nf2zNP9WG7adehM6z84EzXHAE3PZTclqAiLiD/yL qK20STl6jHnRwN6hVPa6n5TEIwA8xOHSaSc+2N+9Av03BSFuuLV4q9Qx3fC1CreNyv83 zFxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mJOW7tdNgKJptT0vz8GVP6fpHJhg0ViOZfphMyrTOKs=; b=hlLiGpJoDzhubxRifKu7KIH3E+L2bCJ/1wswH0OKxMgcjnRo/GygI3FozloPbM+W/q W1/0j4uHrZztbhrTXf+ENEeGdPVBXKB3G/ARRlNIuHT+ymK1j7TT+NDyBo82SnZ2ytRn +xIAUhaZ/PeR28+uUa4wkk8uKxKRJbxF8KX/hQHLM5rWBBMjeVJ6CcvohOsu+uEL7eAH AUktgvaf7DlP7wx2t7XWffPwsSed5baMIMHAZ8qlCNTdvfgX0pSe1WVLc2pCUiviqvwx yqONiS3jzoWNWYzqCA/BUM3ZQ+CrDsN4+QRo7jZeiu9dz5d59WqYbSTg46XlwtMsdZFs FZ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=iUb5SJbj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c1-20020a656181000000b0050fb1a00d3dsi2159696pgv.46.2023.04.20.11.47.29; Thu, 20 Apr 2023 11:47:43 -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=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=iUb5SJbj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231600AbjDTSl0 (ORCPT + 99 others); Thu, 20 Apr 2023 14:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbjDTSlY (ORCPT ); Thu, 20 Apr 2023 14:41:24 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6C4A109 for ; Thu, 20 Apr 2023 11:41:23 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1879e28ab04so935273fac.2 for ; Thu, 20 Apr 2023 11:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20221208.gappssmtp.com; s=20221208; t=1682016083; x=1684608083; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mJOW7tdNgKJptT0vz8GVP6fpHJhg0ViOZfphMyrTOKs=; b=iUb5SJbjn0lEofl87QYBQKeE8RTSeu4ViyKSzkGEF5P33PiclxgC5jTMRzMirA3Sww Vr6zOtvSetClEs2xIERLER7OQizuWzZ2wyjVDhaQGo0YsCxLUHTtyl8f4TrreE7OxCxR taXbS00VtICuKw1ntGs24xieuQex922fi9pv44b0XiowMIqjao7z2a7kBLCXcZ10udIR /GuTsOfe1XlpVvXaOHXGsELxfbVjYEYDVjXLx3Rcm6sIedsf4XaNirju0kivZIiT3bMw KSEDPPL+z6OXjwIx/DOX+ynZa5Qil0/ljy1M+oeaaeC2ENq2gWqLs8RTG48vpqBvXeoT T3dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682016083; x=1684608083; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mJOW7tdNgKJptT0vz8GVP6fpHJhg0ViOZfphMyrTOKs=; b=Pb3h9i/KFWbecbbmvL+TDKZVsOlMxDbfNC0jwglacjTBFGopyHZ/4ZeTfonjjVAAt/ l4Qc8xVOf14Di3trEVEXAiW2aoyPfHgV0kCcsT97Nk0YDVgtKjLzSNd/O9KOQONxTtWq 5OFYTBHnA7ntaWdMY+Xas8oKI+qW5Rbc3UIdGWxKokV44iYhmJ8thPMJHanezLwrN4tE hdLzvvWa57P1HaFB8+8Ljy15i0c6k+q/jirfhyEKkSmfxS8+wWSyERNswT0afGBDO44R otS4EqPWtKwQg3v8Nc6voGpioaO2+J0/2WPpbRuspL7Sxplf+V1+gut+Bbh5+BQ0bmVg 9BOA== X-Gm-Message-State: AAQBX9cmdSDkq7h1uh83tRG3vawLTZRRtRSvEpOHPFeUTdywdFNzXGua 9Oi5OZD4GseD2VVF3sgN2bXhwA== X-Received: by 2002:a05:6808:1407:b0:38d:e632:82fe with SMTP id w7-20020a056808140700b0038de63282femr1418396oiv.9.1682016082910; Thu, 20 Apr 2023 11:41:22 -0700 (PDT) Received: from ?IPV6:2804:14d:5c5e:44fb:7668:3bb3:e9e3:6d75? ([2804:14d:5c5e:44fb:7668:3bb3:e9e3:6d75]) by smtp.gmail.com with ESMTPSA id j11-20020a4a888b000000b00524fe20aee5sm901348ooa.34.2023.04.20.11.41.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Apr 2023 11:41:22 -0700 (PDT) Message-ID: <803f6502-76dc-d6e6-1bb2-5632de12e5ee@mojatatu.com> Date: Thu, 20 Apr 2023 15:41:17 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net v2] net/sched: cls_api: Initialize miss_cookie_node when action miss is not used Content-Language: en-US To: Ivan Vecera , netdev@vger.kernel.org Cc: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Marcelo Ricardo Leitner , open list References: <20230420183634.1139391-1-ivecera@redhat.com> From: Pedro Tammela In-Reply-To: <20230420183634.1139391-1-ivecera@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 20/04/2023 15:36, Ivan Vecera wrote: > Function tcf_exts_init_ex() sets exts->miss_cookie_node ptr only > when use_action_miss is true so it assumes in other case that > the field is set to NULL by the caller. If not then the field > contains garbage and subsequent tcf_exts_destroy() call results > in a crash. > Ensure that the field .miss_cookie_node pointer is NULL when > use_action_miss parameter is false to avoid this potential scenario. > > Fixes: 80cd22c35c90 ("net/sched: cls_api: Support hardware miss to tc action") > Signed-off-by: Ivan Vecera > --- > net/sched/cls_api.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c > index 35785a36c80298..3c3629c9e7b65c 100644 > --- a/net/sched/cls_api.c > +++ b/net/sched/cls_api.c > @@ -3211,6 +3211,7 @@ int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, > #ifdef CONFIG_NET_CLS_ACT > exts->type = 0; > exts->nr_actions = 0; > + exts->miss_cookie_node = NULL; > /* Note: we do not own yet a reference on net. > * This reference might be taken later from tcf_exts_get_net(). > */ Reviewed-by: Pedro Tammela