Repository navigation
Use the updated buffer length in UEFI locate_handles - #164955
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Error: Failed to set assignee to
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
Yes, this is unsound, but it's more subtle than the issue points out. UEFI does not have a way to close handles, and does not have any asynchronous callback facilities that could cause a protocol to be closed for the handle, so something like device hotplugging cannot cause an issue here. But we make a call to the global allocator in between the calls to @bors r+ |
…ndles-len, r=joboet Use the updated buffer length in UEFI locate_handles locate_handles was using the handle count from the first LocateHandle call when setting the vec length, instead of the size the second call actually wrote. If handles go away between the two calls this marks uninitialized entries as initialized. Use the updated buf_len instead. Fixes rust-lang#164945
…uwer Rollup of 8 pull requests Successful merges: - #164955 (Use the updated buffer length in UEFI locate_handles) - #164958 (uefi: roll back env changes when `start_image` fails) - #164968 (thread_local::guard: update comments a bit) - #164303 (Remove the 'sub' method from 'At' and migrate to 'sub_raw') - #164674 (Use a NoSpan marker for region constraints without spans) - #164856 (Switch from `insta` to `expect-test` in bootstrap) - #164934 (Remove redundant vec and duplicate indexing in find_noop_landing_pads) - #164954 (Reduce `SpanData` use)
…uwer Rollup of 8 pull requests Successful merges: - #164955 (Use the updated buffer length in UEFI locate_handles) - #164958 (uefi: roll back env changes when `start_image` fails) - #164968 (thread_local::guard: update comments a bit) - #164303 (Remove the 'sub' method from 'At' and migrate to 'sub_raw') - #164674 (Use a NoSpan marker for region constraints without spans) - #164934 (Remove redundant vec and duplicate indexing in find_noop_landing_pads) - #164954 (Reduce `SpanData` use) - #164970 (`rust-analyzer` subtree update)
Rollup merge of #164955 - yashaggarwal85d:fix-uefi-locate-handles-len, r=joboet Use the updated buffer length in UEFI locate_handles locate_handles was using the handle count from the first LocateHandle call when setting the vec length, instead of the size the second call actually wrote. If handles go away between the two calls this marks uninitialized entries as initialized. Use the updated buf_len instead. Fixes #164945
This comment was marked as low quality.
This comment was marked as low quality.
…uwer Rollup of 8 pull requests Successful merges: - rust-lang/rust#164955 (Use the updated buffer length in UEFI locate_handles) - rust-lang/rust#164958 (uefi: roll back env changes when `start_image` fails) - rust-lang/rust#164968 (thread_local::guard: update comments a bit) - rust-lang/rust#164303 (Remove the 'sub' method from 'At' and migrate to 'sub_raw') - rust-lang/rust#164674 (Use a NoSpan marker for region constraints without spans) - rust-lang/rust#164934 (Remove redundant vec and duplicate indexing in find_noop_landing_pads) - rust-lang/rust#164954 (Reduce `SpanData` use) - rust-lang/rust#164970 (`rust-analyzer` subtree update)
locate_handles was using the handle count from the first LocateHandle call when setting the
vec length, instead of the size the second call actually wrote. If handles go away between
the two calls this marks uninitialized entries as initialized. Use the updated buf_len instead.
Fixes #164945