Skip to content

Commit ba3343b

Browse files
uefi: Remove mentions of runtime usage from GOP docs
As pointed out in #612, our GOP docs said the protocol can be used both during boot services and during runtime. As far as I can tell this is incorrect; as with all other protocols it can only be used during boot services. (Of course, a firmware implementation might leave the memory initialized, giving the appearance that GOP is usable after exiting boot services, but that would essentially be a UAF bug.) For some supporting evidence, see this presentation: https://uefi.org/sites/default/files/resources/UPFS11_P4_UEFI_GOP_AMD.pdf On some implementations it has been observed that the framebuffer pointer can still be used after exiting boot services, but that isn't guaranteed by the spec. The Framebuffer::as_mut_ptr() method now mentions this. > Major differences between GOP driver vs. legacy VGA BIOS: > ... > 2. Boot only services vs. both boot and OS run-time services
1 parent 6d01ed3 commit ba3343b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

uefi/src/proto/console/gop.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Graphics output protocol.
22
//!
33
//! The UEFI GOP is meant to replace existing [VGA][vga] hardware interfaces.
4-
//! It can be used in the boot environment as well as at runtime,
5-
//! until a high-performance driver is loaded by the OS.
64
//!
75
//! The GOP provides access to a hardware frame buffer and allows UEFI apps
86
//! to draw directly to the graphics output device.
@@ -11,8 +9,6 @@
119
//! to exist and be used on the system. There is a GOP implementation for every
1210
//! unique GPU in the system which supports UEFI.
1311
//!
14-
//! This protocol _can_ be used after boot services are exited.
15-
//!
1612
//! [vga]: https://en.wikipedia.org/wiki/Video_Graphics_Array
1713
//!
1814
//! # Definitions
@@ -586,6 +582,9 @@ impl<'gop> FrameBuffer<'gop> {
586582
/// - Keep memory accesses in bound
587583
/// - Use volatile reads and writes
588584
/// - Make sure that the pointer does not outlive the FrameBuffer
585+
///
586+
/// On some implementations this framebuffer pointer can be used after
587+
/// exiting boot services, but that is not guaranteed by the UEFI Specification.
589588
pub fn as_mut_ptr(&mut self) -> *mut u8 {
590589
self.base
591590
}

0 commit comments

Comments
 (0)