Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1971236rwr; Fri, 21 Apr 2023 02:14:28 -0700 (PDT) X-Google-Smtp-Source: AKy350YZPfxfs96m+QJpuLUhak8NDYb4w0FDSvYILNy8xTZCkJv6/cq/jarQSemMsetl1qel+juL X-Received: by 2002:aa7:88cf:0:b0:63b:873d:bdb3 with SMTP id k15-20020aa788cf000000b0063b873dbdb3mr5180326pff.13.1682068468042; Fri, 21 Apr 2023 02:14:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682068468; cv=pass; d=google.com; s=arc-20160816; b=URz+nwVYIirdrZhureK4JjvmkXi/Xu4UVU2Zpbn55Wpp01TOgwxJE4XxELhKJbJbNQ yDCwj6Yy7I+Ckx4SZRFn7f/0/sZCSOK/qOI66stGXYwylqfc72ak0IaL+HJXuuCd9RgU PkKjcJFfSQe3Xl0WXDq0pC/PgIOe0h0FbOmL/pZlyxqanMyugu2cniaN/GZ0cFEx/ndN mCF1v6dnpy9bkH0r3dJ6er75c8W8LhGRGKxB1anKKHOZTVtYry2reTDlbZbdtZFv58FB 949sZ+vI2ne5OmUfcbJDPLQ/PGgipUw9DRZwEXwU0kppaqviwtFbPm1GYqeSwlfW0n06 riRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=phE6MuOLIqTP+9zY8UF8KTwhXqB09hlbvu6Dsm3vSv0=; b=YloxwZ7v4j0Fs83EF5axAk8+39YJJklAuC//6igCcVCidPNMe7EOsNasRFkEB4ary+ LYgD3rte8u5NOurMk+ZZLAsQEQcNZcPa5Vo+EyfAR+SfXxUOvhhH3sYZZHDscetfNtck cd3Btwifd5uOLAILGRfXo4AAKq0L2/AxZ04L6r6ogovkpFRb1IwNVaqxWIVM6I1+lD7p qqKpR2TR+n4NHE7ctYCbxyDUKZgHg7Wt2Z4AQbP8fN84fW0dw067qvWsyv/ZEf0V5OWd mmY+U0C3oyQRVPAlM8UBVevUf86fh4BD9Dm5wSutzTbhm/pY1DtmQTtpdF+UUOgPzvVm wGuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=giLAxySA; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a626101000000b0063b8b35dbc5si3767935pfb.184.2023.04.21.02.14.06; Fri, 21 Apr 2023 02:14:28 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=giLAxySA; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbjDUJJx (ORCPT + 99 others); Fri, 21 Apr 2023 05:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjDUJJw (ORCPT ); Fri, 21 Apr 2023 05:09:52 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2092.outbound.protection.outlook.com [40.107.243.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194A48691; Fri, 21 Apr 2023 02:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gt2e7J1iSino6085EHAUJXHr8QjUhQdSFqG1GTNI6J0kXsnMnWgKXIzDdm8UqGPiZANztYkQEp9QkhdXT5cEsN+DZr77HrWe4xlWpjn0sz9wTIxPY+A+60WR03FeGeFFcuOV3zih4tLQW8MzJutXFRVOutbHoxCYM0HW7NwMk3RGTmLChuu2hu1ZbO6hu0pSG9AHBWL3fXAt/h3U+8C5l8FD7BjlGs21mgMTw+8KUmoaBdSV46a5s3zvZgXoJ/38RbcFJxyXT8D6A3s6Ri+c33nIgTDDA0f1BPA3Eang2AwpP2yWN7ieJUjvZQ9BVmWNm77Zia8zrOf+Ovs0XhPuLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=phE6MuOLIqTP+9zY8UF8KTwhXqB09hlbvu6Dsm3vSv0=; b=DGAIxs1uA85nGkTUqnQZFvZmbWtERE3L54f702XMc9qYfaDS/cKZkOjpDo+flt6ffnSwxRz8KmmDjJoTpRTZolCjE5uDs+uZFR+5TkqfLlNoAEu/wK4h/26rz3uMXo0U6I8LFGHU99XKAdhvQv4vo/MHobf2DYEvmHmag2P2fH/KBTcO3cmCZIFwjdZLjqpSAVOferK3Q3Y39sKZmjmHUc7v+HdKELiNDdo1yfhV/3+cDGP0w7GFPlc3DZPn8aaoelJWnsMX37wtShAAG7zvRRYKMQhiymSmsLR5oHLLdp3kmd2FD9qQHhkXBnI6ShaBrbkKKCtsTjhuIUhrt534HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=phE6MuOLIqTP+9zY8UF8KTwhXqB09hlbvu6Dsm3vSv0=; b=giLAxySA3fipqTFs718n94oJCq8r/noujRpnMSB8uOVQd1LU+R9EMdmMHAQ44yAx9gvaVM1aKsSROxlurMZChTz+mvVZg0+OiqUxBZSv2+OWnZgkmH9avo1DYDDJjns9jmlaEQ+wtE5ObKOBS6f6neB9IaXW2g9acqWZJy7c2DM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by DM8PR13MB5160.namprd13.prod.outlook.com (2603:10b6:5:315::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 09:09:44 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%4]) with mapi id 15.20.6319.022; Fri, 21 Apr 2023 09:09:44 +0000 Date: Fri, 21 Apr 2023 11:09:37 +0200 From: Simon Horman To: Pedro Tammela Cc: Ivan Vecera , netdev@vger.kernel.org, Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Marcelo Ricardo Leitner , open list Subject: Re: [PATCH net v2] net/sched: cls_api: Initialize miss_cookie_node when action miss is not used Message-ID: References: <20230420183634.1139391-1-ivecera@redhat.com> <803f6502-76dc-d6e6-1bb2-5632de12e5ee@mojatatu.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <803f6502-76dc-d6e6-1bb2-5632de12e5ee@mojatatu.com> X-ClientProxiedBy: AS4P190CA0030.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::20) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|DM8PR13MB5160:EE_ X-MS-Office365-Filtering-Correlation-Id: c3a0014d-1407-41a3-bd07-08db4248259f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s2qZ31o07NWJ+htIEXc/Xi1KvPadeUgZRkP4ZpQAu+PDPZgB8fCRVRh+v7EfK/OVxMclfNW34llTKskpwpXliBB7SlXlI0uu0/jh2Z0YR2mN4Z+IKKlMtqiBc+p0Cf2hiK79UbGkJk5YZ8ztd3edsoK7KAUJxd7dmmrlbtyPavICUKU8Zxh0ByancLW/0WPN7aivTIuWvvYYxPpaN5WAudTRtMHaAlOc+/TQQxosxJBEtlKwMcjPFwWsHnPqN/OAn44mD7gcYuEboSsrTyEtT5/oKBmbUwS1zLEKdB0NJ7obcMma4EP0PjxqYwPjjKqRehWCgvL9b5n5SLLkGS6l6FAdFNO8ZYRU5SUJiwTWQmJEjpyNLIU1B0H5CagPWM5TZbraNFH8/pMt6REz/OoKlyKLIrlCGFzgeTqGV/K8hGQ7ko7qg2TjsQRHjR1EeREV/k5Ax1bIfK88T3t5E5NfCEcPQAoA1qmzhZxdCqaJKSlaCGfnZF5qiIgJEhpLoAN8gWjSi0Up6fn2JDYhCzieqPykTZHS5GSv6J1dqU6Hhp5vdY4nIzi36TZ1wEa7J2M9cqe5/5U8+G7E9nTAxuZt+0FtArrWRCcIEt//u1pdtfI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39840400004)(366004)(346002)(396003)(376002)(136003)(451199021)(41300700001)(66476007)(66946007)(66556008)(54906003)(316002)(6916009)(4326008)(478600001)(8936002)(8676002)(7416002)(2616005)(5660300002)(6512007)(53546011)(6506007)(186003)(6666004)(36756003)(6486002)(2906002)(44832011)(38100700002)(86362001)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?tqkvS9s7hj+VzNjCNEAWpvvMxbfiNJ6ifJNSBWNpbdJQiZA5SVdpv17lNk3Y?= =?us-ascii?Q?14EfW66zMrAH84zl/Vy1MfXh8I0CJq5fxUG2N3XoP8pd0pEfoDHQYW11+sKF?= =?us-ascii?Q?Pg2OITBJ2JO6qi3hQdkXxgCj4O0Yhyb3PABvziteWp0JnDWF8RSUr72fqH8+?= =?us-ascii?Q?fEo/gBpRoU+FuZwFYhp5OGr1y9GJjLi/m7x+/+9tcNPA1beOuQzp/k8j9AEh?= =?us-ascii?Q?q/UTKow0+oHaJBgvm6DXnAQsgX52/wup6+icywkJycv7sGbCNttrL5VlDvWj?= =?us-ascii?Q?ZMJRHKBeSIKQUtFUkypkhNkrjXKqiA5yNiyXNHeGbjVgwq1aOv0CufexmXeC?= =?us-ascii?Q?tBXZiYKM5IgkmAJDOMuWk+cRlHSbj0UpsWnLEA1M53wDD3ZoTK3yzNKOug26?= =?us-ascii?Q?ZWXW1cx4R+qyvUcf+jCrA3yTVRmudsYoBVQiAQty/RAcgCnVZcU9IZezIxh4?= =?us-ascii?Q?Aw/ciHZk81YdmOAPsxgsAvDc/Qlu8a2rti8I/degZ6bPXiLJAKPkOnlHJ5ub?= =?us-ascii?Q?rqxNxhGnKWwLsGt9yPP4CMS63Z36MWKN6pThkA8QCbmY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fabr+fad8PcTsEYJt7ytUwEe+/3zDQRGMCabSU7/2iZ?= =?us-ascii?Q?7lPX9Hun2pX+VNlhRe3AILXYUdJcr0+RxnCrGvZpQY6OY6v/Fp+2uZXlmeI/?= =?us-ascii?Q?5xcAFhGrUKeqXepJ/r9ERlPyS/dKhBorSTz3EHXV4XilPZr3PwJX6pUn6OeR?= =?us-ascii?Q?V1ePBL9i0Q87ivF5LjpFShPngb4y0VJlMakFcrhclzBO+jUhbyQZIZP83XxA?= =?us-ascii?Q?R8b31A=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3a0014d-1407-41a3-bd07-08db4248259f X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 09:09:44.2430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u9WpdCD5QYF6fM14X/8cmdhM4ZsbplmetRUDojl0dCGQc5fZh+OtUa4GIdF33hVPh1SWERKkVZxV7Yqqv+VXIJHejBkwFiaZkhWMM08zpR4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR13MB5160 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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, Apr 20, 2023 at 03:41:17PM -0300, Pedro Tammela wrote: > 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 Reviewed-by: Simon Horman