From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00071.outbound.protection.outlook.com [40.107.0.71]) by dpdk.org (Postfix) with ESMTP id 89CD62E81 for ; Sun, 11 Nov 2018 12:35:58 +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=kxahbJPbf6TpKGz0IXw/WLIfiNLnB+XRPIVTy3GlxII=; b=cvvx2A2AqAtq+HaXEXqMxrtQSyC2IYnX5HmDDQ4JVfrrGCpsC6H9WTwXPfNe2JdUeqdBf76LEf0yq1QhowV56tIo6347qgQvk8mv2qrEzv+QOJFsHZ/nkesXN6RDmiCuxMwd5mNPTRTv8ig6fpRnYSFu+AMWcoyJMtyJQx6KgPY= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4041.eurprd05.prod.outlook.com (52.134.66.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Sun, 11 Nov 2018 11:35:56 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323%3]) with mapi id 15.20.1294.044; Sun, 11 Nov 2018 11:35:56 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH 1/3] net/mlx5: fix buffer allocation check in rule cleanup Thread-Index: AQHUeNwPk5GfgS5PhkubI3ARWMkxnaVKc7KA Date: Sun, 11 Nov 2018 11:35:56 +0000 Message-ID: <2486ACAF-F1AD-435C-8433-57FD1FDD6BD0@mellanox.com> References: <1541843951-31708-1-git-send-email-viacheslavo@mellanox.com> <1541843951-31708-2-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1541843951-31708-2-git-send-email-viacheslavo@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=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4041; 6:Ailus7HzJsnh844lGWN2834QSFwnmqAB0sETw61BbRYDo2+zTjlchEzARCQn+v3WgsGZV37pY93KJXyHayw2P4mCA3L4GjBZ0bSs7BlOKoNvKy8Il9VZJ6CVZ8wZaiLZAP+ekNM8r4rJqAJrkcQ4KT2fmrDvvPlxgrQtJ1Uq8w2GXCcxwvKLb0ZIUc2WEi6ZbmdCiBudb0tRgNvHjJ25x4ADBG7U8+IVETo6kdLKLfZ+81t66AQhYsRBs1fuTi83RGn15NYMJucAEI+nqTVfcT+kgFx+Q4cBDRzfqds7kHKKvP7H33kKU9xAk3mhTWXgCGYpqFhG6AzqHBRsUxcvY1O3nxO5HLkVyYmBBSkmtXqe4iElm9FRB9PcXesI1GJRwDjjdJfux31QpI93qH/+dds/JokJcEIbXIk6bQpu4BeKd6FP5dKfaCHl8aZpwGg9nmEXDmsSOEOenDRWXthJzA==; 5:P3fSVJBckFrEUx2e5Fmmru/y5lJmJklCHXUv9z946NInFbxjuqY301LIqDR33VkOxD9Ie/4LCYnYgfdr+iCiV1ebNutuS38eRqnvUfM8rwbW6/j42GC5f+ODEzpuzji3xAnr2WJGYDx+jlQXlzmN9toW/KICijm6R29lpJZ8l+I=; 7:v1/uLi2fas1ueC9nJkOOxW5vACQnTPlntUGHr5a491bVTyVdgPfa+IrV+QP1O+ZHp8OtmadQKTaN/3li1MHS1V+jUXXlT7maCWsoq1fCJOsTRr8P0X0g+Ao7JS6LhLznIF+RB0uvaU2SOZYkpEF/uw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: d04c1a78-652c-46e4-d402-08d647c9d895 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:DB3PR0502MB4041; x-ms-traffictypediagnostic: DB3PR0502MB4041: x-microsoft-antispam-prvs: 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)(3002001)(3231382)(944501410)(52105112)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DB3PR0502MB4041; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4041; x-forefront-prvs: 08534B37A7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(136003)(366004)(39860400002)(189003)(199004)(2616005)(6512007)(316002)(14454004)(3846002)(2900100001)(2906002)(33656002)(97736004)(305945005)(6116002)(14444005)(476003)(76176011)(7736002)(11346002)(99286004)(256004)(106356001)(6436002)(6246003)(81166006)(102836004)(105586002)(81156014)(8676002)(6486002)(4326008)(25786009)(5660300001)(53546011)(8936002)(6862004)(6506007)(26005)(68736007)(486006)(54906003)(82746002)(478600001)(446003)(229853002)(53936002)(71190400001)(71200400001)(186003)(66066001)(36756003)(83716004)(6636002)(37006003)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4041; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KWmJKzrb8Rj708Xq/P7od6+G4fu+rEEfhuaZtyM+J2/Mmv2TdyXQtWMPlx3tZlvHVqyRrx8lA33zeMLy7gCZTCJYTMPxCa3vfLemh8S9nnyZBh4INh8ygxk5EZAzaMDU8Qfhh1EG97LvVUptNi4/CfaBZZaazrJl6qrroy92RzP4ocC0+Ubs/Nuh47yi9oudjUot5j7Jtw3k165rOa2OP72WJLW2Fi8uO7gY+FRSv8RegVzTvJ8SX1xBpW+83S0zu+0ix6hBhjFYUA/vF+rme0LFKRYIVVwKYInUY0U7XVYqamJypFaczJUTlWkuzVIvrc29IF8qN+8ZzVN+falCBLF2nIMx43Y36APxanJHxwE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <23E712DCD0420945B24EAFDBF64A8179@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d04c1a78-652c-46e4-d402-08d647c9d895 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2018 11:35:56.6575 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4041 Subject: Re: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 11:35:58 -0000 > On Nov 10, 2018, at 1:59 AM, Slava Ovsiienko w= rote: >=20 > 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. >=20 > Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines"= ) >=20 > Signed-off-by: Viacheslav Ovsiienko > --- Acked-by: Yongseok Koh =20 Thanks > drivers/net/mlx5/mlx5_flow_tcf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flo= w_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 =3D ifm->ifi_index; > cmd =3D flow_tcf_alloc_nlcmd(ctx, MNL_ALIGN(sizeof(struct nlmsghdr)) + > MNL_ALIGN(sizeof(struct ifinfomsg))); > - if (!nlh) { > + if (!cmd) { > rte_errno =3D ENOMEM; > return -rte_errno; > } > --=20 > 1.8.3.1 >=20