Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2aabe10d-2ccb-2ba6-18bb-b7f52d70d36c@redhat.com>
Date: Wed, 20 Jul 2016 08:36:38 -0700
From: Laura Abbott <labbott@...hat.com>
To: Balbir Singh <bsingharora@...il.com>, Kees Cook <keescook@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Daniel Micay
 <danielmicay@...il.com>, Josh Poimboeuf <jpoimboe@...hat.com>,
 Rik van Riel <riel@...hat.com>, Casey Schaufler <casey@...aufler-ca.com>,
 PaX Team <pageexec@...email.hu>, Brad Spengler <spender@...ecurity.net>,
 Russell King <linux@...linux.org.uk>,
 Catalin Marinas <catalin.marinas@....com>, Will Deacon
 <will.deacon@....com>, Ard Biesheuvel <ard.biesheuvel@...aro.org>,
 Benjamin Herrenschmidt <benh@...nel.crashing.org>,
 Michael Ellerman <mpe@...erman.id.au>, Tony Luck <tony.luck@...el.com>,
 Fenghua Yu <fenghua.yu@...el.com>, "David S. Miller" <davem@...emloft.net>,
 "x86@...nel.org" <x86@...nel.org>, Christoph Lameter <cl@...ux.com>,
 Pekka Enberg <penberg@...nel.org>, David Rientjes <rientjes@...gle.com>,
 Joonsoo Kim <iamjoonsoo.kim@....com>,
 Andrew Morton <akpm@...ux-foundation.org>, Andy Lutomirski
 <luto@...nel.org>, Borislav Petkov <bp@...e.de>,
 Mathias Krause <minipli@...glemail.com>, Jan Kara <jack@...e.cz>,
 Vitaly Wool <vitalywool@...il.com>, Andrea Arcangeli <aarcange@...hat.com>,
 Dmitry Vyukov <dvyukov@...gle.com>,
 "linux-arm-kernel@...ts.infradead.org"
 <linux-arm-kernel@...ts.infradead.org>, linux-ia64@...r.kernel.org,
 "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
 sparclinux <sparclinux@...r.kernel.org>,
 linux-arch <linux-arch@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>,
 "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH v3 02/11] mm: Hardened usercopy

On 07/20/2016 03:24 AM, Balbir Singh wrote:
> On Tue, 2016-07-19 at 11:48 -0700, Kees Cook wrote:
>> On Mon, Jul 18, 2016 at 6:06 PM, Laura Abbott <labbott@...hat.com> wrote:
>>>
>>> On 07/15/2016 02:44 PM, Kees Cook wrote:
>>>
>>> This doesn't work when copying CMA allocated memory since CMA purposely
>>> allocates larger than a page block size without setting head pages.
>>> Given CMA may be used with drivers doing zero copy buffers, I think it
>>> should be permitted.
>>>
>>> Something like the following lets it pass (I can clean up and submit
>>> the is_migrate_cma_page APIs as a separate patch for review)
>> Yeah, this would be great. I'd rather use an accessor to check this
>> than a direct check for MIGRATE_CMA.
>>
>>>          */
>>>         for (; ptr <= end ; ptr += PAGE_SIZE, page = virt_to_head_page(ptr))
>>> {
>>> -               if (!PageReserved(page))
>>> +               if (!PageReserved(page) && !is_migrate_cma_page(page))
>>>                         return "<spans multiple pages>";
>>>         }
>> Yeah, I'll modify this a bit so that which type it starts as is
>> maintained for all pages (rather than allowing to flip back and forth
>> -- even though that is likely impossible).
>>
> Sorry, I completely missed the MIGRATE_CMA bits. Could you clarify if you
> caught this in testing/review?
>
> Balbir Singh.
>

I caught it while looking at the code and then wrote a test case to confirm
I was correct because I wasn't sure how to easily find an in tree user.

Thanks,
Laura

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.