Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp555925lqo; Thu, 16 May 2024 14:17:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSkthDOw/MMeA9G+cgxX/0IS3ylE9AtMk/z2wCkKXf0lAQOf0gFHFkuAXoi39LRP8qVE2NCBFtOey4EYaITnryQ6erTRNUidq2uPoTrQ== X-Google-Smtp-Source: AGHT+IExu9p2JbPfPZczyzr4YEMWBTbsQrU6gqlVmYq50kFjBYHRo27RtBPS1GJLju8C3JcMXPRI X-Received: by 2002:a17:902:cecd:b0:1ec:2415:7ef2 with SMTP id d9443c01a7336-1ef43d1557cmr234358555ad.18.1715894241536; Thu, 16 May 2024 14:17:21 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf31950si148764395ad.290.2024.05.16.14.17.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 14:17:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4220-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gw0R2OQs; arc=fail (signature failed); spf=pass (google.com: domain of linux-crypto+bounces-4220-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4220-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3039DB214E8 for ; Thu, 16 May 2024 21:17:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC2CC158202; Thu, 16 May 2024 21:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gw0R2OQs" X-Original-To: linux-crypto@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D4D61581E7 for ; Thu, 16 May 2024 21:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.16 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715894218; cv=fail; b=uR+7flJVa3PId0uJQeJmLGw/gtBYgmTV7LMXCGI8ovS1io2Z/BktzICsIumMbcKrmw2nsqp8soV/2IE8ojAJjHGWJIk3cAAzkmtVY1LHu0if9OoaN2ZVLau9uWW6V5DTN1OOjzoTnvJqX+1eEOCBP1KMQudaf7wyRsRsoQMKbAs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715894218; c=relaxed/simple; bh=H1DCwhHec0hFYwAwpfd2HZS++8tduzUhwy7ziDr+7Zc=; h=Date:From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=HZKxGWK/cs4uhJ3yUWwC78qIanLhskF5PsYzP8V9KTlcslEmAzBd+WJlf27OZKj/coYQBA2qlYc57Fh7dyxS0T00LvOuJIJDl8zngonCsSZjFJ1Laf1DKQtl4wkVDqpXiPaJ69PCvTdQlQQ5Dvm+W4qKBl3fiqLIWk1IOUdQpp4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gw0R2OQs; arc=fail smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715894216; x=1747430216; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=H1DCwhHec0hFYwAwpfd2HZS++8tduzUhwy7ziDr+7Zc=; b=gw0R2OQsyGDdNbPBJoBkltZmZ6uA8aueeYljtex4PS4C6VY4NO9q98Kl aQTcTszsR7/ds8JcxBvvAbeX80xnJdx2HnA1XIqcEtHkd8qYOJWLlM4o4 ExKl6+pkdu4q3d5FU5oMps/xAgCD8B/PkCWOhEL1NUUwkInxK6DOi6+gI nXzz+RfqTdajhaMZLem62QEpaTvnDUze9huLHC9kHSZnzYx5YrmDY66PS w+GXpy86ZRV8Uhy/XnTc0+aRjNiXpitVMHPemHgSnu5xwVmBg7Y/fLRIr dWO9oGRIVzM7nTJFS7aHbxC5Cn2VHHIFUXY4RiirL55iC3L/g264ugtZe g==; X-CSE-ConnectionGUID: ymbUD6o+QwaLhO0tPsVkgw== X-CSE-MsgGUID: 3gw26ISYSMaMNVBo/sMGwQ== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11562081" X-IronPort-AV: E=Sophos;i="6.08,165,1712646000"; d="scan'208";a="11562081" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 14:16:55 -0700 X-CSE-ConnectionGUID: PmDvtRGnTMO+jAKa3FFB3A== X-CSE-MsgGUID: OHgOIO4bQXidaR4grLRUYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,165,1712646000"; d="scan'208";a="36118720" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 16 May 2024 14:16:56 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.35; Thu, 16 May 2024 14:16:55 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 16 May 2024 14:16:54 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 16 May 2024 14:16:54 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 16 May 2024 14:16:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hlbfxKpBpyGjTfqBDQqsgZ4/nNCwhCurnMxwt3RzeW4+UI2QbjLR1gqjStn+6crhL/5vkYuIomKf3NK61vmK3h3jg2qY249KjdDGo7ZMEE62u7A1wsRc/6mqdC9FiaCePQpn+NLWRGY5vHiAepAQwwOkHXy6UBEeixqvDgEqlKQ7dfzVcLkiTsDXE8DpkEbIC+9NuVWA9pCGwo5JylubiHPHQIzP/KuupbkEgwIna43LK69Pl7NxYHJM7q1SaPeKrDkiDtW7P7eBLUVZBmOHjeVWP6N+tNj6CDo0tVpucraoq5im3d5/0uKipP097Fwq+q86cChvtx2yvqn3h+OYhw== 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=FQHLYYz6F8qbAH8Isoz9/VN0Hopp3dgjGN6QOCLheNk=; b=jUEkB7NYmp7LZVPy8VTJgzaQJCd/EOJqUJV5ayY7TSeEU2hxmbbfsg7X0cRrtcGgrvLIIE6BpdAIh8IuzYZO3RNboucFsfThmep9XyhmN23mOeQxoNCB4/2qQQMrT0kQRBTEsvulgA28R0mU8z5FzcqM+K4/mKbMNU8jepFn/VKokLNLt6IN0M+ZShji4EXHsd6ZWSWhzlrSKGibheTkDn2iYbdevrFSC3zBrJZgcpPyZtfJmn7smxpSI8cd+5atiLEuhzmSmIIPvwzl7SCBneZm/RuhWjcVuZf6UrHEACFn/iqsjE0m7GG/GqdVwwqZEOkCmqghliF96QIR6x7slQ== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CY5PR11MB6366.namprd11.prod.outlook.com (2603:10b6:930:3a::8) by DS0PR11MB8739.namprd11.prod.outlook.com (2603:10b6:8:1bb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.29; Thu, 16 May 2024 21:16:52 +0000 Received: from CY5PR11MB6366.namprd11.prod.outlook.com ([fe80::6826:6928:9e6:d778]) by CY5PR11MB6366.namprd11.prod.outlook.com ([fe80::6826:6928:9e6:d778%7]) with mapi id 15.20.7587.028; Thu, 16 May 2024 21:16:52 +0000 Date: Thu, 16 May 2024 22:16:48 +0100 From: "Cabiddu, Giovanni" To: Herbert Xu CC: Damian Muszynski , , Subject: Re: [PATCH] crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak Message-ID: References: <20240209124403.44781-1-damian.muszynski@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland X-ClientProxiedBy: DU2PR04CA0249.eurprd04.prod.outlook.com (2603:10a6:10:28e::14) To CY5PR11MB6366.namprd11.prod.outlook.com (2603:10b6:930:3a::8) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR11MB6366:EE_|DS0PR11MB8739:EE_ X-MS-Office365-Filtering-Correlation-Id: 94677eb5-afdd-493e-ec35-08dc75ed816b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/RsJOb1RaqEPPS8w3NPPxnWKnuh7kY1DFT8XLnCDbx66Fk7nIBdEvB4clBKg?= =?us-ascii?Q?WmpnOP+JRcet7EFyUxWVjrur5SnYap3WsTOqEm3ixYwbXup9FbOvPmF7gSGw?= =?us-ascii?Q?eN8TyCqU2p1RmEyFPULqyBmuN/XciIkoajVpgr5tSmHG2AqBaPbUoVKeff+u?= =?us-ascii?Q?9PBqwUPoGJqa828Gb3TbYIUfYxmauieVUziImb1r8/x+4SwkV60QByKTfafK?= =?us-ascii?Q?lWN5YgPkRPCn7oXZF2MytjtsAIvKR0PfO6PUWAD0YX/0F4TNK/FTHpi1uCcN?= =?us-ascii?Q?UflDUFGCwFb/j9o7gPzAphMacc902TLPodzEy7qFVC5+euvUlLxvD38/G/89?= =?us-ascii?Q?WC7QK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u8?= =?us-ascii?Q?di3na5vJp/Qg30qCXVNigzOwVa0FMEa9hFW87rAcWw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR11MB6366.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HaQgo4rmmFMBamMZu28XjTXPlqPS/oRg9b0a81CUz6uGOBKp7JJwp+afsZgv?= =?us-ascii?Q?pkZcPln1H+GZsmME9DD/ldi7yQ7e5EosATEp/2EHKjUraxhA/sCvrfaqsK90?= =?us-ascii?Q?beep3pq3IXzS5EbY67nvd25LPFfAvzyYwP9iCgSLfucxT4Rh+DeGpsEDQtyG?= =?us-ascii?Q?/VVykEjNBzm5fMhBa0z7FyGQand3L2Atlek+Ez0lJCuDOVfDXozifVGgr63M?= =?us-ascii?Q?ah1B5sukA/epz7FjU5+sfyrtR2pqT2cUgU1I3e3xWUl4rNfH5+JCeIuz0wPn?= =?us-ascii?Q?ozBp3ADjaHkcBe8IyqmY2H1yIdqa1WpSSVo3mWN785Ia7YyLp+6ekgyTFVy8?= =?us-ascii?Q?onIjrunJhRryr5MSdlPsRmY9+EYnCZq+NQ4CBI7ahxjgEVG/+4Q1QoTP7F1a?= =?us-ascii?Q?FS1FusxmNAJbHoR28t5asFj62SHIz15gzZ5/IXuobF+gLXzZ3Yru9tGC9EUz?= =?us-ascii?Q?M/i5KU1A7YE91oeIeepgh33DlC3oyllzjeZrihSo0bd4M3NKohbZ9AWq0WNd?= =?us-ascii?Q?X8AC7WMs0vGXi/dxWBL5PxqoRyGtDrIlBi/3XC3xhWH+8HGAXRZ7LLK8ANT/?= =?us-ascii?Q?pNJ5KK6aNy1wQHLhhjv4p9qvFY6y+q4gm5V9PPeHgP4x3pMhMv4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5Eg7PYlrQEWuDN/fIHWuYgD4HTtSPMCVRs0j?= =?us-ascii?Q?WtJ0b3bP76O9KPIfPuXa+rUAHvSb49tL9I1jc+QCofvrmw0F4CguWhhFdQfZ?= =?us-ascii?Q?Zw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 94677eb5-afdd-493e-ec35-08dc75ed816b X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6366.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 21:16:51.9767 (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: 5j9NGIp1x+zV0imTW8qiPPkBKtTdSGzRLil4Y5NkY8XUyKKLx1z6WlHyhu9sbs2UF7t/EYFu53sSXx+RxFd/QWecz4AP+npT+59aiexyV8E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8739 X-OriginatorOrg: intel.com On Wed, May 08, 2024 at 04:39:51PM +0800, Herbert Xu wrote: > On Fri, Feb 09, 2024 at 01:43:42PM +0100, Damian Muszynski wrote: > > > > @@ -146,11 +147,19 @@ static void adf_device_reset_worker(struct work_struct *work) > > adf_dev_restarted_notify(accel_dev); > > clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); > > > > - /* The dev is back alive. Notify the caller if in sync mode */ > > - if (reset_data->mode == ADF_DEV_RESET_SYNC) > > - complete(&reset_data->compl); > > - else > > + /* > > + * The dev is back alive. Notify the caller if in sync mode > > + * > > + * If device restart will take a more time than expected, > > + * the schedule_reset() function can timeout and exit. This can be > > + * detected by calling the completion_done() function. In this case > > + * the reset_data structure needs to be freed here. > > + */ > > + if (reset_data->mode == ADF_DEV_RESET_ASYNC || > > + completion_done(&reset_data->compl)) > > kfree(reset_data); > > + else > > + complete(&reset_data->compl); > > This doesn't work because until you call complete, completion_done > will always return false. IOW we now have a memory leak instead of > a UAF. > > ---8<--- > Using completion_done to determine whether the caller has gone > away only works after a complete call. Furthermore it's still > possible that the caller has not yet called wait_for_completion, > resulting in another potential UAF. > > Fix this by making the caller use cancel_work_sync and then freeing > the memory safely. > > Fixes: 7d42e097607c ("crypto: qat - resolve race condition during AER recovery") > Cc: #6.8+ > Signed-off-by: Herbert Xu Reviewed-by: Giovanni Cabiddu This is also present in 6.6+ and 6.7+. -- Giovanni