Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2e1DBdzrqanxdiV+SeDipJfShNA9PHzVrntwGVXN9YvQ@mail.gmail.com>
Date: Wed, 2 Jun 2021 18:18:28 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: musl@...ts.openwall.com
Cc: Markus Wichmann <nullplan@....net>, Florian Weimer <fweimer@...hat.com>
Subject: Re: Backwards kernel compatibility

On Wed, Jun 2, 2021 at 6:01 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:56 PM Rich Felker <dalias@...c.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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.