Date: Thu, 22 Feb 2018 10:58:58 +0200 From: Igor Stoppa <igor.stoppa@...wei.com> To: Dave Chinner <dchinner@...hat.com> CC: Matthew Wilcox <willy@...radead.org>, Kees Cook <keescook@...omium.org>, Randy Dunlap <rdunlap@...radead.org>, Jonathan Corbet <corbet@....net>, Michal Hocko <mhocko@...nel.org>, Laura Abbott <labbott@...hat.com>, "Jerome Glisse" <jglisse@...hat.com>, Christoph Hellwig <hch@...radead.org>, "Christoph Lameter" <cl@...ux.com>, linux-security-module <linux-security-module@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>, Kernel Hardening <kernel-hardening@...ts.openwall.com> Subject: Re: [RFC PATCH v16 0/6] mm: security: ro protection for dynamic data On 21/02/18 23:36, Dave Chinner wrote: > On Wed, Feb 21, 2018 at 11:56:22AM +0200, Igor Stoppa wrote: [...] > It seems lots of people get confused when discussing concepts vs > implementation... :) IMHO, if possible, it's better to use unambiguous terms at every point. __ro_after_init is already taken :-P In this specific case, I wanted to be absolutely sure I understood correctly what you need. I think I have now, thanks. >> is this something that is readonly from the beginning and then shared >> among mount points or is it specific to each mount point? > > It's dynamically allocated for each mount point, made read-only > before the mount completes and lives for the length of the mount > point. ok. And destroyed when the mount point is unmounted, I expect. [...] >> The "const" modifier is a nice way to catch errors through the compiler, >> iff the ro data will not be initialized through this handle, when it's >> still writable. > > That's kinda implied by the const, isn't it? If we don't do it that > way, then the compiler will throw errors.... I might be splitting the hair, but since I'm advertising something I worte, I don't want to look like a peddler of snake oil, in hindsight :-P To clarify my previous comment: * const can mean the world to the compiler, but that doesn't automatically translate into write-protected memory, yet I do appreciate the advantage of teaching the compiler what should not be altered. And I have nothing against doing it. * even if some handle will be const, it still needs to be aliased to some other pointer that is not const, at the beginning, because it must be initialized and it's anyway writable. So, this cannot be avoided. -- igor
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.