From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1309D221FAC; Tue, 12 Aug 2025 17:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755020833; cv=none; b=GsZ+whlRjWZ77pNvYVpMRWwaV2/4zBK4l1OcRbO8BVXP2y8a8ZMtEYAatVv+Jb2oNE5Rq/iSceQ9rZj9cx2F1WzLuMn3PXzk7G8nQd1riPJHdx4AKmSJ/cq511a34anedy5rd+4QpEFLZmbvVPLuKZOr0L1SPHwmb1C5P/2Kc6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755020833; c=relaxed/simple; bh=AUD6xaVURWRSRmHOfPazptxBoCdoin+rar1Rcb29sdA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bKq3ILWEqEaVjSPtbmvqGJUV/LYUy6+t5Z0+C81PE13Baesvty6gAPNMquphetD9xm1Gp47eIsvAYXSD1p7mD1JFgiV3rsBrB0pd1CxhRvCf8Be2m5ovx14mIfdzWTvKqO+Og5FQps6XDGwHdAeHldtykOVXqC2gxJsnwuG4GEw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cgH4nje1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cgH4nje1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A192C4CEF0; Tue, 12 Aug 2025 17:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755020833; bh=AUD6xaVURWRSRmHOfPazptxBoCdoin+rar1Rcb29sdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgH4nje1er4CI77BTFXt9bjRXlOjZnLtj7eMDo5vNH9MDplDhNNj9Mjj9vIZqbLPV OF/NPaFPIe78PWJOH2Ca91y4p25eDbVeb66XIFNeEknB9o459ixrZFK7qL5xoolgU8 C96gpJVowQItZfpcSmNLNvF25FdoeNevWYEzzy9s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Giovanni Cabiddu , Ahsan Atta , Herbert Xu , Sasha Levin Subject: [PATCH 6.1 175/253] crypto: qat - fix seq_file position update in adf_ring_next() Date: Tue, 12 Aug 2025 19:29:23 +0200 Message-ID: <20250812172956.194663225@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812172948.675299901@linuxfoundation.org> References: <20250812172948.675299901@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Giovanni Cabiddu [ Upstream commit 6908c5f4f066a0412c3d9a6f543a09fa7d87824b ] The `adf_ring_next()` function in the QAT debug transport interface fails to correctly update the position index when reaching the end of the ring elements. This triggers the following kernel warning when reading ring files, such as /sys/kernel/debug/qat_c6xx_/transport/bank_00/ring_00: [27725.022965] seq_file: buggy .next function adf_ring_next [intel_qat] did not update position index Ensure that the `*pos` index is incremented before returning NULL when after the last element in the ring is found, satisfying the seq_file API requirements and preventing the warning. Fixes: a672a9dc872e ("crypto: qat - Intel(R) QAT transport code") Signed-off-by: Giovanni Cabiddu Reviewed-by: Ahsan Atta Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/qat/qat_common/adf_transport_debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/adf_transport_debug.c b/drivers/crypto/qat/qat_common/adf_transport_debug.c index e2dd568b87b5..621b5d3dfcef 100644 --- a/drivers/crypto/qat/qat_common/adf_transport_debug.c +++ b/drivers/crypto/qat/qat_common/adf_transport_debug.c @@ -31,8 +31,10 @@ static void *adf_ring_next(struct seq_file *sfile, void *v, loff_t *pos) struct adf_etr_ring_data *ring = sfile->private; if (*pos >= (ADF_SIZE_TO_RING_SIZE_IN_BYTES(ring->ring_size) / - ADF_MSG_SIZE_TO_BYTES(ring->msg_size))) + ADF_MSG_SIZE_TO_BYTES(ring->msg_size))) { + (*pos)++; return NULL; + } return ring->base_addr + (ADF_MSG_SIZE_TO_BYTES(ring->msg_size) * (*pos)++); -- 2.39.5