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 AF0F8A046B for ; Thu, 22 Aug 2019 10:49:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5375E1BF57; Thu, 22 Aug 2019 10:49:21 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10084.outbound.protection.outlook.com [40.107.1.84]) by dpdk.org (Postfix) with ESMTP id 4882C1BF4D for ; Thu, 22 Aug 2019 10:49:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Faab39lh85l6NCIb06/p/jFe23QH3wPYKIEnH3IzuSOij3r5UbMo8BNSHIj5M7pq1Wf7RYHLgzQkgzTmQKcxo0Y/ns88I9WxYNNagQENVKzFaTjxJZSoBhsniB1mmOOJhIw6vJrDtm3KSEcPn3FKD49IM6ddgeqa8O/P4q6JmkLOc+52wfzmVys4IjjhnHg/TXG3h7/hTCV2FUsSWR7+lc1xglDDxoYwlGxQe1fmsyqKAfk8dnPOsXJWB2yoPdsE1NZl51nmPvdtdzlT/Rfdap9jnCeAupDfGLRYL64Qxjgxjcb+ky5hBOapMyOwKmB1iczHfY8F/fpZ5ZAjn0x75A== 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=0F1/n9BXgZqUz7r+dICEf0agYtXf6Al+LAyGy42lEhA=; b=VCpf9RhGU7arK7AuzyXDgPtj3Zb0cy+l3wkaYzxe/lJyE+er/Sdxu0y7E4LilxBHZWJlJGlz4aStYcX0rM4gXi5CsXK0NQMq7Bo0lBqCgGE9V0+DpyIoaSsFCGxjTmVxseEqRIMx/bw9sT4Hmn9/Md217l/643qRMeIgLC76NnXz56Ha0iz7T+sMV45UONAUoPn4iUr4xGEnKwOrYY3BrJAxE193H/cukg2/9hskSsZImzoagUeU+zsLDu8YqLwWRchqww3Wsho3UN6vV/GVDMSF/CBVUmRHLb0dEoW4ktzXq8TpyWwp9RfJ0zge+oBWxwF+0wXqDcR34ni5VEtzCg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0F1/n9BXgZqUz7r+dICEf0agYtXf6Al+LAyGy42lEhA=; b=cR7f4Nn3Qd4R/0WY2MIyQ1HrvRy70mIhrPQ84CexUSlaqRHzp2Vultnll7QjQPTL5DWxOnXrrAvIUzorwgxH/JKHNH5A0eXB3GL0i8BOw7Z2jCsmm/IewAX37PD5wmF2/1enB4GGM9QMRpuk7M0KgUB9+2k+7Zg4MfAJBPSpbUg= Received: from AM4PR05MB3460.eurprd05.prod.outlook.com (10.171.187.153) by AM4PR05MB3251.eurprd05.prod.outlook.com (10.171.187.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Thu, 22 Aug 2019 08:49:17 +0000 Received: from AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::c55c:76a8:69fa:3901]) by AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::c55c:76a8:69fa:3901%4]) with mapi id 15.20.2178.020; Thu, 22 Aug 2019 08:49:17 +0000 From: Dekel Peled To: Jack Min , Shahaf Shuler , Yongseok Koh , Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: raw encap data cannot be empty Thread-Index: AQHVVzxFQ0FVfiFaDUu/ogDvwcGzFKcG3fiQ Date: Thu, 22 Aug 2019 08:49:17 +0000 Message-ID: References: <160a20882b4d79a7e52645095bfdcff4f64c1724.1566294175.git.jackmin@mellanox.com> In-Reply-To: <160a20882b4d79a7e52645095bfdcff4f64c1724.1566294175.git.jackmin@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cf6a79f1-e5a3-4ad7-13f6-08d726dd9e14 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600166)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3251; x-ms-traffictypediagnostic: AM4PR05MB3251: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 01371B902F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(366004)(396003)(346002)(376002)(136003)(13464003)(199004)(189003)(14444005)(6506007)(66446008)(86362001)(6636002)(64756008)(66556008)(81156014)(9686003)(478600001)(74316002)(446003)(14454004)(256004)(476003)(186003)(11346002)(33656002)(25786009)(26005)(81166006)(102836004)(6116002)(3846002)(53546011)(71200400001)(4326008)(55016002)(6436002)(71190400001)(66066001)(66476007)(8676002)(2906002)(229853002)(52536014)(5660300002)(76176011)(486006)(7696005)(305945005)(76116006)(6246003)(66946007)(110136005)(99286004)(8936002)(316002)(53936002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3251; H:AM4PR05MB3460.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: 8AOmAKx/AoF4kRI/8mko1VTuo0DLdEJoSsCrhspWtty2WeC2cgXf4B50Ad27fCIvJSKi581XBohVVZ/2zFwI50HTQera9UFHR3abPy9Msz3LUcSB84rA6F/PvtGEU35iIbToo+DFKkA2OSIDpSwzXHasA5gvfpFOCDMASubHgivYfY981ibi/KWNmsrZmWrTcz+cLyh/f6qfEKyxDDfTlYzsR3QpgFUs0iROL/JVzk5z/+WJuMxWaBHQp9ZMLUz2sepy2XX6JDvxOo8+CgffhVH2UczAHrg0sT3kP4Fl3Dz/lBVOOmOMbWn5+stc4SdVCxsnwl90P8u31kod4HQeHUVmBnz8fyFd0xpwxbDfihaIce+lDDg0mJhZDzy4gs7gQcu7Jrgfw1WtZJGqq9VdRMEYBnHjUgj9Beux7Ncavlg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf6a79f1-e5a3-4ad7-13f6-08d726dd9e14 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Aug 2019 08:49:17.6859 (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: 8Gsscz2zXH5r/lMB2m3CBln/fmrewqLnlfKakDfgyYBkPAQDQkkJeZxNFVR69lrLe6UY8KdJS30tfTy6p0AbFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3251 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: raw encap data cannot be empty 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" > -----Original Message----- > From: Xiaoyu Min > Sent: Tuesday, August 20, 2019 12:47 PM > To: Shahaf Shuler ; Yongseok Koh > ; Slava Ovsiienko > Cc: dev@dpdk.org; Dekel Peled > Subject: [PATCH] net/mlx5: raw encap data cannot be empty >=20 > For the rte_flow_action_raw_encap, the header defination for > encapsulation must be available, otherwise it will lead to crash on some = OFED > versions and logically it should be rejected. >=20 > Fixes: 8ba9eee4ce32 ("net/mlx5: add raw data encap/decap to Direct Verbs"= ) > Cc: dekelp@mellanox.com >=20 > Signed-off-by: Xiaoyu Min > --- > drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index 21faa98ec3..41500bc109 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -949,6 +949,8 @@ flow_dv_validate_action_raw_encap(uint64_t > action_flags, > const struct rte_flow_attr *attr, > struct rte_flow_error *error) > { > + const struct rte_flow_action_raw_encap *raw_encap =3D > + (const struct rte_flow_action_raw_encap *)action->conf; > if (!(action->conf)) > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, > action, @@ -970,6 +972,10 @@ > flow_dv_validate_action_raw_encap(uint64_t action_flags, > NULL, > "encap action not supported for " > "ingress"); > + if (!raw_encap->size || !raw_encap->data) > + return rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, > action, > + "raw encap data cannot be empty"); > return 0; > } >=20 > -- > 2.21.0 Acked-by: Dekel Peled