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 7636E41E27; Wed, 8 Mar 2023 15:30:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F4F9410EE; Wed, 8 Mar 2023 15:30:08 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id EFCA240FAE for ; Wed, 8 Mar 2023 15:30:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678285806; x=1709821806; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=837yk/WrK4oGz5H3qoRomMo04jJYsemgGwBGCFenJzU=; b=Z8eEqdLBodxRJO3DZKllSYsaZlDGX1eqvUk8PH7/ZkE71mRO9wAH/P0G Jlh+0yBHaoAgQQ2JXdpzwGPTKQW2oNzZjQasb5cQI59KvRxY1FHyhnvkU R6yreN8fp1mkAwa94HQjHQ5MWaS9AZ1DGeHNCrPPqpHxmFgPOHCHZSep7 dsLhJ4n8kMkB726Km2WNYXTRLFCheBSNJsqSia7p8/AMolJzpFUXIeki+ 5VVXcFxfPL+u+zxHdnlZ5cAV3UQskdHAQiVWV172JCBeec5t9R3PBMrKn 0v0vUahR9Y80SafOqd15iSM/WI/CsCtvRHj2Y/LJe+Tvdou25PaS+H08k Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="337681119" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="337681119" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 06:29:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="626928222" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="626928222" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 08 Mar 2023 06:29:40 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 8 Mar 2023 06:29:40 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Wed, 8 Mar 2023 06:29:40 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Wed, 8 Mar 2023 06:29:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IS7S44G9FH347j2qpQwQBnEVq81+GnbiNCAtDrg3dpc8NQcjpcxPSEib4APjYWLwWZQjpalpAsYAH0I3phmaUkG+WyJbP5Y1JZtdTJFQjhysJIslYmNEPEHIReEOqLsnSbbnJlzzrCdSXzEby43Puqx9OhGSKbE1+ML8tYaLgNf5VtjP3mzvQmXCsNuO8MPKp8WcTe5RrJxSEA1U6idESWcM61o713Us/4WM5dbJQuVDba3+8NOAgQaYpnxRBegN8ajQPC16qEE3dj61YeMnXEk5zqVYVBOikykBeqXvhsdeAbGxki55GUCrXT5mW+diDl853nyo4Nem5l+xGn9yPg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=roDqy1kPWKLUpVOf49oRjAX9iAk+XdANyFqRbuC//+o=; b=LwxCna3+RTRPzyqTnPUeGiNThuBSXgmWO+YgiMnUFC7M9eVXdUk7T0eq3g9YLbOj+jmfsA/ZSXZr/NWmg5Wqs0r70CmYHjhZTd2lypoV0OGHK2dSHrlDYFGC4I9Vsl/mAqS9bM31paaeLgF4gWdWGJdzGk0GCndh3pDipsSGx+VklNayr/OL6YhQZnp9ztcIHkd851U4/7aRaBlEGTkPfcGOEASPD7KF7xP2AtF3vXfI5AywgAS1Nx5IHSFO4ph2FbnSHoj8S3mNFTC2opYSHs8i5sZxWRBk1pgvziLOvaHjoHahONN/cGLYhaehW7Vb2m11drHtSgwgj6E+afga6A== 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 Received: from CH0PR11MB5724.namprd11.prod.outlook.com (2603:10b6:610:101::22) by CY5PR11MB6236.namprd11.prod.outlook.com (2603:10b6:930:23::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 14:29:38 +0000 Received: from CH0PR11MB5724.namprd11.prod.outlook.com ([fe80::81e6:4df3:9629:7ed4]) by CH0PR11MB5724.namprd11.prod.outlook.com ([fe80::81e6:4df3:9629:7ed4%7]) with mapi id 15.20.6178.018; Wed, 8 Mar 2023 14:29:37 +0000 From: "Dumitrescu, Cristian" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "Ajmera, Megha" Subject: RE: [PATCH] examples/qos_sched: fix buffer overflow on mbuf free Thread-Topic: [PATCH] examples/qos_sched: fix buffer overflow on mbuf free Thread-Index: AQHZUceYC8lLFW0pi02HnAZxRY6wia7w8RxQ Date: Wed, 8 Mar 2023 14:29:37 +0000 Message-ID: References: <20230308140902.269982-1-bruce.richardson@intel.com> In-Reply-To: <20230308140902.269982-1-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH0PR11MB5724:EE_|CY5PR11MB6236:EE_ x-ms-office365-filtering-correlation-id: 817f73bc-31d5-4cc3-e775-08db1fe18bec x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iZxUlHGS7wLL1fUufmOiRMAdQodu1vPKjPa8ODnyukLF5woNHo5HxKPKFx8pqVh3PIqCTOy5+IR59C8cMX46itjL22bEC1ZyD2KLGLIfgBraXo19I5iQYF34fW3t4WZck+uloSTH/ym0s25+EdJBZ/DBiOF546uy1+DhlTEYrYKnpVTOZuvFmkYlIrhPtJ9qxv1PDTxOnJ7J2CmXM7UgZWrW/5xWmKpCDi51vakZyH+D1oROjfQGYhRrbLFWp20Blb/gzCe0TGdfzqeiVnU/titAceH63St/TArLza/bMdHc7eCSvnF05hx/JJS9AAK+V7z3Xivn0o8t2os1pHCkL+L58kNvgflc0oZDTFJSeZ1Efhbvi2lONJ9Brsf23rNOL3ZApWwSvG08y2lHVYH0hiX+EUO6wPMt8ngEt8x8PjjVl45Kr3kkjry6MJicSSTxNxVU+C9P4CLr6NDlUOmCyFqlIg0GUbCV6YZESX/PFqZvZ3Q8qOxucM+e34c/edqRnRvAjpX4RG8HX48+hX+l1aTiyVkTqgzTJPyoje9cooRlY8MJ7uZ/UmY63eDVETzeOHFQQyEHXSHZoSqYA/ptKhlKjbRvuk2adPJ/nyjU1Qg8seiNAWcS7ldo0FZIa1jki1KqaOhU0yua6gQgbYDBMb614CklXhCtEOF00YmloHZnh9WLVW1ssU4qR3u9HwqRZTTs0EjFxmzWgv3b+NNyMg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR11MB5724.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(39860400002)(396003)(136003)(346002)(366004)(451199018)(33656002)(110136005)(478600001)(71200400001)(7696005)(316002)(5660300002)(52536014)(8936002)(76116006)(2906002)(66556008)(64756008)(8676002)(66946007)(66476007)(66446008)(41300700001)(4326008)(107886003)(122000001)(82960400001)(186003)(55016003)(38070700005)(9686003)(86362001)(38100700002)(26005)(6506007)(53546011)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?upugkYLcV6BeA+D01FFPrFj/rpMk1JoMIKPAFgeQ7V1zbiTMCscf2hNucMym?= =?us-ascii?Q?jOsXgldceKGOaT6tMRisPud/7Uba8A/y32+BNQN60wtwS90kXNF7GS6xHb6O?= =?us-ascii?Q?oBbFmvZYl4imRxy7Jya3eHphmK2JeP+Yc0UdqbI07rK6/mTkRTj4zSH5aadF?= =?us-ascii?Q?KWttdjuKjZRg2hNaLQSD506XcfTVLYPrTPMr9bcqa3IYOsi+wFMecWU7kc08?= =?us-ascii?Q?tFUJebw2UajcaRNwikjswNnPtTx1wy+Tl5xGcnmS6cdX8AGrTA2VNqVYXUNi?= =?us-ascii?Q?Y26RbHbDO5cUgcsHmVHxHbznnMWKPu3Lni+CTx3txmNwgwP9KCY4BQ/EsPaU?= =?us-ascii?Q?ul6V4Qs0kYhdAlbWvLCzzzFrI3Cyp2QasV/u8vmQcuYYdYU3ebpJMd7NSuJg?= =?us-ascii?Q?sHCvMQFvK1CmEe/CB/rmbuzcPsj6wySCNs2vM6mcU7ZIHMs107A9+FfmC6cN?= =?us-ascii?Q?Vpcn0QeIHlaasQJtTHFemUuGqj/LlC3gW1800rX2phtTCE2f0M/4/MUpZvHD?= =?us-ascii?Q?1W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LUxvHF4NGMWUhnOK?= =?us-ascii?Q?kTe1+m4yGV53F+LAejmj0wb0413rVmOg0nJATL50xebtoz2R2dlIA3ERqmOj?= =?us-ascii?Q?OS3Jizg28M/VIdmchG0Sinqp42FPX1wYAKJdYkth2Ge8Y+90ZdCnvzrbzjR/?= =?us-ascii?Q?/Ra603FOSgZd2+9MU5jRIjijfLahkWqk7+rSpyTH6viChK/KouiDmd4/TBV9?= =?us-ascii?Q?lw=3D=3D?= 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: CH0PR11MB5724.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 817f73bc-31d5-4cc3-e775-08db1fe18bec X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2023 14:29:37.8562 (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: PMD+NRlMA/Ic7SnU6n0Nf3oMN9mbqIFWJdUazvx/dCyneb1FO9osP8+pai+rAYSYEP9rXTXjiq7LRerfzdiRdBucGTf0T74pH5/xz69J4D0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6236 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, March 8, 2023 2:09 PM > To: dev@dpdk.org > Cc: Richardson, Bruce ; Ajmera, Megha > ; Dumitrescu, Cristian > > Subject: [PATCH] examples/qos_sched: fix buffer overflow on mbuf free >=20 > When running the qos_sched app with separated worker and Tx threads, the > app would seg-fault after a short time of handling packets. The root > cause of this turns out to be an incorrect array index when freeing > unsent packets post-Tx. Rather than freeing packets using the "nb_tx" > value i.e. where transmission failed, the function was freeing packets > using the "nb_pkts" value, i.e. going beyond the number of packets > previously received into the buffer. >=20 > Fixes: 39b25117c40b ("examples/qos_sched: remove Tx buffering") >=20 > Reported-by: Megha Ajmera > Signed-off-by: Bruce Richardson > --- > examples/qos_sched/app_thread.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/examples/qos_sched/app_thread.c > b/examples/qos_sched/app_thread.c > index 1ea732aa91..059c470afb 100644 > --- a/examples/qos_sched/app_thread.c > +++ b/examples/qos_sched/app_thread.c Acked-by: Cristian Dumitrescu