All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: matoro <matoro_mailinglist_kernel@matoro.tk>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	Anthony Yznaga <anthony.yznaga@oracle.com>,
	matoro_bugzilla_kernel@matoro.tk,
	Andrew Morton <akpm@linux-foundation.org>,
	regressions@lists.linux.dev, linux-ia64@vger.kernel.org,
	Linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: regression: Bug 215601 - gcc segv at startup on ia64
Date: Sat, 26 Feb 2022 03:52:27 -0800	[thread overview]
Message-ID: <202202260344.63C15C3356@keescook> (raw)
In-Reply-To: <65ed8ab4fad779fadf572fb737dfb789@matoro.tk>

On Thu, Feb 24, 2022 at 09:22:04AM -0500, matoro wrote:
> Hi Kees, I can provide live ssh access to my system exhibiting the issue.
> My system is a lot more stable due to using openrc rather than systemd, for
> me GCC seems to be the only binary affected.  Would that be helpful?

Thanks for this access! I think I see the problem. Non-PIE (i.e. normal
ET_EXEC) ia64 binaries appear to have two very non-contiguous virtual
memory PT_LOAD segments that are file-offset adjacent. As seen in
readelf -lW:

  LOAD           0x000000 0x4000000000000000 0x4000000000000000 0x00b5a0 0x00b5a0 R E 0x10000
  LOAD           0x00b5a0 0x600000000000b5a0 0x600000000000b5a0 0x0005ac 0x000710 RW  0x10000
                 ^^^^^^^^ ^^^^^^^^^^^^^^^^^^

When the kernel tries to map these with a combined allocation, it asks
for a giant mmap of the file, but the file is, of course, not at all
that large, and the mapping is rejected.

So... I'm trying to think about how best to deal with this. If I or
anyone else can't think of an elegant solution, I'll send a revert for
the offending patch next week.

In the meantime now I've got another dimension to regression test. ;)

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: matoro <matoro_mailinglist_kernel@matoro.tk>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	Anthony Yznaga <anthony.yznaga@oracle.com>,
	matoro_bugzilla_kernel@matoro.tk,
	Andrew Morton <akpm@linux-foundation.org>,
	regressions@lists.linux.dev, linux-ia64@vger.kernel.org,
	Linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: regression: Bug 215601 - gcc segv at startup on ia64
Date: Sat, 26 Feb 2022 11:52:27 +0000	[thread overview]
Message-ID: <202202260344.63C15C3356@keescook> (raw)
In-Reply-To: <65ed8ab4fad779fadf572fb737dfb789@matoro.tk>

On Thu, Feb 24, 2022 at 09:22:04AM -0500, matoro wrote:
> Hi Kees, I can provide live ssh access to my system exhibiting the issue.
> My system is a lot more stable due to using openrc rather than systemd, for
> me GCC seems to be the only binary affected.  Would that be helpful?

Thanks for this access! I think I see the problem. Non-PIE (i.e. normal
ET_EXEC) ia64 binaries appear to have two very non-contiguous virtual
memory PT_LOAD segments that are file-offset adjacent. As seen in
readelf -lW:

  LOAD           0x000000 0x4000000000000000 0x4000000000000000 0x00b5a0 0x00b5a0 R E 0x10000
  LOAD           0x00b5a0 0x600000000000b5a0 0x600000000000b5a0 0x0005ac 0x000710 RW  0x10000
                 ^^^^^^^^ ^^^^^^^^^^^^^^^^^^

When the kernel tries to map these with a combined allocation, it asks
for a giant mmap of the file, but the file is, of course, not at all
that large, and the mapping is rejected.

So... I'm trying to think about how best to deal with this. If I or
anyone else can't think of an elegant solution, I'll send a revert for
the offending patch next week.

In the meantime now I've got another dimension to regression test. ;)

-- 
Kees Cook

  parent reply	other threads:[~2022-02-26 11:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20 17:12 regression: Bug 215601 - gcc segv at startup on ia64 Thorsten Leemhuis
2022-02-20 17:12 ` Thorsten Leemhuis
2022-02-20 17:19 ` Thorsten Leemhuis
2022-02-20 17:19   ` Thorsten Leemhuis
2022-02-21  7:42   ` Kees Cook
2022-02-21  7:42     ` Kees Cook
2022-02-21 19:49     ` John Paul Adrian Glaubitz
2022-02-21 19:49       ` John Paul Adrian Glaubitz
2022-02-21 20:58       ` Kees Cook
2022-02-21 20:58         ` Kees Cook
2022-02-21 21:57         ` John Paul Adrian Glaubitz
2022-02-21 21:57           ` John Paul Adrian Glaubitz
2022-02-24  3:58           ` Kees Cook
2022-02-24  3:58             ` Kees Cook
2022-02-24  5:16           ` Kees Cook
2022-02-24  5:16             ` Kees Cook
2022-02-24  9:33             ` John Paul Adrian Glaubitz
2022-02-24  9:33               ` John Paul Adrian Glaubitz
2022-02-24 14:22               ` matoro
2022-02-24 14:22                 ` matoro
2022-02-24 16:33                 ` Kees Cook
2022-02-24 16:33                   ` Kees Cook
2022-02-26 11:52                 ` Kees Cook [this message]
2022-02-26 11:52                   ` Kees Cook
2022-02-28 10:46                   ` Magnus Groß
2022-02-28 10:46                     ` Magnus Groß
2022-02-28 20:41                     ` Kees Cook
2022-02-28 20:41                       ` Kees Cook
2022-03-02 12:01 ` John Paul Adrian Glaubitz
2022-03-02 12:01   ` John Paul Adrian Glaubitz
2022-03-02 12:35   ` Thorsten Leemhuis
2022-03-02 12:35     ` Thorsten Leemhuis

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=202202260344.63C15C3356@keescook \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=anthony.yznaga@oracle.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matoro_bugzilla_kernel@matoro.tk \
    --cc=matoro_mailinglist_kernel@matoro.tk \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.