From: Greg KH <greg@kroah.com>
To: Salvatore Bonaccorso <carnil@debian.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>, Kees Cook <kees@kernel.org>,
stable@vger.kernel.org,
Dominique Martinet <asmadeus@codewreck.org>
Subject: Re: please revert backport of 44c76825d6eefee9eb7ce06c38e1a6632ac7eb7d
Date: Thu, 5 Dec 2024 08:07:15 +0100 [thread overview]
Message-ID: <2024120519-chamber-despise-c179@gregkh> (raw)
In-Reply-To: <Z1FOMMxv8bVt8RC3@eldamar.lan>
On Thu, Dec 05, 2024 at 07:54:40AM +0100, Salvatore Bonaccorso wrote:
> Hi all,
>
> On Mon, Nov 25, 2024 at 10:26:12AM +0300, Michael Tokarev wrote:
> > 21.11.2024 17:33, Kees Cook wrote:
> > > Hi stable tree maintainers,
> > >
> > > Please revert the backports of
> > >
> > > 44c76825d6ee ("x86: Increase brk randomness entropy for 64-bit systems")
> > >
> > > namely:
> > >
> > > 5.4: 03475167fda50b8511ef620a27409b08365882e1
> > > 5.10: 25d31baf922c1ee987efd6fcc9c7d4ab539c66b4
> > > 5.15: 06cb3463aa58906cfff72877eb7f50cb26e9ca93
> > > 6.1: b0cde867b80a5e81fcbc0383e138f5845f2005ee
> > > 6.6: 1a45994fb218d93dec48a3a86f68283db61e0936
> > >
> > > There seems to be a bad interaction between this change and older
> > > PIE-built qemu-user-static (for aarch64) binaries[1]. Investigation
> > > continues to see if this will need to be reverted from 6.6, 6.11,
> > > and mainline. But for now, it's clearly a problem for older kernels with
> > > older qemu.
> > >
> > > Thanks!
> > >
> > > -Kees
> > >
> > > [1] https://lore.kernel.org/all/202411201000.F3313C02@keescook/
> > Unfortunately I haven't seen this thread and this email before now,
> > when things are already too late.
> >
> > And it turned out it's entirely my fault with all this. Let me
> > explain so things become clear to everyone.
> >
> > The problem here is entirely in qemu-user. The fundamental issue
> > is that qemu-user does not implement an MMU, instead, it implements
> > just address shift, searching for a memory region for the guest address
> > space which is hopefully not used by qemu-user itself.
> >
> > In practice, this is rarely an issue though, when - and this is the
> > default - qemu is built as a static-pie executable. This is important:
> > it's the default mode for the static build - it builds as static-pie
> > executable, which works around the problem in almost all cases.
> > This is done for quite a long time, too.
> >
> > However, I, as qemu maintainer in debian, got a bug report saying
> > that qemu-user-static isn't "static enough" - because for some tools
> > used on debian (lintian), static-pie was something unknown and the
> > tool issued a warning. And at the time, I just added --disable-pie
> > flag to the build, without much thinking. This is where things went
> > wrong.
> >
> > Later I reverted this change with a shame, because it causes numerous
> > configurations to fail randomly, and each of them is very difficult to
> > debug (especially due to randomness of failures, sometimes it can work
> > 50 times in a row but fail on the 51th).
> >
> > But unfortunately, I forgot to revert this "de-PIEsation" change in
> > debian stable, and that's exactly where the original bug report come
> > from, stating kernel broke builds in qemu.
> >
> > The same qemu-user-static configuration has been used by some other
> > distributions too, but hopefully everything's fixed now. Except of
> > debian bookworm, and probably also ubuntu jammy (previous LTS).
> >
> > It is not an "older qemu" anymore (though for a very old qemu this is
> > true again, that old one can't be used anymore with modern executables
> > anyway due to other reasons). It is just my build mistake which is
> > *still* unfixed on debian stable (bookworm). And even there, this
> > issue can trivially be fixed locally, since qemu-user-static is
> > self-contained and can be installed on older debian releases, and I
> > always provide up-to-date backports of qemu packages for debian stable.
> >
> > And yes, qemu had numerous improvements in this area since bookworm
> > version, which addressed many other issues around this and fixed many
> > other configurations (which are not related to this kernel change),
> > but the fundamental issue (lack of full-blown MMU) remains.
> >
> > Hopefully this clears things up, and it can be seen that this is not
> > a kernel bug. And I'm hoping we'll fix this in debian bookworm soon
> > too.
> >
> > Thanks, and sorry for all the buzz which caused my 2 mistakes.
>
> So catching up with that as we currently did cherry-pick the revert in
> Debian but I defintivelfy would like to align with upstream (and drop
> the cherry-pick again if it's not going to be picked for 6.1.y
> upstream):
>
> I'm a bit lost here. What are we going to do? Is the commit still
> temporarly be applied to the stable series or are we staying at the
> status quo and we should solely deal it within Debian on qemu side to
> address the issue above and then we are fine?
I read this as "oops, we messed up in qemu and will fix it there" and so
I dropped the reverts from the kernel. If that's not the case, please
let me know.
thanks,
greg k-h
next prev parent reply other threads:[~2024-12-05 7:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 14:33 please revert backport of 44c76825d6eefee9eb7ce06c38e1a6632ac7eb7d Kees Cook
2024-11-25 7:26 ` Michael Tokarev
2024-12-05 6:54 ` Salvatore Bonaccorso
2024-12-05 7:07 ` Greg KH [this message]
2024-12-05 7:22 ` Salvatore Bonaccorso
2024-12-05 7:35 ` Michael Tokarev
2024-12-06 12:04 ` Dominique Martinet
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=2024120519-chamber-despise-c179@gregkh \
--to=greg@kroah.com \
--cc=asmadeus@codewreck.org \
--cc=carnil@debian.org \
--cc=kees@kernel.org \
--cc=mjt@tls.msk.ru \
--cc=stable@vger.kernel.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