From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50040.outbound.protection.outlook.com [40.107.5.40]) by dpdk.org (Postfix) with ESMTP id EEBBB2BA2 for ; Sat, 19 Jan 2019 08:15:05 +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=w1x+d29tW+RphbUVkr6zAdKqcBm+hjtARM60PzPo9A8=; b=Gzm0gnjDcuy2eT7BsAdSZaNeJs9WmoparfTFDRDnZKFohY5TyeBy4SpjYZdr/4/r3DiWABJaHMLxHJFz0vTwrWonGwFJC/QB+6LTKHYs0Pfag2DT4gUyvVY5JQj2KW23yM9IZYBcSRn++xTPZsqVsOGFhFSmD/T40Mtgcrh0rik= 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.1537.27; Sat, 19 Jan 2019 07:15:03 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1da8:cd09:4e78:111c]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1da8:cd09:4e78:111c%2]) with mapi id 15.20.1537.028; Sat, 19 Jan 2019 07:15:03 +0000 From: Yongseok Koh To: Daniel Pharos CC: "dev@dpdk.org" , Dekel Peled , Olga Shern Thread-Topic: [dpdk-dev] MLX5: Array written to out-of-bounds when freeing memory Thread-Index: AdSvVFz67lu5CZjxTiSR721bKdwf6wAclVOA Date: Sat, 19 Jan 2019 07:15:03 +0000 Message-ID: References: In-Reply-To: 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: [216.9.110.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4041; 6:utlZ8W0EyUiqiO9Qfqw/V5OKUYGWQJaTTtUoQGeafVFTu+k+u/99B8WZ++P4AHDS8lMG5zpFKCkdSSI0Autl+Ra+0n+J/HLFQV6OgO1x1mwbXdQew05/9wY7lsjKvLucj5N+hEj5XczAdG1gNGwlYjBxr+05CFlfw8SExK+0ekqUeLFy13gz33Y1xo78OgB620tE51FRp5CEz1ZHt+m+qafj0jH5B6UPtptlnwCuoYEwJUwDSNcEq77Buwi6V9Eh0gNr7r/FpNtGiymbq0xgL88BTwUcK4uaRsxSzP/mjWvbsZxF6UwNG9dxWUFytrSPTdFJycfy5QKkTE/Q0IonLA3PeA1LyvWv0DfVdNveCIRmBkusUcoU/iITA6UbzwuElTR18clmxifHu0BU2pwe/UuiDm/cl7brvinpZcGWPuGof1XydW8GwuIavpqCHxg73zpXJhcUwGh5iX3B+dc2ag==; 5:sx35n4RRJ4ms701zIt0qrDgnYpqBpVT6MhUpMiIMJL4DnoyVYKLyrLmlDkU2Pbtkw3wRt/GUIjYXXN8whNx2BDp3zPWPusHauRaWQd/52GddwIFzzcF8TumTNP8paQJpBwWoKvoajq4yvawO/zgf0QnNSaKKcjyFjNbYLAfH9AOmMwG+FzK+XL7Bl5ZbTMehMdExd6iLrt+zidvLLlIOvw==; 7:VFmcMjoniVKIWPy0ppu+N7TaogO69G/6z1LnwMY0LLfV6oFV/J25qXRrx7/5FeNfeZfomUvXJPb/7I0OwSBUUAhKHNhuiL6jvQVTLn6EeMEzQUsgH6fXS9oDNqMuywJjtT41F0jRI0v7Teod+PqGjQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c36bb315-2ff0-4cf5-aab2-08d67dddd52c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4041; x-ms-traffictypediagnostic: DB3PR0502MB4041: x-microsoft-antispam-prvs: x-forefront-prvs: 09222B39F5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(52314003)(199004)(189003)(71190400001)(2906002)(4326008)(54906003)(105586002)(6306002)(14454004)(316002)(106356001)(53936002)(6512007)(71200400001)(39060400002)(6116002)(3846002)(83716004)(6246003)(66066001)(107886003)(97736004)(478600001)(68736007)(966005)(99286004)(45080400002)(25786009)(446003)(5660300001)(2616005)(6436002)(476003)(11346002)(486006)(53546011)(6506007)(8936002)(6486002)(7736002)(81156014)(81166006)(8676002)(6916009)(82746002)(102836004)(86362001)(229853002)(256004)(76176011)(186003)(36756003)(26005)(305945005)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4041; H:DB3PR0502MB3980.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: UVPd64rBO67nQLlUyqP017xQOcc06WdEdxmk5CbG29yU/sPnhtqdN/vlT7i9pEiReFITSzJKhjczW3RgEydoR2tkcw+409TZtGG1bBTtCu6kW891tGCJvxlHcQfvXu3bxQf7DF2oUaRxF2+bInhR4X408yngYnV2Io08OO6F2xEcH8TmNWeT2ABEIoM2Ziq/Cq7rOILd0qYnrQs2nK5HVxCVhq5b3qSh4S0Ys5XM6O1kgFc7hsQQmdZYl/cyb0U8B0Oa2AyFDR8Wh2ma8nmYCm3Gr26UAWg1MgKOkW9EU8VjFKN8sOcDaj5smAS4QyJP0d8hLiwoONb5qKpESJhJURU8ac/JwKXswYQVh/jlHfoK1A867lhduSxMkUqHc4GyjuFQXcN4Cna58V2zWdTwf8DCr+k13kD7J5DnkjWlSwc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c36bb315-2ff0-4cf5-aab2-08d67dddd52c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2019 07:15:03.6181 (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] MLX5: Array written to out-of-bounds when freeing memory 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: Sat, 19 Jan 2019 07:15:06 -0000 Appreciate your report. We are aware of the issue and Dekel is investigating it. As I wrote the code, I'm also looking at the issue. Will keep you posted. Thanks, Yongseok > On Jan 18, 2019, at 9:36 AM, Daniel Pharos wro= te: >=20 > Hi, >=20 > Recently I had the privilege of some play-time on a IBM Power 9 machine w= ith a Mellanox MLX5-card in it. However, I encountered a seg fault problem = using DPDK and DPDK-pktgen. It's the exact same one as somebody else encoun= tered (also on a Power 9) here: > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugz= illa.redhat.com%2Fshow_bug.cgi%3Fid%3D1634159%23c10&data=3D02%7C01%7Cys= koh%40mellanox.com%7Ce3e3546283b64a84e3b608d67d9acf8f%7Ca652971c7d2e4d9ba6a= 4d149256f461b%7C0%7C0%7C636834501198813346&sdata=3D722uRuNvcISF69NTrqwF= ldzIPC%2FP8Wz3CDKPutStWP8%3D&reserved=3D0 > It looks like it's writing out-of-bounds on the "free"-array in DPDK. >=20 > Reverting the patch that added the bulk-free ( https://emea01.safelinks.p= rotection.outlook.com/?url=3Dhttp%3A%2F%2Fmails.dpdk.org%2Farchives%2Fdev%2= F2017-June%2F069154.html&data=3D02%7C01%7Cyskoh%40mellanox.com%7Ce3e354= 6283b64a84e3b608d67d9acf8f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636= 834501198813346&sdata=3D73up%2FKm9SZHBTdu64f5guSojTGNTFRkY7ePrBal7Bvo%3= D&reserved=3D0 ) indeed makes DPDK and pktgen function correctly. A bet= ter workaround I found is to change drivers/net/mlx5/mlx5_rxtx.h, line 580 = to: > if (likely((m->pool =3D=3D pool) && (blk_n !=3D el= ts_n))) { >=20 > I'm not familiar enough with the code to understand why the array is bein= g written to out-of-bounds, and why it's only happening on a Power 9 machin= e. Unfortunately, my play-time is now over, but I thought I'd report this i= ssue anyway, so hopefully it can be investigated and fixed properly. >=20 >=20 > Kind regards, > DanielPharos