vhost/crypto: fix missing head correction
PATCH 1/1 vhost/crypto: fix missing head correction
This patch fixes the missing head descriptor correction for indirect descriptors.
--- lib/librte_vhost/vhost_crypto.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_vhost/vhost_crypto.c +1 -0
@@ -919,6 +919,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto,if (unlikely (!desc || dlen != head->len))return -1 ; desc_idx =0 ; + head = desc; }else { desc = head; }
Signature · 1 line
2.13.6
Hi Fan,
Quoted 15 lines · Fan Zhang
Fixes 473387aaae4a ("vhost/crypto: move to safe GPA translation API")This patch fixes the missing head descriptor correction for indirect descriptors.
Signed-off-by Fan Zhang <[email protected]>--- lib/librte_vhost/vhost_crypto.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_crypto.c +0
-0
lib/librte_vhost/vhost_crypto.c vhost_crypto_process_one_req(struct vhost_crypto *vcrypto, · line 922
Quoted 4 lines
lib/librte_vhost/vhost_crypto.c +1
-0@@ -919,6 +919,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto,if (unlikely (!desc || dlen != head->len))return -1 ; desc_idx =0 ; + head = desc;
Thanks for fixing this, and sorry for having introduced the regression.
BTW, my patch is half-complete. Indeed, it ensures no out-of-bound accesses will be done, but it does not handle legit buffers that are contiguous in guest physical address space, but discontiguous in the host VA space. Such case can for example happen when having buffers larger than the huge page size.
I have implemented the handling of such buffers in virtio-net.c, for example:
fb3815cc6 vhost: handle virtually non-contiguous buffers in Rx-mrg 6727f5a73 vhost: handle virtually non-contiguous buffers in Rx 91b7b4080 vhost: handle virtually non-contiguous buffers in Tx d0c24508e vhost: add support for non-contiguous indirect descs tables
Can you try to work on such handling for next -rc release?
For this patch:
Thanks,
Maxime
Quoted 4 lines
lib/librte_vhost/vhost_crypto.c +0
-0}else { desc = head; }
Hi Maxime,
No problem. I will work on it.
Regards,
Fan
Quoted 60 lines
-----Original Message-----
From: Maxime Coquelin [mailto:[email protected]]
Sent: Friday, April 27, 2018 3:19 PM
To: Zhang, Roy Fan <[email protected]>; [email protected]
Cc: Yigit, Ferruh <[email protected]>
Subject: Re: [PATCH] vhost/crypto: fix missing head correctionHi Fan,
lib/librte_vhost/vhost_crypto.c vhost_crypto_process_one_req(struct
Quoted 15 lines · Fan Zhang
Fixes 473387aaae4a ("vhost/crypto: move to safe GPA translation API")This patch fixes the missing head descriptor correction for indirect descriptors.
Signed-off-by Fan Zhang <[email protected]>--- lib/librte_vhost/vhost_crypto.c | 1 + 1 file changed, 1 insertion(+)(quoted diff) +0
-0
b/lib/librte_vhost/vhost_crypto.cindexc38eb3bb5..81fab7e94100644lib/librte_vhost/vhost_crypto.c +0
-0@@ -919,6 +919,7 @@ vhost_crypto_process_one_req(struct
vhost_crypto*vcrypto,lib/librte_vhost/vhost_crypto.c vhost_crypto_process_one_req(struct vhost_crypto *vcrypto, · line 922
Quoted 4 lines
lib/librte_vhost/vhost_crypto.c +1
-0if (unlikely (!desc || dlen != head->len))return -1 ; desc_idx =0 ; + head = desc;Thanks for fixing this, and sorry for having introduced the regression.
BTW, my patch is half-complete. Indeed, it ensures no out-of-bound accesses will be done, but it does not handle legit buffers that are contiguous in guest physical address space, but discontiguous in the host VA space. Such case can for example happen when having buffers larger than the huge page size.
I have implemented the handling of such buffers in
virtio-net.c, for example:
fb3815cc6vhost: handle virtually non-contiguous buffers in Rx-mrg6727f5a73vhost: handle virtually non-contiguous buffers in Rx91b7b4080vhost: handle virtually non-contiguous buffers in Txd0c24508e
vhost: add support for non-contiguous indirect descs tablesCan you try to work on such handling for next -rc release?
For this patch:
Reviewed-by Maxime Coquelin <[email protected]>Thanks,
MaximeQuoted 4 lines
lib/librte_vhost/vhost_crypto.c +0
-0}else { desc = head; }
Thomas Monjalon
Applied27/04/2018 16:19, Maxime Coquelin:
Quoted 39 lines
Hi Fan,
Quoted 15 lines · Fan Zhang
Fixes 473387aaae4a ("vhost/crypto: move to safe GPA translation API")This patch fixes the missing head descriptor correction for indirect descriptors.
Signed-off-by Fan Zhang <[email protected]>--- lib/librte_vhost/vhost_crypto.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_crypto.c +0
-0lib/librte_vhost/vhost_crypto.c vhost_crypto_process_one_req(struct vhost_crypto *vcrypto, · line 922
Quoted 4 lines
lib/librte_vhost/vhost_crypto.c +1
-0@@ -919,6 +919,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto,if (unlikely (!desc || dlen != head->len))return -1 ; desc_idx =0 ; + head = desc;Thanks for fixing this, and sorry for having introduced the regression.
BTW, my patch is half-complete. Indeed, it ensures no out-of-bound accesses will be done, but it does not handle legit buffers that are contiguous in guest physical address space, but discontiguous in the host VA space. Such case can for example happen when having buffers larger than the huge page size.
I have implemented the handling of such buffers in
virtio-net.c, for example:
fb3815cc6vhost: handle virtually non-contiguous buffers in Rx-mrg6727f5a73vhost: handle virtually non-contiguous buffers in Rx91b7b4080vhost: handle virtually non-contiguous buffers in Txd0c24508evhost: add support for non-contiguous indirect descs tables
Quoted 5 lines
Can you try to work on such handling for next -rc release?
For this patch:
Reviewed-by Maxime Coquelin <[email protected]>
Applied as hot patch for RC1, thanks