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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 2D7B0C282CB for ; Tue, 5 Feb 2019 11:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA0A62077B for ; Tue, 5 Feb 2019 11:18:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="QeMn2beL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727963AbfBELSe (ORCPT ); Tue, 5 Feb 2019 06:18:34 -0500 Received: from mail-eopbgr20055.outbound.protection.outlook.com ([40.107.2.55]:21856 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726031AbfBELSe (ORCPT ); Tue, 5 Feb 2019 06:18:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sLqjZV0AYoXZYVKcC2ttXuLSblGzuSmv3BuI1XtYe9g=; b=QeMn2beLfy3Q9YPvReoPdw8pYQbbEkGQs1jTc/c/iKvYLEAh2LWd7TkK0Vk17m5KzEyk9O6kbr33TmcgPCOYq29E6IH6uAHNHP/O2jRDxrlU1vpEWdevt3ZWS5o9UBRaakOZemyo2L6k4B+Qt8epVkr8a0wqqoY0Y9ySWuwyK1o= Received: from VI1PR05MB3247.eurprd05.prod.outlook.com (10.170.238.16) by VI1PR05MB6110.eurprd05.prod.outlook.com (20.178.204.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.20; Tue, 5 Feb 2019 11:18:30 +0000 Received: from VI1PR05MB3247.eurprd05.prod.outlook.com ([fe80::210b:6763:af21:4f43]) by VI1PR05MB3247.eurprd05.prod.outlook.com ([fe80::210b:6763:af21:4f43%5]) with mapi id 15.20.1580.019; Tue, 5 Feb 2019 11:18:30 +0000 From: Petr Machata To: David Miller CC: "netdev@vger.kernel.org" , "jhs@mojatatu.com" , "xiyou.wangcong@gmail.com" , "jiri@resnulli.us" , Ido Schimmel , Paul Blakey Subject: Re: [PATCH net] net: cls_flower: Remove filter from mask before freeing it Thread-Topic: [PATCH net] net: cls_flower: Remove filter from mask before freeing it Thread-Index: AQHUvJj+G7XnpZ0Uskmjt8HPs/YIKA== Date: Tue, 5 Feb 2019 11:18:30 +0000 Message-ID: References: <6f8e5a3f3ad2d6bc2f5a81ce1be1167b8aa456df.1549291065.git.petrm@mellanox.com> <20190204.092124.2218605529866288555.davem@davemloft.net> In-Reply-To: <20190204.092124.2218605529866288555.davem@davemloft.net> (David Miller's message of "Mon, 4 Feb 2019 09:21:24 -0800") Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP265CA0119.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:51::35) To VI1PR05MB3247.eurprd05.prod.outlook.com (2603:10a6:802:1c::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR05MB6110;6:dUjqzvoSRHna9KxSuqw3+6bhoOVQhCGpdrkP414oB/cF5nVZowCGXBfq803Ls5JU5ipQOD2XjSQD1DNaesQ4tOc7G7umi0O1+/pSAx2eVDerxVa9YSF7WsCoAYIj6dF+4PNL5Q5XQaE2ow9GgIV8dgaNS5gJtddHRpSuc+QL8r+AUcQtwfF+AvhfIsB1wpDNkvC1wE+l+rziU5S5PgnDeARHjaOXl8VquTxvy9jr1PoRwPz6IdnXktOFdtv1/ckyW79lFgFMoAWMcr2bJtHk8XeIxBGCmFFN3gSYuSHdyVejgvvrsWT7DKI0KHqdRcq8JCgXfAeg4ojTFrB+NZYY9ZFTtwVyk+2ZTzBdhMOnJLIgk8bqXgzoaMsaVS5XO+TyVvymaCTqpsT4g+qc4V25xMGgS12d8tyEuKT8boZEddrnXBnR1Bbra31FNJoetkNM7Yy9TtN5fMjyJulkX3v8Sw==;5:mGoltVNHsntD8e241cAN2tyBlobweLYrwNueWbWfRqsDVerSUglYt37p0nxe6U2p7fhSaFjWgBsImb+tlb8N5JNeXh2jhFdHRazJSjoq9ObBKsRPvG7q4cLjwiKEMZ2N3fGZmBTJEVyZlLKkFZNGprTCaooDxloSLw9UJ10rL/+7LJ7bt7P+UaYBDKl8YEK9xnRSfL/RZEpwYCVLvZfwww==;7:suaQP3JkuCuSDg9DDZfhU6qozWobLnUGkhSagKiq23ffvbM8G6UqKAeA/RSjsWxg59sKZ1yTBBwPwqbkhVItx6Dyfib6IgOZAO8JQzjSOaPhE54XANDz0zfoLjXSisILMrl9a0ZUAIApz8bRhWSP4g== x-ms-office365-filtering-correlation-id: f4fb23c3-9487-4be2-71a3-08d68b5ba829 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR05MB6110; x-ms-traffictypediagnostic: VI1PR05MB6110: x-microsoft-antispam-prvs: x-forefront-prvs: 0939529DE2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(396003)(376002)(39860400002)(366004)(199004)(189003)(446003)(486006)(256004)(11346002)(99286004)(476003)(33896004)(52116002)(76176011)(6116002)(68736007)(86362001)(3846002)(97736004)(6512007)(106356001)(4744005)(66066001)(9686003)(26005)(186003)(6486002)(6436002)(102836004)(6506007)(386003)(105586002)(478600001)(53936002)(54906003)(316002)(6916009)(7736002)(8936002)(81166006)(8676002)(305945005)(6246003)(4326008)(81156014)(25786009)(14454004)(71200400001)(107886003)(229853002)(71190400001)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR05MB6110;H:VI1PR05MB3247.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: onwCMlsKgHbe23s0zNTpU/9c+5Flz7Y2ecCumMouQXkJ+K4R2zaQjuRxmePgoITQJZJvCQ7nh2Zt7H2VvBUs7dtb7Ov5gl/aqVxTlc/OeMFx4QmMbS8w8nid7rXTxs68KvgtqHNWxaYTlB3sN8J2uxTpNRCwA1YJ4zDa8iqgwuhoxW6zZxGUYD3y6DP7qU+QnTqHq+TumiJcWEbGkAFmW7Vhi9p8WDJCSwHckLup+wm4xjoGQs23TpcJE7eNKkO0Dzag5ffn9pfX7h2Y30EdLtJa+tHFIyGxym03EFgjJJKYhB6Y9NrXrZNeTMksPcE4iXY7aRx+qM1EZLw/ZZF6VjgYULxgFtFOx27Mu69SQrXKN2Qexh+tGaSY98R6C3UvTLbmf1uzupHAgBgE/WJ4wIHO6g2sFKV68t9h/1ipS2w= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4fb23c3-9487-4be2-71a3-08d68b5ba829 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2019 11:18:28.9590 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB6110 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org David Miller writes: > From: Petr Machata > Date: Mon, 4 Feb 2019 14:50:38 +0000 > >> In fl_change(), when adding a new rule (i.e. fold =3D=3D NULL), a driver= may >> reject the new rule, for example due to resource exhaustion. By that >> point, the new rule was already assigned a mask, and it was added to >> that mask's hash table. The clean-up path that's invoked as a result of >> the rejection however neglects to undo the hash table addition, and >> proceeds to free the new rule, thus leaving a dangling pointer in the >> hash table. >>=20 >> Fix by removing fnew from the mask's hash table before it is freed. >>=20 >> Fixes: 35cc3cefc4de ("net/sched: cls_flower: Reject duplicated rules >> also under skip_sw") > > Please do not break up lone Fixes: tag lines in the future, I fixed it > up for you this time. Sorry about that and thanks.