linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Xu <jeffxu@chromium.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, keescook@chromium.org,
	jannh@google.com,  sroettger@google.com,
	gregkh@linuxfoundation.org,  torvalds@linux-foundation.org,
	usama.anjum@collabora.com, jeffxu@google.com,
	 jorgelo@chromium.org, groeck@chromium.org,
	linux-kernel@vger.kernel.org,  linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org, pedro.falcato@gmail.com,
	 dave.hansen@intel.com, linux-hardening@vger.kernel.org,
	deraadt@openbsd.org
Subject: Re: [RFC PATCH v5 2/4] mseal: add mseal syscall
Date: Wed, 10 Jan 2024 18:58:48 -0800	[thread overview]
Message-ID: <CABi2SkVFVYWiYNCzsfFbkOW4kurysYp2X79prqoHFb488QKbYQ@mail.gmail.com> (raw)
In-Reply-To: <ZZ2uXyPCE+l2Uccr@casper.infradead.org>

On Tue, Jan 9, 2024 at 12:36 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Jan 09, 2024 at 03:45:40PM +0000, jeffxu@chromium.org wrote:
> > +extern bool can_modify_mm(struct mm_struct *mm, unsigned long start,
> > +             unsigned long end);
> > +extern bool can_modify_mm_madv(struct mm_struct *mm, unsigned long start,
> > +             unsigned long end, int behavior);
>
> unnecessary use of extern.
>
> > +static inline unsigned long get_mmap_seals(unsigned long prot,
> > +     unsigned long flags)
>
> needs more than one tab indent so it doesn't look like part of the body.
>
> > +{
> > +     unsigned long vm_seals;
> > +
> > +     if (prot & PROT_SEAL)
> > +             vm_seals = VM_SEALED | VM_SEALABLE;
> > +     else
> > +             vm_seals = (flags & MAP_SEALABLE) ? VM_SEALABLE:0;
>
> need spaces around the :
>
> > +++ b/include/uapi/asm-generic/mman-common.h
> > @@ -17,6 +17,11 @@
> >  #define PROT_GROWSDOWN       0x01000000      /* mprotect flag: extend change to start of growsdown vma */
> >  #define PROT_GROWSUP 0x02000000      /* mprotect flag: extend change to end of growsup vma */
> >
> > +/*
> > + * The PROT_SEAL defines memory sealing in the prot argument of mmap().
> > + */
> > +#define PROT_SEAL    _BITUL(26)      /* 0x04000000 */
>
> why not follow the existing style?
>
> > +static inline void set_vma_sealed(struct vm_area_struct *vma)
> > +{
> > +     vma->__vm_flags |= VM_SEALED;
> > +}
>
> uhh ... vm_flags_set() ?
>
Thanks. I agree with all the comments above and will update in the next version.

-Jeff


  reply	other threads:[~2024-01-11  2:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 15:45 [RFC PATCH v5 0/4] Introduce mseal() jeffxu
2024-01-09 15:45 ` [RFC PATCH v5 1/4] mseal: Wire up mseal syscall jeffxu
2024-01-09 18:32   ` Geert Uytterhoeven
2024-01-10  5:10     ` Jeff Xu
2024-01-09 15:45 ` [RFC PATCH v5 2/4] mseal: add " jeffxu
2024-01-09 20:36   ` Matthew Wilcox
2024-01-11  2:58     ` Jeff Xu [this message]
2024-01-09 15:45 ` [RFC PATCH v5 3/4] selftest mm/mseal memory sealing jeffxu
2024-01-09 15:45 ` [RFC PATCH v5 4/4] mseal:add documentation jeffxu
2024-01-11  3:16   ` Randy Dunlap
2024-01-11  5:19     ` Jeff Xu
2024-01-09 19:47 ` [RFC PATCH v5 0/4] Introduce mseal() Kees Cook
2024-01-10  5:10   ` Jeff Xu

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=CABi2SkVFVYWiYNCzsfFbkOW4kurysYp2X79prqoHFb488QKbYQ@mail.gmail.com \
    --to=jeffxu@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=deraadt@openbsd.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=jannh@google.com \
    --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=pedro.falcato@gmail.com \
    --cc=sroettger@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=usama.anjum@collabora.com \
    --cc=willy@infradead.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