Re: [PATCH 3/4] drm/i915: Use unsigned long for obj->user_pin_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 10, 2013 at 10:56 AM, Ville Syrjälä
<ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> On Wed, Oct 09, 2013 at 09:23:53PM +0200, Daniel Vetter wrote:
>> At least on linux sizeof(long) == sizeof(void*) and the thinking
>> is that you can grab about as many references as there's memory.
>
> Well, there can be more memory than there is address space.
>
> Unchecked counters always leave me a bit uneasy, so an explicit check
> is what I'd prefer to see.

Not for normal kernel references, but this one here is just userspace.
I'll add a UINT_MAX check to the pin ioctl to plug that leak. That'll
also make this patch a notch more useful. I'm not going to write a
testcase for this though since Ben will complain about the runtime of
it ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux