On 14/04/2015 15:50, Sagi Grimberg wrote:
> On 4/14/2015 3:00 PM, Yann Droneaud wrote:
>> Le mardi 14 avril 2015 à 12:20 +0300, Sagi Grimberg a écrit :
>>> On 4/13/2015 3:56 PM, Yann Droneaud wrote:
...
>>>> diff --git a/drivers/infiniband/core/umem.c
>>>> b/drivers/infiniband/core/umem.c
>>>> index 9ac4068d2088..38acb3cfc545 100644
>>>> --- a/drivers/infiniband/core/umem.c
>>>> +++ b/drivers/infiniband/core/umem.c
>>>> @@ -106,8 +106,8 @@ struct ib_umem *ib_umem_get(struct ib_ucontext 
>>>> *context, unsigned long addr,
>>>>         * If the combination of the addr and size requested for this memory
>>>>         * region causes an integer overflow, return error.
>>>>         */
>>>> -    if ((PAGE_ALIGN(addr + size) <= size) ||
>>>> -        (PAGE_ALIGN(addr + size) <= addr))
>>>> +    if (((addr + size) < addr) ||
>>>> +        PAGE_ALIGN(addr + size) < (addr + size))
>>>
>>> If you do change the first statement to be: (addr + size) <= addr
>>> wouldn't it cover patch #1?
>>>
>>
>> Yes, but it doesn't sound a great place to do it: here it's about
>> overflow, so I'd prefer not doing the null memory region check there.
>>
>> Regards.
>>
> 
> Sounds reasonable to me.

Me too. As long as we prevent the integer overflow, there is no need to
disallow regions starting at 0x0.

Reviewed-by: Haggai Eran <hagg...@mellanox.com>

> 
> Reviewed-by: Sagi Grimberg <sa...@mellanox.com>
> 
> Let's poke Shachar/Haggai to comment/approve on this as well.
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to