From: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Sagi Grimberg
<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
Cc: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Jack Morgenstein <jackm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0
Date: Tue, 14 Apr 2015 17:35:02 +0300 [thread overview]
Message-ID: <552D2596.50901@mellanox.com> (raw)
In-Reply-To: <552D0D2A.8000604-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
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 <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-04-14 14:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 12:56 [PATCH v1 0/2] Fixes on top of CVE-2014-8159 kernel: infiniband: uverbs: unprotected physical memory access Yann Droneaud
[not found] ` <cover.1428929103.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-04-13 12:56 ` [PATCH v1 1/2] IB/core: disallow registering 0-sized memory region Yann Droneaud
2015-04-13 12:56 ` [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0 Yann Droneaud
2015-04-14 9:20 ` Sagi Grimberg
2015-04-14 12:00 ` Yann Droneaud
[not found] ` <1429012859.4333.2.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-04-14 12:50 ` Sagi Grimberg
[not found] ` <552D0D2A.8000604-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-04-14 14:35 ` Haggai Eran [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552D2596.50901@mellanox.com \
--to=haggaie-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=jackm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox