Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915: prevent division by zero when asking for chipset power
commit 4ed0b57 upstream. This prevents an in-kernel division by zero which happens when we are asking for i915_chipset_val too quickly, or within a race condition between the power monitoring thread and userspace accesses via debugfs. The issue can be reproduced easily via the following command: while ``; do cat /sys/kernel/debug/dri/0/i915_emon_status; done This is particularly dangerous because it can be triggered by a non-privileged user by just reading the debugfs entry. This issue was also found independently by Konstantin Belousov <[email protected]>, who proposed a similar patch. Reported-by: Konstantin Belousov <[email protected]> Acked-by: Jesse Barnes <[email protected]> Acked-by: Keith Packard <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Eugeni Dodonov <[email protected]> Signed-off-by: Keith Packard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information