Skip to content

Commit d8be5a5

Browse files
committed
Merge tag 'v6.8-p4' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "Fix a stack overflow in virtio" * tag 'v6.8-p4' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: virtio/akcipher - Fix stack overflow on memcpy
2 parents 9fc1ccc + c0ec2a7 commit d8be5a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/crypto/virtio/virtio_crypto_akcipher_algs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ static void virtio_crypto_dataq_akcipher_callback(struct virtio_crypto_request *
104104
}
105105

106106
static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher_ctx *ctx,
107-
struct virtio_crypto_ctrl_header *header, void *para,
107+
struct virtio_crypto_ctrl_header *header,
108+
struct virtio_crypto_akcipher_session_para *para,
108109
const uint8_t *key, unsigned int keylen)
109110
{
110111
struct scatterlist outhdr_sg, key_sg, inhdr_sg, *sgs[3];
@@ -128,7 +129,7 @@ static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher
128129

129130
ctrl = &vc_ctrl_req->ctrl;
130131
memcpy(&ctrl->header, header, sizeof(ctrl->header));
131-
memcpy(&ctrl->u, para, sizeof(ctrl->u));
132+
memcpy(&ctrl->u.akcipher_create_session.para, para, sizeof(*para));
132133
input = &vc_ctrl_req->input;
133134
input->status = cpu_to_le32(VIRTIO_CRYPTO_ERR);
134135

0 commit comments

Comments
 (0)