From: Maxime Coquelin Date: Wed, 14 Mar 2018 16:31:25 +0000 (+0100) Subject: vhost: deprecate unsafe GPA translation API X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9553e6e408883b3677e208dc66049bcd7f758529;p=dpdk.git vhost: deprecate unsafe GPA translation API This patch marks rte_vhost_gpa_to_vva() as deprecated because it is unsafe. Application relying on this API should move to the new rte_vhost_va_from_guest_pa() API, and check returned length to avoid out-of-bound accesses. This issue has been assigned CVE-2018-1059. Signed-off-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h index 7d065137a4..7f0cb9bc89 100644 --- a/lib/librte_vhost/rte_vhost.h +++ b/lib/librte_vhost/rte_vhost.h @@ -124,6 +124,11 @@ struct vhost_device_ops { /** * Convert guest physical address to host virtual address * + * This function is deprecated because unsafe. + * New rte_vhost_va_from_guest_pa() should be used instead to ensure + * guest physical ranges are fully and contiguously mapped into + * process virtual address space. + * * @param mem * the guest memory regions * @param gpa @@ -131,6 +136,7 @@ struct vhost_device_ops { * @return * the host virtual address on success, 0 on failure */ +__rte_deprecated static __rte_always_inline uint64_t rte_vhost_gpa_to_vva(struct rte_vhost_memory *mem, uint64_t gpa) {