Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706534

Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK

From Rik van Riel <riel@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK
Date 2017-08-08 15:20 +0200
Message-ID <uccAp-rl-11@gated-at.bofh.it> (permalink)
References <ubupJ-3f0-29@gated-at.bofh.it> <ubUWR-3Xj-1@gated-at.bofh.it> <uc9sS-6dC-25@gated-at.bofh.it>
Organization Red Hat, Inc

Show all headers | View raw


On Tue, 2017-08-08 at 11:58 +0200, Florian Weimer wrote:
> On 08/07/2017 08:23 PM, Mike Kravetz wrote:
> > If my thoughts above are correct, what about returning EINVAL if
> > one
> > attempts to set MADV_DONTFORK on mappings set up for sharing?
> 
> That's my preference as well.  If there is a use case for shared or
> non-anonymous mappings, then we can implement MADV_DONTFORK with the
> semantics for this use case.  If we pick some arbitrary semantics
> now,
> without any use case, we might end up with something that's not
> actually
> useful.

MADV_DONTFORK is existing semantics, and it is enforced
on shared, non-anonymous mappings. It is frequently used
for things like device mappings, which should not be
inherited by a child process, because the device can only
be used by one process at a time.

When someone requests MADV_DONTFORK on a shared VMA, they
will get it. The later madvise request overrides the mmap
flags that were used earlier.

The question is, should MADV_WIPEONFORK (introduced by
this series) have not just different semantics, but also
totally different behavior from MADV_DONTFORK?

Does the principle of least surprise dictate that the
last request determines the policy on an area, or should
later requests not be able to override policy that was
set at mmap time?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK riel@redhat.com - 2017-08-06 16:10 +0200
  Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-07 15:30 +0200
    Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-07 15:50 +0200
      Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-07 16:20 +0200
        Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 15:10 +0200
      Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Rik van Riel <riel@redhat.com> - 2017-08-07 17:10 +0200
        Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-09 12:10 +0200
          Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Rik van Riel <riel@redhat.com> - 2017-08-09 14:40 +0200
          Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-09 14:50 +0200
        Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 15:10 +0200
          Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Colm MacCárthaigh <colm@allcosts.net> - 2017-08-10 15:30 +0200
            Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 17:40 +0200
              Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 19:10 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Colm MacCárthaigh <colm@allcosts.net> - 2017-08-11 00:20 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-11 16:10 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-11 16:20 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-11 16:30 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-11 17:30 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-11 17:40 +0200
      Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Colm MacCárthaigh <colm@allcosts.net> - 2017-08-07 18:10 +0200
      Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 15:30 +0200
        Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 16:20 +0200
  Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Mike Kravetz <mike.kravetz@oracle.com> - 2017-08-07 20:30 +0200
    Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-08 12:00 +0200
      Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Rik van Riel <riel@redhat.com> - 2017-08-08 15:20 +0200
        Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Mike Kravetz <mike.kravetz@oracle.com> - 2017-08-08 17:30 +0200
          Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Florian Weimer <fweimer@redhat.com> - 2017-08-08 17:30 +0200
          Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Rik van Riel <riel@redhat.com> - 2017-08-08 17:50 +0200
            Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Colm MacCárthaigh <colm@allcosts.net> - 2017-08-08 18:50 +0200
            Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Matthew Wilcox <willy@infradead.org> - 2017-08-08 19:00 +0200
              Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Rik van Riel <riel@redhat.com> - 2017-08-08 20:50 +0200
                Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK Michal Hocko <mhocko@kernel.org> - 2017-08-10 17:40 +0200

csiph-web