From: Jeff Xu <jeffxu@chromium.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: akpm@linux-foundation.org, keescook@chromium.org,
jannh@google.com, torvalds@linux-foundation.org,
adhemerval.zanella@linaro.org, oleg@redhat.com,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
linux-mm@kvack.org, sroettger@google.com, ojeda@kernel.org,
adobriyan@gmail.com, anna-maria@linutronix.de,
mark.rutland@arm.com, linus.walleij@linaro.org, Jason@zx2c4.com,
deller@gmx.de, rdunlap@infradead.org, davem@davemloft.net,
hch@lst.de, peterx@redhat.com, hca@linux.ibm.com,
f.fainelli@gmail.com, gerg@kernel.org,
dave.hansen@linux.intel.com, mingo@kernel.org, ardb@kernel.org,
Liam.Howlett@oracle.com, mhocko@suse.com, 42.hyeyoo@gmail.com,
peterz@infradead.org, ardb@google.com, enh@google.com,
rientjes@google.com, Michael Ellerman <mpe@ellerman.id.au>,
Jorge Lucangeli Obes <jorgelo@chromium.org>
Subject: Re: [PATCH v3 0/1] seal system mappings
Date: Tue, 19 Nov 2024 15:48:09 -0800 [thread overview]
Message-ID: <CABi2SkUR6G4Tb3VL22bW90Yt=24ws+RBSMjQBU1T38RHFDGv+Q@mail.gmail.com> (raw)
In-Reply-To: <14600b0e-6d6f-4ee3-9230-3d1f7b807710@lucifer.local>
Hi Lorenzo
On Wed, Nov 13, 2024 at 12:36 PM Lorenzo Stoakes
<lorenzo.stoakes@oracle.com> wrote:
>
> You left kernel test bots and review unanswered on v2, which makes it
> difficult to know whether you actually addressed everything.
>
Thanks for reminding me, I got distracted previously.
I responded to the test bots.
> Please respond to all outstanding comments in the v2 thread so we know,
> thanks, even if it is to say 'this is no longer an issue as v3 addresses'.
>
All comments of v2 were addressed in V3.
> On Wed, Nov 13, 2024 at 07:16:01PM +0000, jeffxu@chromium.org wrote:
> > From: Jeff Xu <jeffxu@chromium.org>
> >
> > Seal vdso, vvar, sigpage, uprobes and vsyscall.
> >
> > Those mappings are readonly or executable only, sealing can protect
> > them from ever changing or unmapped during the life time of the process.
> > For complete descriptions of memory sealing, please see mseal.rst [1].
> >
> > System mappings such as vdso, vvar, and sigpage (for arm) are
> > generated by the kernel during program initialization, and are
> > sealed after creation.
> >
> > Unlike the aforementioned mappings, the uprobe mapping is not
> > established during program startup. However, its lifetime is the same
> > as the process's lifetime [1]. It is sealed from creation.
> >
> > The vdso, vvar, sigpage, and uprobe mappings all invoke the
> > _install_special_mapping() function. As no other mappings utilize this
> > function, it is logical to incorporate sealing logic within
> > _install_special_mapping(). This approach avoids the necessity of
> > modifying code across various architecture-specific implementations.
>
> Some arches unmap VDSO's which mseal prevents, so are those broken now? Did
> you test this?
>
Do you happen to know which arch might unmap vdso ?
The information I collected so far is only CHECKPOINT_RESTORE would
remap/unmap vdso. And if CHECKPOINT_RESTORE is enabled, Kconfig will
prevent this from being enabled.
> >
> > The vsyscall mapping, which has its own initialization function, is
> > sealed in the XONLY case, it seems to be the most common and secure
> > case of using vsyscall.
> >
> > 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. To address this, a kernel configuration option has
> > been introduced to enable or disable this functionality.
> >
> > [1] Documentation/userspace-api/mseal.rst
> > [2] https://lore.kernel.org/all/CABi2SkU9BRUnqf70-nksuMCQ+yyiWjo3fM4XkRkL-NrCZxYAyg@mail.gmail.com/
>
> I don't see any mention to testing, and this affects multiple different
> architectures.
>
> Please describe what testing you performed and on what architectures.
>
The tests are done in ChromeOS and Android on ARM and INTEL.
> I suggest we allow this only for architectures you have explicitly tested,
> especially as this is 'hidden' from arch maintainers who might find this
> change surprising.
>
I thought the current approach aligns with Linus's suggestion of
unifying vdso/vvar code [1]. I honestly think this is not architecture
dependent, i.e. this doesn't require any specific CPU feature.
I could add ARCH_HAS_SEAL_SYSTEM_MAPPINGS in KCONFIG and enable this
for x86_64 and arm64 for now, this would allow other architecture
maintainers to have opportunities to test this .
[1] https://lore.kernel.org/all/CAHk-=wgTXVMBRuya5J0peujSrtunehRtzk=WVrm6njPhHrpTJw@mail.gmail.com/
Thanks for reviewing.
-Jeff
prev parent reply other threads:[~2024-11-19 23:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 19:16 jeffxu
2024-11-13 19:16 ` [PATCH v3 1/1] exec: " jeffxu
2024-11-13 20:47 ` Lorenzo Stoakes
2024-11-19 23:49 ` Jeff Xu
2024-11-14 0:54 ` Liam R. Howlett
2024-11-19 20:57 ` Jeff Xu
2024-11-13 20:36 ` [PATCH v3 0/1] " Lorenzo Stoakes
2024-11-19 23:48 ` Jeff Xu [this message]
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='CABi2SkUR6G4Tb3VL22bW90Yt=24ws+RBSMjQBU1T38RHFDGv+Q@mail.gmail.com' \
--to=jeffxu@chromium.org \
--cc=42.hyeyoo@gmail.com \
--cc=Jason@zx2c4.com \
--cc=Liam.Howlett@oracle.com \
--cc=adhemerval.zanella@linaro.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=anna-maria@linutronix.de \
--cc=ardb@google.com \
--cc=ardb@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=enh@google.com \
--cc=f.fainelli@gmail.com \
--cc=gerg@kernel.org \
--cc=hca@linux.ibm.com \
--cc=hch@lst.de \
--cc=jannh@google.com \
--cc=jorgelo@chromium.org \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mark.rutland@arm.com \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=ojeda@kernel.org \
--cc=oleg@redhat.com \
--cc=peterx@redhat.com \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=rientjes@google.com \
--cc=sroettger@google.com \
--cc=torvalds@linux-foundation.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