|
Message-ID: <CAG_fn=URD0WL+RE90ZE2FZM4=p2zE9V+YA2RW-LrWnuqYTwvKQ@mail.gmail.com> Date: Thu, 18 Apr 2019 18:43:27 +0200 From: Alexander Potapenko <glider@...gle.com> To: Dave Hansen <dave.hansen@...el.com> Cc: Andrew Morton <akpm@...ux-foundation.org>, Christoph Lameter <cl@...ux.com>, Dmitriy Vyukov <dvyukov@...gle.com>, Kees Cook <keescook@...omium.org>, Laura Abbott <labbott@...hat.com>, Linux Memory Management List <linux-mm@...ck.org>, linux-security-module <linux-security-module@...r.kernel.org>, Kernel Hardening <kernel-hardening@...ts.openwall.com> Subject: Re: [PATCH 1/3] mm: security: introduce the init_allocations=1 boot option On Thu, Apr 18, 2019 at 6:35 PM Dave Hansen <dave.hansen@...el.com> wrote: > > On 4/18/19 8:42 AM, Alexander Potapenko wrote: > > This option adds the possibility to initialize newly allocated pages and > > heap objects with zeroes. This is needed to prevent possible information > > leaks and make the control-flow bugs that depend on uninitialized values > > more deterministic. > > Isn't it better to do this at free time rather than allocation time? If > doing it at free, you can't even have information leaks for pages that > are in the allocator. I should have mentioned this in the patch description, as this question is being asked every time I send a patch :) If we want to avoid double initialization and take advantage of __GFP_NOINIT (see the second and third patches in the series) we need to do initialize the memory at allocation time, because free() and free_pages() don't accept GFP flags. -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
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.