[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201023090451.GB25736@gaia>
Date: Fri, 23 Oct 2020 10:04:51 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Szabolcs Nagy <szabolcs.nagy@....com>
Cc: Lennart Poettering <mzxreary@...inter.de>,
Topi Miettinen <toiwoton@...il.com>,
Florian Weimer <fweimer@...hat.com>,
Mark Rutland <mark.rutland@....com>,
systemd-devel@...ts.freedesktop.org,
Kees Cook <keescook@...omium.org>,
Will Deacon <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mark Brown <broonie@...nel.org>, libc-alpha@...rceware.org,
Dave Martin <dave.martin@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [systemd-devel] BTI interaction between seccomp filters in
systemd and glibc mprotect calls, causing service failures
On Fri, Oct 23, 2020 at 07:13:17AM +0100, Szabolcs Nagy wrote:
> The 10/22/2020 10:31, Catalin Marinas wrote:
> > IIUC, the problem is with the main executable which is mapped by the
> > kernel without PROT_BTI. The dynamic loader wants to set PROT_BTI but
> > does not have the original file descriptor to be able to remap. Its only
> > choice is mprotect() and this fails because of the MDWX policy.
> >
> > Not sure whether the kernel has the right information but could it map
> > the main executable with PROT_BTI if the corresponding PT_GNU_PROPERTY
> > is found? The current ABI states it only sets PROT_BTI for the
> > interpreter who'd be responsible for setting the PROT_BTI on the main
> > executable. I can't tell whether it would break anything but it's worth
> > a try:
>
> i think it would work, but now i can't easily
> tell from the libc if i have to do the mprotect
> on the main exe or not.
>
> i guess i can just always mprotect and ignore
> the failure?
I replied to Keys before reading your email. So yeah, still issue
mprotect() but ignore the failure.
--
Catalin
Powered by blists - more mailing lists