Skip to content

vfio_dma_map should be unsafe but isn't #100

@DemiMarie

Description

@DemiMarie

The function vfio_dma_map takes a u64 and passes it to a kernel function that treats it as a pointer and accesses the virtual address space it points to. Such a function must be unsafe, but this function currently is safe.

I'm not sure how to provide an unopinionated safe wrapper for this API. An opinionated option would be to have a type that allocates the memory with mmap, exposes an API to call vfio_dma_map initialization, and (if the memory had been mapped) calls vfio_dma_unmap in its Drop::drop. I'm not sure if this is sufficient for Cloud Hypervisor, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions