diff options
author | Eugeni Dodonov <eugeni.dodonov@intel.com> | 2011-11-10 13:55:15 -0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-06 14:13:45 -0800 |
commit | 183647b865aea1411c87f9b76b8c74511e34807d (patch) | |
tree | 7c185739e71bdf55bde6ea79108a0f6d0bbe3f1c /block | |
parent | bd43f8f08f6645690724869150df18ef0dc6a7dd (diff) |
drm/i915: prevent division by zero when asking for chipset power
commit 4ed0b577457eb6aeb7cdc7e7316576e63d15abb2 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
<kostikbel@gmail.com>, who proposed a similar patch.
Reported-by: Konstantin Belousov <kostikbel@gmail.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions