From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5933 invoked from network); 2 Jun 2021 16:20:24 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 2 Jun 2021 16:20:24 -0000 Received: (qmail 3682 invoked by uid 550); 2 Jun 2021 16:20:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3661 invoked from network); 2 Jun 2021 16:20:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622650808; bh=WNkgZxOJa9l3p2aXp0yxHSuXGDU+7cFzSTnm2a3wX8I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eWOfWd8ysRCMxWsUd2ty96iFmBVXawa3jTb263qGzflA7xZJeeP7pI2yCNGexwOtg JyFGy9t5p4VD0HCsYRvQIjds04rSJxkWcO4ZPR/qBiuiPqtwf0AJhDUXSzCLV+J1F0 ALJ7GOoM+KRVkfjjoM+eN7S9LbKOjD02wxwzUUBjljhJnT79WbHXs45HpxaGNM1cPi ecEh/OAECnUZl0vJHmkoAJAr6Hhrdw9/I/QuLtWVP8guwCFuMw59DjutSX4JAZy9Do E2u0aK/XGRQFyKGORowVcjmokqfhjJWjDlxh+2BPDzXBklWhu2reG6Mfhx69lkh2Ok YAnP6X6McSDrg== X-Gm-Message-State: AOAM533VXIivNJVPzQwS3bsWXvh6UnqPKDjecJtyQzY2XX0pADG+HX4c /ABbcD7VzYWZTf8VGnXgtfyxJdWF/QFfLF5FIbo= X-Google-Smtp-Source: ABdhPJwK53iWPCCbGHoUqkxMhUckGpqew57ThErtttXy8630H/6jeCuaaZXCeWYiAwxjFWlukeH8KL52UsUSq0u+ijY= X-Received: by 2002:aca:c303:: with SMTP id t3mr4309077oif.11.1622650808187; Wed, 02 Jun 2021 09:20:08 -0700 (PDT) MIME-Version: 1.0 References: <20210510185837.GD2031@voyager> <20210524220004.GD2546@brightrain.aerifal.cx> <20210602145632.GC13220@brightrain.aerifal.cx> In-Reply-To: From: Arnd Bergmann Date: Wed, 2 Jun 2021 18:18:28 +0200 X-Gmail-Original-Message-ID: Message-ID: To: musl@lists.openwall.com Cc: Markus Wichmann , Florian Weimer Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Backwards kernel compatibility On Wed, Jun 2, 2021 at 6:01 PM Arnd Bergmann wrote: > > On Wed, Jun 2, 2021 at 4:56 PM Rich Felker 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