Thread (12 messages) flat view 12 messages, 4 authors, 2017-09-01

Re: [PATCH 2/2] mm: introduce MAP_VALIDATE, a mechanism for for safely defining new mmap flags

From: Christoph Hellwig <hidden>
Date: 2017-09-01 07:34:08
Also in: linux-mm, nvdimm

On Thu, Aug 31, 2017 at 06:27:31PM -0700, Linus Torvalds wrote:
Why? That's no different from the case statement for the mmu case,
just written differently.
Yes.
You *want* existing kernels to fail, since they don't test the bits
you want to test.

So you just want to rewrite these all as

    switch (flags & MAP_TYPE) {
    case MAP_SHARED_VALIDATE:
        .. validate the other bits...
        /* fallhtough */
    case MAP_SHARED:
        .. do the shared case ..
    case MAP_PRIVATE:
        .. do the private case ..
    default:
        return -EINVAL;
    }
Btw, at least my original idea was to make MAP_VALIDATE a flag
instead of another mapping type, that is take it out of MAP_TYPE.

That being said this version is ok with me too - the chances of
needing a new type of private mappings probably isn't too big.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help