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 4E8CE45A66; Mon, 30 Sep 2024 10:25:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DE574027C; Mon, 30 Sep 2024 10:25:28 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013035.outbound.protection.outlook.com [52.101.67.35]) by mails.dpdk.org (Postfix) with ESMTP id 1C4B34027C; Mon, 30 Sep 2024 10:25:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o5DnSAI61uO/d68tsraQVIvcLpqc61NaoTZgHIhN8d3FHnWA14hFztVnwzW9gYVGHPu8TybeUsfZUA4bffWvdEMOFq6WND2/kcebKY8ouLgqY5aJfi2ltAaH1IcbAE4R+VlAyTsDDV9kdF6htgHm66OonclAZOl/jKOSCAQ+s2w29+PBhebj9h8314aMUMIIqkIvMBzqhIHDjuOO+JyizSvjddLdVTcF0y64KfAEYs/2IJnBwzkGfP7SzZCUkEwf68adf3Q9mzsIL5x/pqn90rndTmNj4hFQcotLcicgzQcLjM8TP2zOdBAaFSTCYE89Czm+AjrNy3ALjyI2TSgu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=YQLWUvnU99Pj7QIFxFCzJTufT6zQwLCn4TmvBxIApi0=; b=f3sIQ/BE7XCqNomNrDAmhePj5YRDF6ijJ03Zsm01UGBuYrLf+/PCwPDSK+07TLilo8+C7He594SuxuTyLWZPS5B/kRP7fssxNM0R7akesb0T99hg2XscSQMJsbxpvC4YhvURsqmy6r6iBRUJuGhVKMnb+Q8/tJTSmdWeZ9awslkbld7sv6TdNZbNbcFrUnWfzhAQH2H+hhWioQdvEDKpOvVfVUdg2ASMgINuLg/CiqOpqAM2On1KqcaZMD+QiZQ9Ml1Nq5uJlXjcQL/C7b9uCwvDE89X4Sy6nux69KwYLXSHKiJpxm798WnfgdFkePDmg0DEbXa7vx1KGpX6i4aAcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YQLWUvnU99Pj7QIFxFCzJTufT6zQwLCn4TmvBxIApi0=; b=dUiYuuYxYiEEC7a+FMu838gB9klAaLGqtzs/eN675VUWHQPaK/o9XhADtYDvdoacespNpmT8Ls7MYRFmCW7wHPSGOigB+qMMCr5fzZVMlxFjP0ss7HMncfG822goW+0pVzcueGsw83rB7Fa9bda0W3WbyBFrV6cTQX5Xi/JhgFyXeYMkT9CbaGkU6RXUSyBwc66HtXRpQ9VjztSPQVRehFBvprfnMgPllZ2ouZO9CGsCrTfXfV5dgVRb8XPXVQpigpAKYQBerUb9l3lN1jAluleS8Ga9dz82jUQO3x0atVsbQpUCICeKu4Ed9ZN0NTTPAg9vCmaJJX/Oa5xBvCYshg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by PA4PR04MB7821.eurprd04.prod.outlook.com (2603:10a6:102:c5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 08:25:25 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.8005.026; Mon, 30 Sep 2024 08:25:25 +0000 Message-ID: Date: Mon, 30 Sep 2024 13:55:18 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v3 15/18] baseband/la12xx: prevent use after free Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: hemant.agrawal@nxp.com, stable@dpdk.org, Gagandeep Singh , Nipun Gupta , Nicolas Chautru , Akhil Goyal References: <20240927204742.546164-1-stephen@networkplumber.org> <20240929154107.62539-1-stephen@networkplumber.org> <20240929154107.62539-16-stephen@networkplumber.org> From: Hemant Agrawal In-Reply-To: <20240929154107.62539-16-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0169.apcprd01.prod.exchangelabs.com (2603:1096:4:28::25) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|PA4PR04MB7821:EE_ X-MS-Office365-Filtering-Correlation-Id: 8637dc24-bfc1-4aa8-35bb-08dce1296e66 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?L2UxNWRQYlhRNEhuRTQ4b09PemZBTE5mN25kZFZYU0pTMDkrbU5JeVpGSUpC?= =?utf-8?B?cG5iVGgxWnNtdk5RWFk5aEhMK0ZNQ09Gd0pDRTJ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04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmlnaE9SZkJsdWxBVFFFSnpVMUZZYmFQM3RpVjV3VXAxakxValVjOFE3NExF?= =?utf-8?B?dWp4M2xOc2F1dkxhM2hSQ2hFb2MyVFNYZkxQOWxsK2JJd2kvNUJqOWFHMk15?= =?utf-8?B?UHlUZXRTUlYxK3dzOEJvVU44d0JtMHYrSnhMRUVEQkhBVUlhbHduOXRnRkJ3?= =?utf-8?B?UWk3bFo5NEJZSHExMHYrYTJYdGk5em1PWTYwSDRKcXRjNTgzUlU5NG5vNy9Q?= =?utf-8?B?cEY2RWxaNGlBRGhmR3ZYeXdQelphTkpac3JLQnd4MWk2VGtNNjUvN2VENTBh?= =?utf-8?B?NEN2cCtsR1dmTnoxRGZLRm9iQUlBZE5OcEZxNFNBWWdkOWwrQnhyUTdQVjk5?= =?utf-8?B?dXkxVEhzZ2RCcnNnaUxrRThTZjdYWmZzK2E3TkduMjcySFV5RmxKNmdDaVcv?= =?utf-8?B?NGJsZGxVbjR4Zzh6TlM0Z0lWNU9ZNzIrNllHS21La3dkV0R0WFo4R1JITnli?= =?utf-8?B?S3R5a1lzZ29tcEducDk4MW4yOW85Y2JWeEgxdDRyOXkvSzFuTnVqb3JYSWI4?= =?utf-8?B?M3hjcU1zbS8rYVo0Q2hmVVJ2Mk95eWJNdVNFQjdiT1B4WHZnSGNmM0gwQ28r?= =?utf-8?B?VE5KUnBOWVNvK016U2l6SFhMeXNHd2dEUGVxNTRHckEzelRQajBmQXIvOTJV?= =?utf-8?B?TmxCeURjL09mb0tOc3BvQ2Jhck8wUjZ4dzB0dDZnT0RmNDFvdGhZOUZJTDBB?= =?utf-8?B?SEZhNUVncFlOZVpod0xWNVhvNVcwVEJaWFNmN1RwQnQxODZqYlhuTTVI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RjlwczJ5K1FmMXNyZ3k3SXdhNWRn?= =?utf-8?B?WmtyNjBjSWVlbUxNMG5MYTczbHdWOVlZRFBFMjN6TDZGanBNaDlSU21vNkZM?= =?utf-8?B?cSs4TlJpRXZJb20wRVVCYndkbnJsOHFuVHFUdVZ3QURPamJVczA5alBLSFZw?= =?utf-8?B?d01iRDdCZDV1WXNiVWZGY2NPUmNRbVdXVTIveGF5RmZWQmIxVDg2YkhzbnlY?= =?utf-8?B?TmY3dnB1NjdiWExvR3loRUhYZFJNbDUrZ2pzYktmOWlDWmdMMWk3dWlETVMx?= =?utf-8?B?Y0c0eS8rNzdLZFZHNHdJRi9qaTB2V0Ewa0FaQzhvdnZTSFFnTDlidGlEN2Zw?= =?utf-8?B?ekRWL1A1eStmcWFlSFZJZWQvbnFEZDN4UUwwSXFUM0d6MXVNYVJKRENPMldF?= =?utf-8?B?MjNQNm0vZTJmL01yakJxYW9DNDVrRXRWOTVIRERlTm1jaVBlM1hnc0ZULzh0?= =?utf-8?B?ZmI0alVhYTZSb2xxVjVmenRROS9Oc3F6ZDFkamZoOFQ1dGYwS0lMWHYvVDFG?= =?utf-8?B?cGc9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8637dc24-bfc1-4aa8-35bb-08dce1296e66 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 08:25:25.4713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CzWhuHo2ZMRXzZmgnoRkjhFWTOX5GVumWH5HRZ5yGzlKrli9rlpyocmPJ0/f3XJfD2rZDjqZpyyL60sDjGqTsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7821 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 On 29-09-2024 21:04, Stephen Hemminger wrote: > It is possible that the info pointer (hp) could get freed twice. > Fix by nulling after free. > > In function 'setup_la12xx_dev', > inlined from 'la12xx_bbdev_create' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1029:8, > inlined from 'la12xx_bbdev_probe' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1075:9: > ../drivers/baseband/la12xx/bbdev_la12xx.c:901:9: error: pointer 'hp_info' may be used after 'rte_free' [-Werror=use-after-free] > 901 | rte_free(hp); > | ^~~~~~~~~~~~ > ../drivers/baseband/la12xx/bbdev_la12xx.c:791:17: note: call to 'rte_free' here > 791 | rte_free(hp); > | ^~~~~~~~~~~~ > > Fixes: 24d0ba22546e ("baseband/la12xx: add queue and modem config") > Cc: hemant.agrawal@nxp.com > Cc: stable@dpdk.org > Signed-off-by: Stephen Hemminger > --- > drivers/baseband/la12xx/bbdev_la12xx.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c > index 1a56e73abd..cad6f9490e 100644 > --- a/drivers/baseband/la12xx/bbdev_la12xx.c > +++ b/drivers/baseband/la12xx/bbdev_la12xx.c > @@ -789,6 +789,7 @@ setup_la12xx_dev(struct rte_bbdev *dev) > ipc_priv->hugepg_start.size = hp->len; > > rte_free(hp); > + hp = NULL; > } > > dev_ipc = open_ipc_dev(priv->modem_id); Reviewed-by:  Hemant Agrawal