From 017b34e1adf23b698589035f97f4c9dcd6a83006 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 12 Jan 2020 02:17:30 +0100 Subject: Kernel: Add "video" pledge for accessing framebuffer devices WindowServer becomes the only user. --- Kernel/Devices/MBVGADevice.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Kernel/Devices/MBVGADevice.cpp') diff --git a/Kernel/Devices/MBVGADevice.cpp b/Kernel/Devices/MBVGADevice.cpp index 0c86eccbdd..39a16a8795 100644 --- a/Kernel/Devices/MBVGADevice.cpp +++ b/Kernel/Devices/MBVGADevice.cpp @@ -25,6 +25,7 @@ MBVGADevice::MBVGADevice(PhysicalAddress addr, int pitch, int width, int height) KResultOr MBVGADevice::mmap(Process& process, FileDescription&, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot) { + REQUIRE_PROMISE(video); ASSERT(offset == 0); ASSERT(size == framebuffer_size_in_bytes()); auto vmobject = AnonymousVMObject::create_for_physical_range(m_framebuffer_address, framebuffer_size_in_bytes()); @@ -44,6 +45,7 @@ KResultOr MBVGADevice::mmap(Process& process, FileDescription&, Virtual int MBVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg) { + REQUIRE_PROMISE(video); switch (request) { case FB_IOCTL_GET_SIZE_IN_BYTES: { auto* out = (size_t*)arg; -- cgit v1.2.3