Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vulkan: Don't use pointer to dropped PhysicalDeviceDriverProperties. #3076

Merged
merged 3 commits into from
Oct 12, 2022

Commits on Oct 7, 2022

  1. vulkan: Don't use pointer to dropped PhysicalDeviceDriverProperties.

    Detected by ASAN, but seems impossible to exploit.
    
    Since `ash::vk::definitions::PhysicalDeviceDriverProperties` is
    `Copy`, the statement
    
        if let Some(driver) = phd_capabilities.driver { ... }
    
    actually makes `driver` a local copy of the struct. The code uses
    `as_ptr` to create a pointer to the `driver_name` field of this local
    copy, and then tries to use that pointer outside the `if let`, when
    the local copy has gone out of scope. This is UB.
    
    Taking a reference to the properties struct is correct and more
    efficient.
    jimblandy committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    130ba89 View commit details
    Browse the repository at this point in the history
  2. hal: Introduce cstr_from_bytes_until_nul helper function.

    Remove a handful of `unsafe` blocks from the Vulkan back end.
    jimblandy committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    16f2702 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. c_char has MSRV of 1.64?

    cwfitzgerald committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    9a77471 View commit details
    Browse the repository at this point in the history