[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABi2SkV7wXa-41d3w+oL=+1zCcT=qjynRTdWnkVr+BoDqQK+3Q@mail.gmail.com>
Date: Mon, 7 Oct 2024 08:00:00 -0700
From: Jeff Xu <jeffxu@...omium.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: akpm@...ux-foundation.org, keescook@...omium.org, jannh@...gle.com,
torvalds@...ux-foundation.org, adhemerval.zanella@...aro.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org,
linux-mm@...ck.org, jorgelo@...omium.org, sroettger@...gle.com,
ojeda@...nel.org, adobriyan@...il.com, anna-maria@...utronix.de,
mark.rutland@....com, linus.walleij@...aro.org, mike.kravetz@...cle.com,
Jason@...c4.com, deller@....de, rdunlap@...radead.org, davem@...emloft.net,
hch@....de, peterx@...hat.com, hca@...ux.ibm.com, f.fainelli@...il.com,
gerg@...nel.org, dave.hansen@...ux.intel.com, mingo@...nel.org,
ardb@...nel.org, nathan_lynch@...tor.com, dsafonov@...tuozzo.com,
Liam.Howlett@...cle.com, mhocko@...e.com, 42.hyeyoo@...il.com,
peterz@...radead.org, ardb@...gle.com, enh@...gle.com, rientjes@...gle.com,
groeck@...omium.org, lorenzo.stoakes@...cle.com
Subject: Re: [RFC PATCH v1 1/1] exec: seal system mappings
On Sat, Oct 5, 2024 at 1:08 PM Oleg Nesterov <oleg@...hat.com> wrote:
>
> On 10/04, jeffxu@...omium.org wrote:
> >
> > It is important to note that the CHECKPOINT_RESTORE feature (CRIU) may
> > alter the mapping of vdso, vvar, and sigpage during restore
> > operations. Consequently, this feature cannot be universally enabled
> > across all systems.
>
> Can't review.
>
> But as for uprobes, I'd prefer a simpler patch which doesn't need the new
> CONFIG_ and/or kernel boot options, something like the patch below.
>
Ok.
> And I don't really like the fact that this patch changes the behaviour
> of the "generic" _install_special_mapping() helper, but I won't argue.
>
This makes the minimum code change currently.
If in the future, there is a special mapping type that can't be
sealed, we can refactor _install_special_mapping() to support that.
> Oleg.
>
>
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -430,6 +430,8 @@ extern unsigned int kobjsize(const void *objp);
> #ifdef CONFIG_64BIT
> /* VM is sealed, in vm_flags */
> #define VM_SEALED _BITUL(63)
> +#else
> +#define VM_SEALED 0
> #endif
>
> /* Bits set in the VMA until the stack is in its final location */
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 40ecab0971ff..388373c11593 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1510,7 +1510,7 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area)
> }
>
> vma = _install_special_mapping(mm, area->vaddr, PAGE_SIZE,
> - VM_EXEC|VM_MAYEXEC|VM_DONTCOPY|VM_IO,
> + VM_EXEC|VM_MAYEXEC|VM_DONTCOPY|VM_IO|VM_SEALED,
> &xol_mapping);
OK.
> if (IS_ERR(vma)) {
> ret = PTR_ERR(vma);
>
Powered by blists - more mailing lists