|
Message-ID: <CAHD1Q_wQrnSEGOvbCi0uhHZ5bRf=inzPdOhGKJ9PkVms5GSWRA@mail.gmail.com> Date: Tue, 20 Oct 2020 17:19:42 -0300 From: Guilherme Piccoli <gpiccoli@...onical.com> To: David Hildenbrand <david@...hat.com> Cc: Michal Hocko <mhocko@...e.com>, Mike Kravetz <mike.kravetz@...cle.com>, linux-mm@...ck.org, kernel-hardening@...ts.openwall.com, linux-hardening@...r.kernel.org, linux-security-module@...r.kernel.org, "Guilherme G. Piccoli" <kernel@...ccoli.net>, Thadeu Lima de Souza Cascardo <cascardo@...onical.com>, Alexander Potapenko <glider@...gle.com>, James Morris <jamorris@...ux.microsoft.com>, Kees Cook <keescook@...omium.org> Subject: Re: [PATCH] mm, hugetlb: Avoid double clearing for hugetlb pages When I first wrote that, the design was a bit different, the flag was called __GFP_HTLB_PAGE or something like that. The design was to signal/mark the composing pages of hugetlb as exactly this: they are pages composing a huge page of hugetlb "type". Then, I skipped the "init_on_alloc" thing for such pages. If your concern is more about semantics (or giving multiple users, like drivers, the power to try "optimize" their code and skip this security feature), I think my first approach was better! This way, the flag would be restricted to hugetlb usage only. I've changed my mind about that approach before submitting for 2 reasons: (a) It feels a waste of resources having a GFP flag *only* to signal regular pages composing hugetlb pages, it's a single user only, forever! (b) Having 2 conditional settings on __GFP_BITS_SHIFT (LOCKDEP and HUGETLB) started to make this define a bit tricky to code, since we'd have 2 Kconfig-conditional bits to be set. So, I've moved to this other approach, hereby submitted. Cheers, Guilherme
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.