From: Andrew Morton <akpm@linux-foundation.org>
To: Jeff Xu <jeffxu@google.com>
Cc: Peter Xu <peterx@redhat.com>, Kees Cook <keescook@chromium.org>,
jeffxu@chromium.org, skhan@linuxfoundation.org,
dmitry.torokhov@gmail.com, dverkamp@chromium.org,
hughd@google.com, jorgelo@chromium.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, jannh@google.com,
linux-hardening@vger.kernel.org,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v6 3/6] mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC
Date: Fri, 16 Dec 2022 09:42:59 -0800 [thread overview]
Message-ID: <20221216094259.bec91e4abd6cf54a05ce2813@linux-foundation.org> (raw)
In-Reply-To: <CALmYWFsDhX76zbcyhYAW-u0BBwD+m+TKpt4_pZTMt+22zHhrGQ@mail.gmail.com>
On Fri, 16 Dec 2022 09:15:40 -0800 Jeff Xu <jeffxu@google.com> wrote:
> On Fri, Dec 16, 2022 at 7:47 AM Peter Xu <peterx@redhat.com> wrote:
> >
> > Hi, Jeff,
> >
> > On Thu, Dec 08, 2022 at 02:55:45PM -0800, Jeff Xu wrote:
> > > > > + if (!(flags & (MFD_EXEC | MFD_NOEXEC_SEAL))) {
> >
> > [...]
> >
> > > > > + pr_warn_ratelimited(
> > > > > + "memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=%d '%s'\n",
> > > > > + task_pid_nr(current), get_task_comm(comm, current));
> >
> > This will be frequently dumped right now with mm-unstable. Is that what it
> > wanted to achieve?
> >
> > [ 10.822575] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=491 'systemd'
> > [ 10.824743] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=495 '(sd-executor)'
> > ...
> >
> > If there's already a sane default value (and also knobs for the user to
> > change the default) not sure whether it's saner to just keep it silent as
> > before?
> >
> Thanks for your comments.
>
> The intention is it is a reminder to adjust API calls to explicitly
> setting this bit.
Do we need to warn more than once per boot? If not, use pr_warn_once()?
> The sysctl vm.memfd_noexec = 0 1 is for transaction to the final
> state, and 2 depends on API call setting this bit.
>
> The log is ratelimited, and there is a rate limit setting:
> /proc/sys/kernel/printk_ratelimit
> /proc/sys/kernel/printk_ratelimit_burst
>
next prev parent reply other threads:[~2022-12-16 17:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 15:49 [PATCH v6 0/6] mm/memfd: introduce MFD_NOEXEC_SEAL and MFD_EXEC jeffxu
2022-12-07 15:49 ` [PATCH v6 1/6] mm/memfd: add F_SEAL_EXEC jeffxu
2022-12-08 16:16 ` Kees Cook
2022-12-07 15:49 ` [PATCH v6 2/6] selftests/memfd: add tests for F_SEAL_EXEC jeffxu
2022-12-08 16:21 ` Kees Cook
2022-12-07 15:49 ` [PATCH v6 3/6] mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC jeffxu
2022-12-08 16:27 ` Kees Cook
2022-12-08 22:55 ` Jeff Xu
2022-12-16 15:46 ` Peter Xu
2022-12-16 17:15 ` Jeff Xu
2022-12-16 17:42 ` Andrew Morton [this message]
2022-12-16 18:11 ` Jeff Xu
2022-12-16 20:35 ` Kees Cook
2022-12-16 21:46 ` Jeff Xu
2022-12-16 22:06 ` Andrew Morton
2022-12-16 23:40 ` Jeff Xu
2022-12-20 16:55 ` Shuah Khan
2022-12-23 18:06 ` Jeff Xu
2022-12-07 15:49 ` [PATCH v6 4/6] mm/memfd: Add write seals when apply SEAL_EXEC to executable memfd jeffxu
2022-12-08 16:27 ` Kees Cook
2022-12-07 15:49 ` [PATCH v6 5/6] selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC jeffxu
2022-12-08 16:30 ` Kees Cook
2022-12-07 15:49 ` [PATCH v6 6/6] mm/memfd: security hook for memfd_create jeffxu
2022-12-08 16:32 ` Kees Cook
2022-12-08 16:46 ` Kees Cook
2022-12-08 16:13 ` [PATCH v6 0/6] mm/memfd: introduce MFD_NOEXEC_SEAL and MFD_EXEC Kees Cook
2022-12-08 18:33 ` Jeff Xu
2022-12-08 20:55 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221216094259.bec91e4abd6cf54a05ce2813@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dverkamp@chromium.org \
--cc=hughd@google.com \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=jeffxu@google.com \
--cc=jorgelo@chromium.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=peterx@redhat.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).