lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjv3-eP7mSDJbuvaB+CbyyKc4g_nEzhQLcueOd0_YuiBg@mail.gmail.com>
Date:   Fri, 28 May 2021 15:03:58 -1000
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     "Lin, Ming" <minggr@...il.com>, Hugh Dickins <hughd@...gle.com>
Cc:     Simon Ser <contact@...rsion.fr>, Peter Xu <peterx@...hat.com>,
        "Kirill A. Shutemov" <kirill@...temov.name>,
        Matthew Wilcox <willy@...radead.org>,
        Dan Williams <dan.j.williams@...el.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Will Deacon <will@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        David Herrmann <dh.herrmann@...il.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Greg Kroah-Hartman <greg@...ah.com>,
        "tytso@....edu" <tytso@....edu>
Subject: Re: Sealed memfd & no-fault mmap

On Fri, May 28, 2021 at 7:07 AM Lin, Ming <minggr@...il.com> wrote:
>
> Does something like following draft patch on the right track?

No, I don't think this can work:

> +               _dst_pte = pte_mkspecial(pfn_pte(my_zero_pfn(dst_addr),
> +                                        vma->vm_page_prot));

You can't just blindly insert the zero pfn - for a shared write
mapping, that would actually allow writes to the zeropage. That would
be horrible.

So it would have to do all the same things that it does for a page
that is inside the inode size.

I do also dislike how it's a per-inode flag - so it would affect other
mappings of the same shared memory segment too. But considering that
the page would have to be part of the page cache for that shmem inode,
that may be inevitable. But it sure does smell a bit.

Oh, and if we make this kind of magic shmem extension, Hugh Dickins
should be part of the conversation  too. Hugh, you probably saw the
original on linux-mm, but I'm adding you explicitly to the
participants here.

.. and if you didn't see the background, here it is

  https://lore.kernel.org/linux-mm/vs1Us2sm4qmfvLOqNat0-r16GyfmWzqUzQ4KHbXJwEcjhzeoQ4sBTxx7QXDG9B6zk5AeT7FsNb3CSr94LaKy6Novh1fbbw8D_BBxYsbPLms=@emersion.fr/

for your edification..

           Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ