mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
0c3767b281
crtc_state_is_legacy_gamma also checks for CTM, which was missing from
intel_color_check. By using the same condition for commit and check
we reduce the chance of mismatches.
This was spotted by KASAN while trying to rework kms_color igt test.
[ 72.008660] ==================================================================
[ 72.009326] BUG: KASAN: slab-out-of-bounds in bdw_load_gamma_lut.isra.3+0x15c/0x360 [i915]
[ 72.009519] Read of size 2 at addr ffff880220216e50 by task kms_color/1158
[ 72.009900] CPU: 2 PID: 1158 Comm: kms_color Tainted: G U W 4.14.0-rc3-patser+ #5281
[ 72.009921] Hardware name: GIGABYTE GB-BKi3A-7100/MFLP3AP-00, BIOS F1 07/27/2016
[ 72.009941] Call Trace:
[ 72.009968] dump_stack+0xc5/0x151
[ 72.009996] ? _atomic_dec_and_lock+0x10f/0x10f
[ 72.010024] ? show_regs_print_info+0x3c/0x3c
[ 72.010072] print_address_description+0x7f/0x240
[ 72.010108] kasan_report+0x216/0x370
[ 72.010308] ? bdw_load_gamma_lut.isra.3+0x15c/0x360 [i915]
[ 72.010349] __asan_load2+0x74/0x80
[ 72.010552] bdw_load_gamma_lut.isra.3+0x15c/0x360 [i915]
[ 72.010772] broadwell_load_luts+0x1f0/0x300 [i915]
[ 72.010997] intel_color_load_luts+0x36/0x40 [i915]
[ 72.011205] intel_begin_crtc_commit+0xa1/0x310 [i915]
[ 72.011283] drm_atomic_helper_commit_planes_on_crtc+0xa6/0x320 [drm_kms_helper]
[ 72.011316] ? wait_for_completion_io+0x460/0x460
[ 72.011524] intel_update_crtc+0xe3/0x100 [i915]
[ 72.011720] skl_update_crtcs+0x360/0x3f0 [i915]
[ 72.011945] ? intel_update_crtcs+0xf0/0xf0 [i915]
[ 72.012010] ? drm_atomic_helper_wait_for_dependencies+0x3d9/0x400 [drm_kms_helper]
[ 72.012231] intel_atomic_commit_tail+0x8db/0x1500 [i915]
[ 72.012273] ? __lock_is_held+0x9c/0xc0
[ 72.012494] ? skl_update_crtcs+0x3f0/0x3f0 [i915]
[ 72.012518] ? find_next_bit+0xb/0x10
[ 72.012544] ? cpumask_next+0x1a/0x20
[ 72.012745] ? i915_sw_fence_complete+0x9d/0xe0 [i915]
[ 72.012938] ? __i915_sw_fence_complete+0x5d0/0x5d0 [i915]
[ 72.013176] intel_atomic_commit+0x528/0x570 [i915]
[ 72.013280] ? drm_atomic_get_property+0xc00/0xc00 [drm]
[ 72.013466] ? intel_atomic_commit_tail+0x1500/0x1500 [i915]
[ 72.013496] ? kmem_cache_alloc_trace+0x266/0x280
[ 72.013714] ? intel_atomic_commit_tail+0x1500/0x1500 [i915]
[ 72.013812] drm_atomic_commit+0x77/0x80 [drm]
[ 72.013911] set_property_atomic+0x14a/0x210 [drm]
[ 72.014015] ? drm_object_property_get_value+0x70/0x70 [drm]
[ 72.014080] ? mutex_unlock+0xd/0x10
[ 72.014292] ? intel_atomic_commit_tail+0x1500/0x1500 [i915]
[ 72.014379] drm_mode_obj_set_property_ioctl+0x1cf/0x310 [drm]
[ 72.014481] ? drm_mode_obj_find_prop_id+0xa0/0xa0 [drm]
[ 72.014510] ? lock_release+0x6c0/0x6c0
[ 72.014602] ? drm_is_current_master+0x46/0x60 [drm]
[ 72.014706] drm_ioctl_kernel+0x148/0x1d0 [drm]
[ 72.014799] ? drm_mode_obj_find_prop_id+0xa0/0xa0 [drm]
[ 72.014898] ? drm_ioctl_permit+0x100/0x100 [drm]
[ 72.014936] ? kasan_check_write+0x14/0x20
[ 72.015039] drm_ioctl+0x441/0x660 [drm]
[ 72.015129] ? drm_mode_obj_find_prop_id+0xa0/0xa0 [drm]
[ 72.015235] ? drm_getstats+0x20/0x20 [drm]
[ 72.015287] ? ___might_sleep+0x159/0x340
[ 72.015311] ? find_held_lock+0xcf/0xf0
[ 72.015341] ? __schedule_bug+0x110/0x110
[ 72.015405] do_vfs_ioctl+0xa88/0xb10
[ 72.015449] ? ioctl_preallocate+0x1a0/0x1a0
[ 72.015487] ? selinux_capable+0x20/0x20
[ 72.015525] ? rcu_dynticks_momentary_idle+0x40/0x40
[ 72.015607] SyS_ioctl+0x4e/0x80
[ 72.015647] entry_SYSCALL_64_fastpath+0x18/0xad
[ 72.015670] RIP: 0033:0x7ff74a3d04d7
[ 72.015691] RSP: 002b:00007ffc594bec08 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 72.015734] RAX: ffffffffffffffda RBX: ffffffff8718f54a RCX: 00007ff74a3d04d7
[ 72.015756] RDX: 00007ffc594bec40 RSI: 00000000c01864ba RDI: 0000000000000003
[ 72.015777] RBP: ffff880211c0ff98 R08: 0000000000000086 R09: 0000000000000000
[ 72.015799] R10: 00007ff74a691b58 R11: 0000000000000246 R12: 0000000000000355
[ 72.015821] R13: 00000000ff00eb00 R14: 0000000000000a00 R15: 00007ff746082000
[ 72.015857] ? trace_hardirqs_off_caller+0xfa/0x110
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171005141520.23990-1-maarten.lankhorst@linux.intel.com
[mlankhorst: s/crtc_state_is_legacy/&_gamma/ (danvet)]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes:
|
||
---|---|---|
.. | ||
gvt | ||
selftests | ||
dvo.h | ||
dvo_ch7xxx.c | ||
dvo_ch7017.c | ||
dvo_ivch.c | ||
dvo_ns2501.c | ||
dvo_sil164.c | ||
dvo_tfp410.c | ||
i915_cmd_parser.c | ||
i915_debugfs.c | ||
i915_drv.c | ||
i915_drv.h | ||
i915_gem.c | ||
i915_gem.h | ||
i915_gem_batch_pool.c | ||
i915_gem_batch_pool.h | ||
i915_gem_clflush.c | ||
i915_gem_clflush.h | ||
i915_gem_context.c | ||
i915_gem_context.h | ||
i915_gem_dmabuf.c | ||
i915_gem_evict.c | ||
i915_gem_execbuffer.c | ||
i915_gem_fence_reg.c | ||
i915_gem_fence_reg.h | ||
i915_gem_gtt.c | ||
i915_gem_gtt.h | ||
i915_gem_internal.c | ||
i915_gem_object.c | ||
i915_gem_object.h | ||
i915_gem_render_state.c | ||
i915_gem_render_state.h | ||
i915_gem_request.c | ||
i915_gem_request.h | ||
i915_gem_shrinker.c | ||
i915_gem_stolen.c | ||
i915_gem_tiling.c | ||
i915_gem_timeline.c | ||
i915_gem_timeline.h | ||
i915_gem_userptr.c | ||
i915_gpu_error.c | ||
i915_guc_reg.h | ||
i915_guc_submission.c | ||
i915_guc_submission.h | ||
i915_ioc32.c | ||
i915_irq.c | ||
i915_memcpy.c | ||
i915_mm.c | ||
i915_oa_bdw.c | ||
i915_oa_bdw.h | ||
i915_oa_bxt.c | ||
i915_oa_bxt.h | ||
i915_oa_cflgt2.c | ||
i915_oa_cflgt2.h | ||
i915_oa_chv.c | ||
i915_oa_chv.h | ||
i915_oa_glk.c | ||
i915_oa_glk.h | ||
i915_oa_hsw.c | ||
i915_oa_hsw.h | ||
i915_oa_kblgt2.c | ||
i915_oa_kblgt2.h | ||
i915_oa_kblgt3.c | ||
i915_oa_kblgt3.h | ||
i915_oa_sklgt2.c | ||
i915_oa_sklgt2.h | ||
i915_oa_sklgt3.c | ||
i915_oa_sklgt3.h | ||
i915_oa_sklgt4.c | ||
i915_oa_sklgt4.h | ||
i915_params.c | ||
i915_params.h | ||
i915_pci.c | ||
i915_perf.c | ||
i915_pvinfo.h | ||
i915_reg.h | ||
i915_selftest.h | ||
i915_suspend.c | ||
i915_sw_fence.c | ||
i915_sw_fence.h | ||
i915_syncmap.c | ||
i915_syncmap.h | ||
i915_sysfs.c | ||
i915_trace.h | ||
i915_trace_points.c | ||
i915_utils.h | ||
i915_vgpu.c | ||
i915_vgpu.h | ||
i915_vma.c | ||
i915_vma.h | ||
intel_acpi.c | ||
intel_atomic.c | ||
intel_atomic_plane.c | ||
intel_audio.c | ||
intel_bios.c | ||
intel_bios.h | ||
intel_breadcrumbs.c | ||
intel_cdclk.c | ||
intel_color.c | ||
intel_crt.c | ||
intel_csr.c | ||
intel_ddi.c | ||
intel_device_info.c | ||
intel_display.c | ||
intel_dp.c | ||
intel_dp_aux_backlight.c | ||
intel_dp_link_training.c | ||
intel_dp_mst.c | ||
intel_dpio_phy.c | ||
intel_dpll_mgr.c | ||
intel_dpll_mgr.h | ||
intel_drv.h | ||
intel_dsi.c | ||
intel_dsi.h | ||
intel_dsi_dcs_backlight.c | ||
intel_dsi_pll.c | ||
intel_dsi_vbt.c | ||
intel_dvo.c | ||
intel_engine_cs.c | ||
intel_fbc.c | ||
intel_fbdev.c | ||
intel_fifo_underrun.c | ||
intel_frontbuffer.c | ||
intel_frontbuffer.h | ||
intel_guc.c | ||
intel_guc.h | ||
intel_guc_ct.c | ||
intel_guc_ct.h | ||
intel_guc_fwif.h | ||
intel_guc_loader.c | ||
intel_guc_log.c | ||
intel_guc_log.h | ||
intel_gvt.c | ||
intel_gvt.h | ||
intel_hangcheck.c | ||
intel_hdmi.c | ||
intel_hotplug.c | ||
intel_huc.c | ||
intel_huc.h | ||
intel_i2c.c | ||
intel_lpe_audio.c | ||
intel_lrc.c | ||
intel_lrc.h | ||
intel_lspcon.c | ||
intel_lvds.c | ||
intel_mocs.c | ||
intel_mocs.h | ||
intel_modes.c | ||
intel_opregion.c | ||
intel_overlay.c | ||
intel_panel.c | ||
intel_pipe_crc.c | ||
intel_pm.c | ||
intel_psr.c | ||
intel_renderstate.h | ||
intel_renderstate_gen6.c | ||
intel_renderstate_gen7.c | ||
intel_renderstate_gen8.c | ||
intel_renderstate_gen9.c | ||
intel_ringbuffer.c | ||
intel_ringbuffer.h | ||
intel_runtime_pm.c | ||
intel_sdvo.c | ||
intel_sdvo_regs.h | ||
intel_sideband.c | ||
intel_sprite.c | ||
intel_tv.c | ||
intel_uc.c | ||
intel_uc.h | ||
intel_uc_fw.c | ||
intel_uc_fw.h | ||
intel_uncore.c | ||
intel_uncore.h | ||
intel_vbt_defs.h | ||
Kconfig | ||
Kconfig.debug | ||
Makefile |