From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B522BA0526; Wed, 22 Jul 2020 17:31:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F336E1BFFA; Wed, 22 Jul 2020 17:30:52 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by dpdk.org (Postfix) with ESMTP id 579CF2C6E; Wed, 22 Jul 2020 17:30:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IAxP6UvJ1CjKljH+BEIVvz+qBlnCYAJBH5BCUbQK84vyQr1Ca4HphAcbDL8gC0i5AKzoxLH84Vy1G+CNCVarcyo/Jg7kK2UFrQL1qCOH6p6OtRsM+HwRHSVfR/xd5egxmXlwKiX8lR03NsT8h44157NVCTcqIbLf5u7pFkbDd9lDybqTMR3fJrgvetj2y85RUtVkNlcefmJ2zHfOLetxu6RGgpYW55AnJvhQeJgaIX3DFiEnpQIBBglgyf9UZ8vPs/abPkwiq+nialxy7ExL0B/ACpGHCV+9mBay6tOkJLFdZOOlO0acrUwe0aPpYp2WpVCJ8lasbbwxwrR7rz4OrQ== 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-SenderADCheck; bh=W/YLHoCtXr/k1lQfbLqp6F/AqSxAxNeEkgB0LGNfszY=; b=j3jAigbNqb9Dsl5LX2H6RlVwQe1e37lAiYaViE6PhU9xU0cjnVwyU5f9WlNwL1jEYs9tkPAqv+X7t6FcCU8PmTTVSjP2dEWfPdyPQkxKuDFpYPhdtY0EkZJPmgYpC9N8aAOqGDZaRdnQ2Yq/wvs/GjBMBtv6bv7s3IhAgNe8hMfkE4R9ZAf1BN0u10lFrmtMPsLQPON009CBYYVAp3xNx6uP4hNtcC1M51XyLyB2/Npcf82M85iAYiuWbUm0pf8Czd4LrBDeuUVZh4eaUUPIW2KckJzHoWiLjmMJwhYvZQTd87IQrsc4UD1WiL20JV/SG4GQy4bgiPsyT1QFr0h38w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=W/YLHoCtXr/k1lQfbLqp6F/AqSxAxNeEkgB0LGNfszY=; b=pS422Y2LrQVeNVYOLLfKhcm0sQFM/xs3TuJ4lrrPpfrdQN/oOz4wCJcGvvyXJ8hZ2IzGS0sDp3x1sJ0SlRruaQIS5QABiD1y4DXU4H1xzVD5b5lh5ORXrO3zxgHBOpt+HMzYRGehWxKP5UlKDyNoGrT5h5qma7A1nlODH6eXlNQ= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB4401.eurprd05.prod.outlook.com (2603:10a6:208:62::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Wed, 22 Jul 2020 15:30:48 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012%5]) with mapi id 15.20.3195.028; Wed, 22 Jul 2020 15:30:48 +0000 From: Raslan Darawsheh To: Michael Baum , "dev@dpdk.org" CC: Matan Azrad , Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix NVGRE item mask handling Thread-Index: AQHWX1ZdDDuWTjx2D02T+Gvdg5h+H6kTureA Date: Wed, 22 Jul 2020 15:30:48 +0000 Message-ID: References: <1595332744-6792-1-git-send-email-michaelba@mellanox.com> In-Reply-To: <1595332744-6792-1-git-send-email-michaelba@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3930af8d-6404-4331-6eff-08d82e5435a3 x-ms-traffictypediagnostic: AM0PR05MB4401: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8SG3bCyp8Sk19NgEBJ3sOBBJeTZtt6GBLHDLdPLOLZgsOsP8QjuHCpl2rZqT7v4ZQdPAnGI2t4iJdxg42IIUwDvOCuDSaevlLTGUmSse/Gyp63oKZc1Q2/krVKCsGIxQvXaSPf10U/Aff81wCOYGH+uvePyy2/r1lV9kJNS0mBPuiSrCkFHlN4FBCGsYeRGwo6otHDGPMEcShPalM4dbsJQ6AZmWgX2uaJXxJLaeJa4ZN/O7f8ROarje+zKePKinJnWJmBV0cqbSsYAfFHcBkkyaIfhOQB59OJgy5W/kvgdQ46tkNDU3NuFF5kzYUJ0TxXYGcdo9z8LguQSupRuu9A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(39860400002)(136003)(366004)(346002)(316002)(8936002)(6506007)(26005)(4326008)(7696005)(53546011)(450100002)(478600001)(8676002)(54906003)(110136005)(186003)(86362001)(2906002)(52536014)(5660300002)(55016002)(83380400001)(33656002)(76116006)(66946007)(66476007)(66556008)(64756008)(66446008)(9686003)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ywKM1RNQEATHLo4i3v2MRf1JDh7H0QkYOdYpBZCOZ9HxGTiE0PDNyrPV5yLT3fPwr7H4qNYpS8ECsvG3oobHITPpYE2HsFZPQd4p1EdqVdQgrPgLnRRV3Hi/qtQ7sBXyTrdTdvCdo/bQ7y57Acruup8qMoAceKQbYex4N7S2K3Ydk2k8YDe1bhkQLb0yzvQmmp0vyHKaggruxr6PHgdxtn6SUr83xv+4di8fdfvY0ibK9E4KrXq5S+14VIf45quE1pZ+dEEs2mvW1eQmXabzxExaD9dcyyw5YVGY9WbzGOC1t0hjenPrXDPY9vwZbgf57bDaFW/qequDCZN8bQUWdmSH6gJU9m8FMEgMxwkG4FDsBX6S+oaTqaimYR/a6pIzlJ7c2WetNtmRdZFYVYuj1RSvWmOmJJDYpOrYrbaqcCXW1HaYZUzohWvL7r34bs9JgJ8Paynw07fD9kJJaT6J8kc1MZ/W1pdfq97bemlLkmZtcO13R81597tr1Mak6EMe Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6707.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3930af8d-6404-4331-6eff-08d82e5435a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2020 15:30:48.4341 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9Rc8Dh2FlUNoeKnXiAAzIBGbc96oBZ+pb+Vcx4EVfixiwqZVwIjTa0yAIO+F95oaRyJkHxMlCBFx5qE1hbd2LA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4401 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix NVGRE item mask handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, > -----Original Message----- > From: dev On Behalf Of Michael Baum > Sent: Tuesday, July 21, 2020 2:59 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Slava Ovsiienko > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/mlx5: fix NVGRE item mask handling >=20 > The flow_dv_translate_item_nvgre function add NVGRE item to matcher > and > to the value. > It defines a pointer named nvrge_m that receives the item's mask into > it, and then copies some of it to the matcher. >=20 > Before copying, it checks for mask validation, and in case the mask is > NULL the function gives it a pointer to rte_flow_item_nvgre_mask. > However, the function calls from the vni mask's field before the check, > and if there is no mask, it actually does dereference to the NULL > pointer and indeed the program crashes with segfault. >=20 > Move the call from the vni field to post-validation. >=20 > Fixes: cd18e1b72f73 ("net/mlx5: fix build on Arm") > Cc: stable@dpdk.org >=20 > Signed-off-by: Michael Baum > Acked-by: Matan Azrad > --- > drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index f0cc7ad..caeafd9 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -6469,8 +6469,8 @@ struct field_modify_info modify_tcp[] =3D { > const struct rte_flow_item_nvgre *nvgre_v =3D item->spec; > void *misc_m =3D MLX5_ADDR_OF(fte_match_param, matcher, > misc_parameters); > void *misc_v =3D MLX5_ADDR_OF(fte_match_param, key, > misc_parameters); > - const char *tni_flow_id_m =3D (const char *)nvgre_m->tni; > - const char *tni_flow_id_v =3D (const char *)nvgre_v->tni; > + const char *tni_flow_id_m; > + const char *tni_flow_id_v; > char *gre_key_m; > char *gre_key_v; > int size; > @@ -6495,6 +6495,8 @@ struct field_modify_info modify_tcp[] =3D { > return; > if (!nvgre_m) > nvgre_m =3D &rte_flow_item_nvgre_mask; > + tni_flow_id_m =3D (const char *)nvgre_m->tni; > + tni_flow_id_v =3D (const char *)nvgre_v->tni; > size =3D sizeof(nvgre_m->tni) + sizeof(nvgre_m->flow_id); > gre_key_m =3D MLX5_ADDR_OF(fte_match_set_misc, misc_m, > gre_key_h); > gre_key_v =3D MLX5_ADDR_OF(fte_match_set_misc, misc_v, > gre_key_h); > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh