From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1D3C2441607 for ; Wed, 15 Jul 2026 10:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784111238; cv=none; b=T6mvUW/1eabyVPVniEjoYBP/XhyP3lm2RW6gTsTUnC/9YwL/j3x6/k002v903H/tqzvlj1w0vWVxgZ9rIpJJqZvzQAwrZxdw46XoDk+APpbohsRq6hw2j8LmYkBJGLbZq5VAV9xjgb0Danv2yAWAFRrz50eF0tOgROY0EyBynXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784111238; c=relaxed/simple; bh=sj5cB4donpsirKMHOCpok9mKxka6kRezgi0cTI0IE6s=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=svqdYGtoFbcurlqhWOhXzNL6kmobbevtN6BRB1bUhr7qw7UrcVMoxs9v/SQKUsU0WlwVxKuCG1IZIjMZxrKXPnx7oyxfKlO98AbJMFnTfD4E0oBLPO8xMk/9fbq7dujRv8ycwdh9R1ul33Fw1YdlYOZQhdTrNKR12QR5CZ5ZswE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rxq2+HKa; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Rxq2+HKa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82CA21F000E9; Wed, 15 Jul 2026 10:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784111237; bh=cYGD2HOqfBpYnxkDB+KuAXpUY0d+z77UU1PIQg13LF0=; h=Subject:To:Cc:From:Date; b=Rxq2+HKa7dWZJiN35017lVnbgB3sfkk3GVGuB9BIgigdR7SIl39+EniB3JA9Momih BQQVW1IlA7fRp5x5Wk3YXPAsd8ixPF9+hv1LCcNF4HzUhRzquMRgHgufhxuhIHQtKs HPqwZ3pC+ZBYUBBDkPsmRnxosJ8Te8DfRR1F5FHA= Subject: FAILED: patch "[PATCH] crypto: qat - fix restarting state leak on allocation failure" failed to apply to 6.18-stable tree To: ahsan.atta@intel.com,giovanni.cabiddu@intel.com,herbert@gondor.apana.org.au,maksim.lukoshkov@intel.com Cc: From: Date: Wed, 15 Jul 2026 12:22:50 +0200 Message-ID: <2026071550-nebula-figment-3256@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 7d3ed20f7e46b3e991936fedd7a28f3ff4aec8d2 # git commit -s git send-email --to '' --in-reply-to '2026071550-nebula-figment-3256@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 7d3ed20f7e46b3e991936fedd7a28f3ff4aec8d2 Mon Sep 17 00:00:00 2001 From: Ahsan Atta Date: Wed, 20 May 2026 13:33:00 +0100 Subject: [PATCH] crypto: qat - fix restarting state leak on allocation failure In adf_dev_aer_schedule_reset(), ADF_STATUS_RESTARTING is set before allocating reset_data. If the allocation fails, the function returns -ENOMEM without queuing reset work, so nothing ever clears the bit. This leaves the device permanently stuck in the restarting state, causing all subsequent reset attempts to be silently skipped. Fix this by using test_and_set_bit() to atomically claim the RESTARTING state, preventing duplicate reset scheduling races under concurrent fatal error reporting. If the subsequent allocation fails, clear the bit to restore clean state so future reset attempts can proceed. Cc: stable@vger.kernel.org Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework") Signed-off-by: Ahsan Atta Co-developed-by: Maksim Lukoshkov Signed-off-by: Maksim Lukoshkov Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu diff --git a/drivers/crypto/intel/qat/qat_common/adf_aer.c b/drivers/crypto/intel/qat/qat_common/adf_aer.c index af028488e660..3fc7d13e882c 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_aer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_aer.c @@ -207,13 +207,14 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev, struct adf_reset_dev_data *reset_data; if (!adf_dev_started(accel_dev) || - test_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) + test_and_set_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) return 0; - set_bit(ADF_STATUS_RESTARTING, &accel_dev->status); reset_data = kzalloc_obj(*reset_data); - if (!reset_data) + if (!reset_data) { + clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); return -ENOMEM; + } reset_data->accel_dev = accel_dev; init_completion(&reset_data->compl); reset_data->mode = mode;