History

drm: prime: Honour O_RDWR during prime-handle-to-fd

Currently DRM_IOCTL_PRIME_HANDLE_TO_FD rejects all flags except (DRM|O)_CLOEXEC making it difficult (maybe impossible) for userspace to mmap() the resulting dma-buf even when this is supported by the DRM driver. It is trivial to relax the restriction and permit read/write access. This is safe because the flags are seldom touched by drm; mostly they are passed verbatim to dma_buf calls. v3 (Tiago): removed unused flags variable from drm_prime_handle_to_fd_ioctl.

Daniel Thompson committed 10 years ago

Commit bfe981a1 parent 10c1b612 files · +4 −7Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/drm/drm.h+1−0
@@ -669,6 +669,7 @@ struct drm_set_client_cap { · 668 unmodified lines
669669 __u64 value;
670670 };
671671
672+#define DRM_RDWR O_RDWR
672673 #define DRM_CLOEXEC O_CLOEXEC
673674 struct drm_prime_handle {
674675 __u32 handle;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t