[Intel-gfx] [PATCH] drm/i915: prevent division by zero when asking for chipset power

Jesse Barnes jbarnes at virtuousgeek.org
Fri Nov 11 16:36:44 CET 2011


On Thu, 10 Nov 2011 10:51:26 -0200
Eugeni Dodonov <eugeni.dodonov at intel.com> wrote:

> 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 at gmail.com>, who proposed a similar patch.
> 
> Reported-by: Konstantin Belousov <kostikbel at gmail.com>
> Acked-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> Acked-by: Keith Packard <keithp at keithp.com>
> Cc: <stable at vger.kernel.org>
> Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
> ---

Yep, looks fine, thanks for pushing this Eugeni.

-- 
Jesse Barnes, Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20111111/6b8ad131/attachment.sig>


More information about the Intel-gfx mailing list