From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F160A0C47; Fri, 11 Jun 2021 06:42:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E93064067C; Fri, 11 Jun 2021 06:42:44 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 7361D4014F for ; Fri, 11 Jun 2021 06:42:43 +0200 (CEST) IronPort-SDR: Z9GJq6t67Pz+6YqmGp13HFMHn6QcCrJ0O4JONAymbuZRSZcs+j/FMeaOOgHvHj2eh4PH2FSg4X rkW4lCZGFO+g== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="192570650" X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="192570650" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 21:42:41 -0700 IronPort-SDR: aJmyhIaOp6rnjiL2jSQ34FRTRvjD7v0BcAS0IPW2mqK8b4z3l0FMA4sEQ8TBcEIXGyeV6kIh8J TqEDCYqSmhCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="450635208" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 10 Jun 2021 21:42:41 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 10 Jun 2021 21:42:40 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Thu, 10 Jun 2021 21:42:40 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Thu, 10 Jun 2021 21:42:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H0VaOalPnUW9kRwNB9jZOdBVTRzeHb8Z4oMTvhmRRanchkUiiDV/a6rFRXMyDEg6Sd/Kxn9kIOcnyNelGAnfGPIooR/47oXGO65PB4IfHwgviUsNMxkwIBH2zvIVFB/NW7+raaWWIlpQPo9pot8tRBnsMct6V5xyWCNa8M8pOshtzqzqkxgKnn+frPCgPNW8XWv/vFwHv6f0dmVaCyg/q0eAx2b22B0miuFG0ja7iGED2l03/A+y0Be3W7cheXHwfTjr+d7FjROlmPa62qQDbPgdVcKxbm3See2tARL95snUOebhfGi1pguPeDg2c9hYmQfOWzvHFZRellkBkl9UnQ== 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=/4N08FDrfMN+64z77u5i57y9LE1mdhhEFN19CvP8LKs=; b=G+/b6WBMs3PwBXdAUBKosHaq5eYCj/K8KLOhOO4HsEaXaPAn73FHnj219xJOtpkBTFJ5jaWeJPfs3x815tCGskAytocaigNRYyHyjoSNLnC5cDHkgU/aOqBRktxVTe+iyzk4o8AtoH/RV4PaoLJ1DiyfMmleNJIyWPW4/N0w1dHm+yFXpwAGGh3ej1nSikKNrORpbiB39rb7Xyc+oLR40lpPtp08LMod7Ssv+IFfxKGyFc1nY/kEncrNKQ9FwnFOts9yAH4wBFI6KJW9uU5eavliPHplx2CYyRNBh07MneAPe0OkKkm4Dke3E9YtsH1efLLnnsCmVlcFIv+zZCJaoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/4N08FDrfMN+64z77u5i57y9LE1mdhhEFN19CvP8LKs=; b=zuKq9qscxVAWW4i6FHWpApNCyD4wI0znfiw5T9+eBbM6oOOWt5CBxz2oHSxQY0yA6Zktv8mfrgbnvum3Mj6JRsz/gOwFYPsP7njrZcUZiX7lJGinv3okB+CFARQIfFLv80gZ34CW3JOpxd/oq4LthORJnxf3rDLlscLXn1WjTpA= Received: from BN7PR11MB2658.namprd11.prod.outlook.com (2603:10b6:406:ae::16) by BN6PR11MB2035.namprd11.prod.outlook.com (2603:10b6:404:3c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 04:42:38 +0000 Received: from BN7PR11MB2658.namprd11.prod.outlook.com ([fe80::152:a489:e4ab:faf3]) by BN7PR11MB2658.namprd11.prod.outlook.com ([fe80::152:a489:e4ab:faf3%5]) with mapi id 15.20.4219.024; Fri, 11 Jun 2021 04:42:38 +0000 From: "Lin, Xueqin" To: "Richardson, Bruce" , "Peng, ZhihongX" CC: "Burakov, Anatoly" , "stephen@networkplumber.org" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC] porting AddressSanitizer feature to DPDK Thread-Index: AQHXXbgLxn7WkPyP3E6D8H20N7Dp+6sM6vIAgAFRd5A= Date: Fri, 11 Jun 2021 04:42:37 +0000 Message-ID: References: <20210610051352.48493-1-zhihongx.peng@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7b4a6e62-0a54-4e83-9de0-08d92c9356fd x-ms-traffictypediagnostic: BN6PR11MB2035: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SQK2KnTlKQ9G/S22lS7DuN8c+ez23feiXxNw10U3DMuPtUe6YwpN8420J9XRABU6N9fr8UWenhcvgeNpGHh/79b6jbfgbAOsZP/v8h2Qgy7/FDk54uiURsAbbBpcIjVv6Kw18Tde6JhjmVXJaoZirQJ/gmPXDA7a02rpMONZsUvGhQs82/dlnR4M9hAYGq8sx8fACE3SvRB6g3C6nRgs21tlto/DEvVCzJ54gUFBx71UsRwtzIq/QnHfxHD1OPYPZZplf5d7a88MCTYfojUDEy+UeOrMVAX5MXfbH2uhhvgCtjfExKsdM9R/teefz0rHAhmCU47joMYHGxc/d231Q+tmh1qiS05a8L+6NSxvI9oI01Lk3X8rQ4Yf0Zsr/wu/tBwwtRHmaHBHWMSA+xGT+RTPGUmhmPpfu3TyvCyK6YnQ8evhB3eotVRI6h8r7jJseYtRs3TuWmSe4OvM8ZMRyiDUrPKfbIbiRDyO0nfXIDARtPkHcLjtRcvnJiUqBn376Cd3Adkf6g9jOZL+T5QY0Kjv74Zl5N+wuvR+xVYMCDfGuYOqRAt/4AOKD65Ai4k20ZcPO5DJzXlr+DvS+MhJKE96S6j8fsfbfpPE3UICyF01oM5Zx7MUBtJ6Gq0e84MxTpGcxz7fTln0W9KfHM5NQo3+Hl6LbOSnKgLgu6Z52h0QFVk6lmhiTV5PHVdhMl5gh++uFJJNxBO+ImO/Ne+fmEKmVbUB23wAK+Eib6EbgfvnrPdZpSv1kfx4ifgXjkFrh3CUhKSh+/dNNby2BIEWfQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN7PR11MB2658.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(346002)(39860400002)(366004)(136003)(76116006)(6506007)(4326008)(64756008)(54906003)(66556008)(66446008)(66476007)(86362001)(66946007)(53546011)(33656002)(186003)(71200400001)(6636002)(52536014)(110136005)(8936002)(316002)(5660300002)(478600001)(26005)(83380400001)(2906002)(8676002)(7696005)(9686003)(55016002)(122000001)(38100700002)(49343001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0Ge5pgVh+vD6ZuPuU7NRlHGXPv+Oy25t048XbPycU8tDZN4QAEqG0YN63TJy?= =?us-ascii?Q?nhbD97Cb59U68IlcH15OpP+UAruZuf1f1gLUzJIRzw9NCfRe2VvofLwyD65i?= =?us-ascii?Q?AL8POXILihWUg01ypmV1Su/U6JzffPtIiavJMInSxRs0QgBeqpp9nCbbWLNk?= =?us-ascii?Q?PhO6IP9MzhCl2Ww7mO6hntHLnJIN1KhbkEC/wl3WjtFnQQ7mKMOMdSXHpmPM?= =?us-ascii?Q?/HyULqYB3/YDy857Nbv6FdU6vjbLs7x9seOkGm82ReV7diNeYFFGKK3KXWea?= =?us-ascii?Q?pDWOFkRASF1aB6cpJEgti6Ha5/QXigbJk+zlrc94cJx2ZF8yeuIY4sCR5Ihm?= =?us-ascii?Q?Z1KXI9q/y2RKjQ1AtVs4s85GIoC5QGQi50mTvnGjgd6REu8gPuHilbNiLUWO?= =?us-ascii?Q?MPb0p3kR8tLpzDzSYpCXG1oQHVaaCOCn9S37CvOqGHoalv0bAYgP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YsAlcT?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN7PR11MB2658.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b4a6e62-0a54-4e83-9de0-08d92c9356fd X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2021 04:42:37.7034 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pWyxAsRZLdnGm0R3wzX1cd+uEMOSOGcM30XfylzJrM9sZrA7olKlGB6n5vRG2+xgotZ6dLOgaxaoPB0JCf5gkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB2035 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC] porting AddressSanitizer feature to DPDK X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Richardson, Bruce > Sent: Thursday, June 10, 2021 4:33 PM > To: Peng, ZhihongX > Cc: Burakov, Anatoly ; > stephen@networkplumber.org; dev@dpdk.org; Lin, Xueqin > > Subject: Re: [dpdk-dev] [RFC] porting AddressSanitizer feature to DPDK >=20 > On Thu, Jun 10, 2021 at 01:13:52PM +0800, zhihongx.peng@intel.com wrote: > > From: Zhihong Peng > > > > AddressSanitizer (ASan) is a google memory error detect standard tool. > > It could help to detect use-after-free and {heap,stack,global}-buffer > > overflow bugs in C/C++ programs, print detailed error information when > > error happens, large improve debug efficiency. > > > > By referring to its implementation algorithm > > (https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm), > > ported heap-buffer-overflow and use-after-freefunctions to dpdk. > > > > Here is an example of heap-buffer-overflow bug: > > ...... > > char *p =3D rte_zmalloc(NULL, 7, 0); > > p[7] =3D 'a'; > > ...... > > > > Here is an example of use-after-free bug: > > ...... > > char *p =3D rte_zmalloc(NULL, 7, 0); > > rte_free(p); > > *p =3D 'a'; > > ...... > > > > If you want to use this feature, > > you need to use the following compilation options: > > -Dc_args=3D'-DRTE_MALLOC_ASAN' > > -Db_lundef=3Dfalse -Db_sanitize=3Daddress > > > Rather than forcing the user to pass in the extra c_args, you can > automatically add it from the eal/meson.build files. Something like: >=20 > if get_option('b_sanitize').startswith('address'): > cflags +=3D '-DRTE_MALLOC_ASAN' > endif >=20 > /Bruce Thanks Bruce for your review, really good suggestion for this part optimiza= tion, we will update it.=20