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 8AE7A4398F5; Thu, 17 Sep 2026 18:57:09 +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=1789671430; cv=none; b=okGKerhXqi9X1xkWC4cHbGrZitg3KubIJ2cdMw8AAW8X5JAZ1vjN64Q0er4ZikYp6vczkfskUO6c7fUVwejYRVVLnWzXZGR64gJka11ER02Tl1DUzmL7O4/wt13VzDOHxlJLd7slHVxfFLRpUZ9eQ6q4CHnBCKfFrsd4/EnyoMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789671430; c=relaxed/simple; bh=55UL2nplDEOOzVxE3xGD6daGzeX+4vS5SH8FMHUBkX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ub4XvIjpfsdXEAh+h5aJDW9hZdK1vq0EGxL2zoo2QEZKc9YXz/gcjAzvXSqo6GFHb3tWjgzKqC2KmFWcy5IJ8tzbA/yz071GG4bqUM3YpEfvqUMD5ILCN0+/TImnkKjSXPjsP1OTgdjwX+hkHQLNepWsinC4n57Ug/4U54X3QBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NXQqtIIv; 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="NXQqtIIv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F921F000FF; Thu, 17 Sep 2026 18:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789671429; bh=1JPA5gkWfyvIjWtKhxmrjuyM7ixAO4R/pwjNepm9SpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NXQqtIIvILb/0EZJXOVkX/OFFDWSkAxKI+yY4ROnFgXpSRVS5dSCNDeZSGJxlBVQt qwD4pP2GoSQ3pvlJTcMDFlhg/Qr0vPtOrdasp3yCitz8mEy9rXQcN1pcx8o3NJXd+J CVaF8tSbk4lBg+e+t2yl07VZtctjmbtRFILaENUQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lukas Wunner , Herbert Xu , Sasha Levin Subject: [PATCH 6.12 0974/1102] crypto: virtio - Drop superfluous [as]kcipher_req pointer Date: Thu, 17 Sep 2026 16:15:17 +0100 Message-ID: <20260917151605.143299443@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner [ Upstream commit 62d027fb49c76475c5256ab69059752f42c3730f ] The request context virtio_crypto_{akcipher,sym}_request contains a pointer to the [as]kcipher_request itself. The pointer is superfluous as it can be calculated with container_of(). Drop the superfluous pointer. Signed-off-by: Lukas Wunner Signed-off-by: Herbert Xu Stable-dep-of: f77a956f6a19 ("crypto: virtio - bound the akcipher result length") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 9 ++++----- drivers/crypto/virtio/virtio_crypto_skcipher_algs.c | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c @@ -36,7 +36,6 @@ struct virtio_crypto_akcipher_ctx { struct virtio_crypto_akcipher_request { struct virtio_crypto_request base; - struct akcipher_request *akcipher_req; void *src_buf; void *dst_buf; uint32_t opcode; @@ -68,7 +67,9 @@ static void virtio_crypto_dataq_akcipher { struct virtio_crypto_akcipher_request *vc_akcipher_req = container_of(vc_req, struct virtio_crypto_akcipher_request, base); - struct akcipher_request *akcipher_req; + struct akcipher_request *akcipher_req = + container_of((void *)vc_akcipher_req, struct akcipher_request, + __ctx); int error; switch (vc_req->status) { @@ -87,8 +88,7 @@ static void virtio_crypto_dataq_akcipher break; } - akcipher_req = vc_akcipher_req->akcipher_req; - /* actual length maybe less than dst buffer */ + /* actual length may be less than dst buffer */ akcipher_req->dst_len = len - sizeof(vc_req->status); sg_copy_from_buffer(akcipher_req->dst, sg_nents(akcipher_req->dst), vc_akcipher_req->dst_buf, akcipher_req->dst_len); @@ -320,7 +320,6 @@ static int virtio_crypto_rsa_req(struct vc_req->dataq = data_vq; vc_req->alg_cb = virtio_crypto_dataq_akcipher_callback; - vc_akcipher_req->akcipher_req = req; vc_akcipher_req->opcode = opcode; return crypto_transfer_akcipher_request_to_engine(data_vq->engine, req); --- a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c @@ -28,7 +28,6 @@ struct virtio_crypto_sym_request { /* Cipher or aead */ uint32_t type; - struct skcipher_request *skcipher_req; uint8_t *iv; /* Encryption? */ bool encrypt; @@ -56,7 +55,9 @@ static void virtio_crypto_dataq_sym_call { struct virtio_crypto_sym_request *vc_sym_req = container_of(vc_req, struct virtio_crypto_sym_request, base); - struct skcipher_request *ablk_req; + struct skcipher_request *ablk_req = + container_of((void *)vc_sym_req, struct skcipher_request, + __ctx); int error; /* Finish the encrypt or decrypt process */ @@ -76,7 +77,6 @@ static void virtio_crypto_dataq_sym_call error = -EIO; break; } - ablk_req = vc_sym_req->skcipher_req; virtio_crypto_skcipher_finalize_req(vc_sym_req, ablk_req, error); } @@ -480,7 +480,6 @@ static int virtio_crypto_skcipher_encryp vc_req->dataq = data_vq; vc_req->alg_cb = virtio_crypto_dataq_sym_callback; - vc_sym_req->skcipher_req = req; vc_sym_req->encrypt = true; return crypto_transfer_skcipher_request_to_engine(data_vq->engine, req); @@ -504,7 +503,6 @@ static int virtio_crypto_skcipher_decryp vc_req->dataq = data_vq; vc_req->alg_cb = virtio_crypto_dataq_sym_callback; - vc_sym_req->skcipher_req = req; vc_sym_req->encrypt = false; return crypto_transfer_skcipher_request_to_engine(data_vq->engine, req);