Message ID | 1541843951-31708-2-git-send-email-viacheslavo@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Shahaf Shuler |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF0A84C77; Sat, 10 Nov 2018 10:59:29 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by dpdk.org (Postfix) with ESMTP id 439E92BCE for <dev@dpdk.org>; Sat, 10 Nov 2018 10:59:26 +0100 (CET) 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=UBiMf37nzO8NlsK/Tgq25Ir2t5hahY/cW2vcpewTSnI=; b=P1U7o1nEc51NN6nvn+5PyrzQmaNDIMLT1SeETXY0MzubOBRJhUaheMS5lJ0oWQGTFp034YAIpVbNZQPfMU1c7S9T99HB3NkQoc2AFviZb8PZ3Tbf9yz+ZuEWHZXVQvlhFMCiVR2wct175W5jNfALm6xy9zjAg+bQaoYCYfEToq8= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB3250.eurprd05.prod.outlook.com (10.171.186.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Sat, 10 Nov 2018 09:59:25 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1294.039; Sat, 10 Nov 2018 09:59:25 +0000 From: Slava Ovsiienko <viacheslavo@mellanox.com> To: Shahaf Shuler <shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com> CC: "dev@dpdk.org" <dev@dpdk.org>, Slava Ovsiienko <viacheslavo@mellanox.com> Thread-Topic: [PATCH 1/3] net/mlx5: fix buffer allocation check in rule cleanup Thread-Index: AQHUeNwPk5GfgS5PhkubI3ARWMkxnQ== Date: Sat, 10 Nov 2018 09:59:25 +0000 Message-ID: <1541843951-31708-2-git-send-email-viacheslavo@mellanox.com> References: <1541843951-31708-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1541843951-31708-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP265CA0342.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:5a::18) To AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:4::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3250; 6:NLRiB5AxUHeX6vytS45RPi1PBG+jeWFzseRBNrfVxPKBMQnkBMz1XiC/eqhXCHJG6YqBI1gxbA57gnbd33ameI+lLBcbwqSKcPMDuMHjVXlSgvjPlHd28izJOBMmZ1B6EScte23jw4H2WmBKp5eUaWAvETBibyucOlVUOEbCZ/tFc4WTECeTIzD7kExa8v45pqfHVLJA6eW5ZY3pQjWlQ9NG/z17tePs05V0obMbqJRO+x1ZnMgF7hZqhFL0aYx5pd70MT/t155bJ/jwKaBpD2Im0mtH9sMOnk/70PTvr1hLxRwsYTlxCOR2VrdN74MRMZV7hvQfRDxF0kXYOe9BsGoH5khc1nvfS7jvecnn2x4eY0W45Wk4xkjInqG6liBLHTTt7yq/2p3z1e8weTd8xjqW0unkfqGB8fzL7rfQ8b8oeWHUMQ/uxfnqIAZPYJxhQRu2QFN/pBeq0s2yP1n84g==; 5:knwOWzRrL5Jb6aKJwGpl12nXAnme3sJeJCSW1k29s4Xx5nBotgoAlYwyVhHP82k4UIzxkv6DLgzI+iGFxojmtVCiS53MoIOnEgrsnov8+T7i9+oI0KnC4VklY6A3ucZJevVWFswTRl9EsNJ+nU01gZv24wGgwA8Z6tcxmOrj41M=; 7:UFgCSePQwrEXz1nIzP41pSNUyr256luiYfVotux6qVfR33W4rWquuJfBvIg7qd1ux8lwDIPnFVyzHW8Igdn/xpHddUY/g0lMNxtAOIG/mG7LV5wzB4d6k04sEQ7/9Fc+UttWCmejEAWXUYKGNcudSQ== x-ms-office365-filtering-correlation-id: 864e44d4-dbfd-4281-0502-08d646f3320c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3250; x-ms-traffictypediagnostic: AM4PR05MB3250: x-microsoft-antispam-prvs: <AM4PR05MB3250EEA62763CB9709465C1FD2C70@AM4PR05MB3250.eurprd05.prod.outlook.com> x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3250; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3250; x-forefront-prvs: 0852EB6797 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(346002)(136003)(366004)(199004)(189003)(2616005)(11346002)(6436002)(476003)(486006)(4326008)(7736002)(2906002)(3846002)(76176011)(186003)(54906003)(105586002)(6486002)(6116002)(446003)(305945005)(25786009)(110136005)(66066001)(386003)(6506007)(14454004)(102836004)(36756003)(52116002)(81156014)(97736004)(81166006)(6512007)(106356001)(8676002)(2900100001)(53936002)(107886003)(316002)(478600001)(71200400001)(99286004)(8936002)(68736007)(14444005)(6636002)(256004)(5660300001)(71190400001)(86362001)(85306007)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3250; H:AM4PR05MB3265.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-microsoft-antispam-message-info: cJZ236l01wQZc11vmao5BcxHyUtuMtgaaR7SBoUERdYfqVO89FUftTjZxtUju2Ucf22fY3uIF9uXPiZaRsan6IzS03blxbplvurrLRgXM78p6byTD90hFPURWLp8mg+UnSJ/cahRMyMlX/LVREcM2vd/776sFriUIWj2s4tPAIsaSoE7mtTlI7enXanU0B6c82WvEhUlT/0LvCRwQLgqpiePj7+80Kvr2O7EM68wZboWc3MoKrQC+yjtS29VCHhnI/ATI8CU4/JuSfVQAE8/94JpAXXCJoEcFxSD6yhV3I96sjAmtgHk5gN9SJ7OSTHU181NWuW7miIiUt3k5JNdNJFDkRINOjeeNoFs8XU5vYc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: 864e44d4-dbfd-4281-0502-08d646f3320c X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2018 09:59:25.3261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 Subject: [dpdk-dev] [PATCH 1/3] net/mlx5: fix buffer allocation check in rule cleanup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
fix VXLAN related rules cleanup and management
|
|
Checks
Context | Check | Description |
---|---|---|
ci/Intel-compilation | success | Compilation OK |
ci/mellanox-Performance-Testing | success | Performance Testing PASS |
ci/intel-Performance-Testing | success | Performance Testing PASS |
Commit Message
Slava Ovsiienko
Nov. 10, 2018, 9:59 a.m. UTC
The Netlink message buffer is allocated and there is the typo,
the other pointer is checked instead of returned one. If no
memory is allocated and NULL is returned by allocation routine
the bug causes segmentation fault. The patch fixes typo,
returned pointer is validated.
Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
drivers/net/mlx5/mlx5_flow_tcf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> On Nov 10, 2018, at 1:59 AM, Slava Ovsiienko <viacheslavo@mellanox.com> wrote: > > The Netlink message buffer is allocated and there is the typo, > the other pointer is checked instead of returned one. If no > memory is allocated and NULL is returned by allocation routine > the bug causes segmentation fault. The patch fixes typo, > returned pointer is validated. > > Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines") > > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> > --- Acked-by: Yongseok Koh <yskoh@mellanox.com> Thanks > drivers/net/mlx5/mlx5_flow_tcf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c > index fb817b2..ba0674a 100644 > --- a/drivers/net/mlx5/mlx5_flow_tcf.c > +++ b/drivers/net/mlx5/mlx5_flow_tcf.c > @@ -4226,7 +4226,7 @@ struct tcf_nlcb_context { > vxindex = ifm->ifi_index; > cmd = flow_tcf_alloc_nlcmd(ctx, MNL_ALIGN(sizeof(struct nlmsghdr)) + > MNL_ALIGN(sizeof(struct ifinfomsg))); > - if (!nlh) { > + if (!cmd) { > rte_errno = ENOMEM; > return -rte_errno; > } > -- > 1.8.3.1 >
diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index fb817b2..ba0674a 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -4226,7 +4226,7 @@ struct tcf_nlcb_context { vxindex = ifm->ifi_index; cmd = flow_tcf_alloc_nlcmd(ctx, MNL_ALIGN(sizeof(struct nlmsghdr)) + MNL_ALIGN(sizeof(struct ifinfomsg))); - if (!nlh) { + if (!cmd) { rte_errno = ENOMEM; return -rte_errno; }