Chris Wilson
91b712cffa
drm/i915: Prevent writing into a read-only object via a GGTT mmap
...
commit 3e977ac6179b39faa3c0eda5fce4f00663ae298d upstream.
If the user has created a read-only object, they should not be allowed
to circumvent the write protection by using a GGTT mmapping. Deny it.
Also most machines do not support read-only GGTT PTEs, so again we have
to reject attempted writes. Fortunately, this is known a priori, so we
can at least reject in the call to create the mmap (with a sanity check
in the fault handler).
v2: Check the vma->vm_flags during mmap() to allow readonly access.
v3: Remove VM_MAYWRITE to curtail mprotect()
Testcase: igt/gem_userptr_blits/readonly_mmap*
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com> #v1
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712185315.3288-4-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-12 19:16:16 +01:00
..
bridge
drm/bridge: analogix_dp: Add analogix_dp_psr_supported
2016-10-04 08:23:16 +02:00
i2c
drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding
2016-09-07 13:10:10 +01:00
ttm
drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces
2017-04-12 12:41:10 +02:00
ati_pcigart.h
drm_agpsupport.h
drm: Give drm_agp_clear drm_legacy_ prefix
2016-04-27 08:41:34 +02:00
drm_atomic.h
drm: Extract drm_plane.[hc]
2016-09-22 00:01:56 -07:00
drm_atomic_helper.h
drm/fence: allow fence waiting to be interrupted by userspace
2016-09-12 16:59:15 -04:00
drm_auth.h
drm: document drm_auth.c
2016-06-21 22:10:55 +02:00
drm_blend.h
drm: Fix plane type uabi breakage
2016-09-22 23:52:12 -07:00
drm_bridge.h
drm: Extract drm_bridge.h
2016-09-19 15:04:15 +02:00
drm_cache.h
drm: disable uncached DMA optimization for ARM and arm64
2019-03-13 14:05:01 -07:00
drm_color_mgmt.h
drm/doc: Document color space handling
2016-09-22 00:04:03 -07:00
drm_connector.h
drm: prevent double-(un)registration for connectors
2017-06-17 06:41:53 +02:00
drm_crtc.h
drm/crtc: constify drm_crtc_index parameter
2016-10-10 17:28:58 +02:00
drm_crtc_helper.h
drm: Allow determining if current task is output poll worker
2018-03-18 11:18:48 +01:00
drm_displayid.h
drm/edid: add displayid detailed 1 timings to the modelist. (v1.1)
2016-05-23 11:35:31 +10:00
drm_dp_dual_mode_helper.h
drm: Add helper for DP++ adaptors
2016-05-23 11:10:46 +03:00
drm_dp_helper.h
drm: Add DP PSR2 sink enable bit
2018-08-03 07:55:26 +02:00
drm_dp_mst_helper.h
drm/dp-mst: Missing kernel doc
2016-07-19 10:31:53 +02:00
drm_edid.h
drm: Move all decl for drm_edid.c to drm_edid.h
2016-09-19 15:04:32 +02:00
drm_encoder.h
drm: Move a few macros away from drm_crtc.h
2016-09-19 15:03:46 +02:00
drm_encoder_slave.h
drm: Constify drm_encoder_slave_funcs
2015-12-15 13:41:17 +01:00
drm_fb_cma_helper.h
drm/fb_cma_helper: add suspend helper
2016-06-18 18:33:54 -07:00
drm_fb_helper.h
drm/fb-helper: fix sphinx markup for DRM_FB_HELPER_DEFAULT_OPS
2016-10-10 11:19:42 +02:00
drm_fixed.h
drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil
2016-02-05 15:23:48 +10:00
drm_flip_work.h
drm: flip-work: change drm_flip_work_init prototype
2014-11-15 09:29:14 +10:00
drm_fourcc.h
drm: move drm_mode_legacy_fb_format to drm_fourcc.c
2016-08-29 15:37:28 +02:00
drm_framebuffer.h
drm: Move a few macros away from drm_crtc.h
2016-09-19 15:03:46 +02:00
drm_gem.h
drm/doc: Fix more kerneldoc/sphinx warnings
2016-08-16 16:09:58 +02:00
drm_gem_cma_helper.h
drm/cma: Introduce drm_gem_cma_dumb_create_internal()
2014-11-13 13:27:17 +01:00
drm_global.h
drm_hashtab.h
drm_irq.h
drm: Extract&Document drm_irq.h
2016-07-19 10:29:47 +02:00
drm_legacy.h
drm: document drm_auth.c
2016-06-21 22:10:55 +02:00
drm_mem_util.h
drm,i915: Introduce drm_malloc_gfp()
2016-04-11 17:13:10 +01:00
drm_mipi_dsi.h
drm/dsi: Implement DCS set/get display brightness
2016-08-24 13:34:00 +02:00
drm_mm.h
drm: Track drm_mm nodes with an interval tree
2016-08-08 10:05:16 +02:00
drm_mode_object.h
drm: Extract drm_bridge.h
2016-09-19 15:04:15 +02:00
drm_modes.h
drm: Extract drm_bridge.h
2016-09-19 15:04:15 +02:00
drm_modeset_helper.h
drm/kms-helpers: Extract drm_modeset_helper.[hc]
2016-08-16 16:10:19 +02:00
drm_modeset_helper_vtables.h
drm/atomic-helper: Add atomic_disable CRTC helper callback
2016-08-29 10:21:52 +02:00
drm_modeset_lock.h
drm: Implement drm_modeset_lock_all_ctx()
2015-12-02 23:10:59 +01:00
drm_of.h
drm: add drm_of_encoder_active_endpoint helpers
2016-02-10 14:19:21 +01:00
drm_os_linux.h
drm_panel.h
drm/panel: Flesh out kerneldoc
2016-05-06 16:04:48 +02:00
drm_pciids.h
drm/radeon: add new OLAND pci id
2015-08-12 12:24:05 -04:00
drm_plane.h
drm: Don't force all planes to be added to the state due to zpos
2016-10-26 18:48:05 +02:00
drm_plane_helper.h
drm/kms-helpers: Extract drm_modeset_helper.[hc]
2016-08-16 16:10:19 +02:00
drm_property.h
drm: Move a few macros away from drm_crtc.h
2016-09-19 15:03:46 +02:00
drm_rect.h
drm: Add "prefix" parameter to drm_rect_debug_print()
2015-11-24 11:47:46 +01:00
drm_simple_kms_helper.h
drm: simple_kms_helper: Add prepare_fb and cleanup_fb hooks
2016-10-05 15:18:02 +02:00
drm_sysfs.h
drm_vma_manager.h
drm/i915: Prevent writing into a read-only object via a GGTT mmap
2019-11-12 19:16:16 +01:00
drmP.h
drm: Don't race connector registration
2017-06-17 06:41:53 +02:00
gma_drm.h
i915_component.h
drm/i915: Add get_eld audio component
2015-12-10 13:39:27 +01:00
i915_drm.h
drm: avoid "possible bad bitmask?" warning
2016-08-09 22:18:26 +02:00
i915_pciids.h
drm/i915: more .is_mobile cleanups for BDW
2017-04-12 12:41:18 +02:00
intel-gtt.h
drm/i915: Add support for mapping an object page by page
2016-06-13 10:03:54 +01:00