mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: musl@lists.openwall.com
Cc: Markus Wichmann <nullplan@gmx.net>, Florian Weimer <fweimer@redhat.com>
Subject: Re: [musl] Backwards kernel compatibility
Date: Wed, 2 Jun 2021 18:18:28 +0200	[thread overview]
Message-ID: <CAK8P3a2e1DBdzrqanxdiV+SeDipJfShNA9PHzVrntwGVXN9YvQ@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a1ADtyVkY8zWd=6KhJLR4eWpyfvDuZMzc_EKp4szC_y7Q@mail.gmail.com>

On Wed, Jun 2, 2021 at 6:01 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:56 PM Rich Felker <dalias@libc.org> wrote:
> > On Wed, Jun 02, 2021 at 01:52:43PM +0200, Arnd Bergmann wrote:
> > > >
> > > > The main source of overhead comes from the kernel 4.4 which on arm64
> > > > produces stack traces when not implemented syscall is invoked:
> > > >
> > > >     https://github.com/torvalds/linux/blob/afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc/arch/arm64/kernel/traps.c#L369
> > >
> > > That is clearly a bug that was fixed in mainline and backported to linux-4.14
> > > but not 4.4 or 4.9. I've sent a manual backport for inclusion in those kernels
> > > now.
> >
> > Is this practical to hotpatch into kernels on devices that aren't
> > readily upgradable?
>
> Including the patch in a source tree is trivial, as it just removes a few lines
> of (misguided) output. If you are asking about run-time patching it out of
> a running kernel using kpatch/kGraft/ksplice, this would also be doable
> by patching out the branch in that function, but the infrastructure for live
> patching kernels is likely missing on most of the systems that lack a way to
> replace the kernel image, so in practice it would not help.

I found one more thing: The warning is controlled by
/proc/sys/debug/exception-trace, writing a zero into that file
disables it, along with the output for unhandled signals that kill
a process.

Starting with linux-4.4.19/linux-4.9.84/linux-4.14.23/linux-4.16, the
output is already disabled by default, in earlier arm64 kernels it
is enabled. The patch to disable this was merged upstream at the
same time as the one that removes the unhandled-syscall
warning, but the older kernels (4.4 and 4.9) were missing the
backport of that second patch.

On other architectures, this sysctl never controlled printing
the unhandled syscalls, only unhandled signals, but it remains
enabled by default.

       Arnd

  reply	other threads:[~2021-06-02 16:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  5:50 Martin Vajnar
2021-05-10  6:46 ` Florian Weimer
2021-05-10 18:58 ` Markus Wichmann
2021-05-24 13:52   ` Martin Vajnar
2021-05-24 22:00     ` Rich Felker
2021-06-02  7:38       ` Martin Vajnar
2021-06-02 11:52         ` Arnd Bergmann
2021-06-02 14:56           ` Rich Felker
2021-06-02 16:01             ` Arnd Bergmann
2021-06-02 16:18               ` Arnd Bergmann [this message]
2021-06-09  7:03           ` Arnd Bergmann
2021-06-08 22:16       ` Martin Vajnar
2021-06-09  0:37         ` Rich Felker

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=CAK8P3a2e1DBdzrqanxdiV+SeDipJfShNA9PHzVrntwGVXN9YvQ@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=fweimer@redhat.com \
    --cc=musl@lists.openwall.com \
    --cc=nullplan@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).