public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pchelkin at ispras dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces
Date: Mon, 20 May 2024 19:53:51 +0000	[thread overview]
Message-ID: <bug-111736-4-9yYlgGukv7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111736-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736

Fedor Pchelkin <pchelkin at ispras dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pchelkin at ispras dot ru

--- Comment #42 from Fedor Pchelkin <pchelkin at ispras dot ru> ---
Hi,

I'm facing upstream Linux kernel boot failures with KASAN enabled after recent
x86/percpu updates. HEAD kernel commit is
daa121128a2d2ac6006159e2c47676e4fcd21eab.

The kernel is built with GCC 14.1.1 20240507. It's Arch Linux, package details
here [1].

The failing Linux kernel commit is f61f02d1ff78 ("x86/percpu: Re-enable named
address spaces with KASAN for GCC 13.3+") [2].

You see that the above kernel commit states that GCC 14 must be fixed with
patches from this pull-request:

    Note that the patch considers GCC 14 to be fixed - if somebody is
    using snapshots of the GCC 14 before the fix, they should upgrade.

I'm not familiar with GCC stable branches model but it seems to me that GCC
13.3 was fixed with patches from this pull-request while GCC 14.1 didn't get
the fixes at the time. Or it did? frankly speaking, I haven't been able to
figure it out for sure (and would be surprised if latest GCC 14 release didn't
get the fixes before the kernel received an x86/percpu update regarding this
issue).

If GCC 14.1 is fixed then there is probably another issue found. However, I
still think that if it was a real widespread problem, then somebody would have
already reported it. So maybe my kernel-config is just weird :)

I've attached a dmesg output and kernel config I use for testing.

The failing code lines are decoded as following:
__text_poke+0x493/0xd50:
use_temporary_mm at arch/x86/kernel/alternative.c:1789 (discriminator 2)
(inlined by) __text_poke at arch/x86/kernel/alternative.c:1904 (discriminator
2)

This concerns a percpu variable access:

static inline temp_mm_state_t use_temporary_mm(struct mm_struct *mm)
{
[...]
        /*
         * Make sure not to be in TLB lazy mode, as otherwise we'll end up
         * with a stale address space WITHOUT being in lazy mode after
         * restoring the previous mm.
         */
        if (this_cpu_read(cpu_tlbstate_shared.is_lazy))
                leave_mm();


[1]:
https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/blob/main/PKGBUILD?ref_type=heads
[2]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f61f02d1ff788ae5ad485ef8edd88d9c93557994

  parent reply	other threads:[~2024-05-20 19:53 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 11:53 [Bug sanitizer/111736] New: " ubizjak at gmail dot com
2023-10-09 12:31 ` [Bug sanitizer/111736] " rguenth at gcc dot gnu.org
2023-10-09 13:27 ` amonakov at gcc dot gnu.org
2023-10-09 16:27 ` amonakov at gcc dot gnu.org
2023-12-05 13:05 ` rguenth at gcc dot gnu.org
2023-12-05 14:11 ` cvs-commit at gcc dot gnu.org
2023-12-05 14:12 ` rguenth at gcc dot gnu.org
2023-12-19  9:29 ` ubizjak at gmail dot com
2023-12-19 10:06 ` rguenth at gcc dot gnu.org
2023-12-19 11:04 ` cvs-commit at gcc dot gnu.org
2023-12-29  9:42 ` ubizjak at gmail dot com
2024-03-20 20:04 ` ubizjak at gmail dot com
2024-03-20 21:45 ` ubizjak at gmail dot com
2024-03-21  6:44 ` ubizjak at gmail dot com
2024-03-21  7:24 ` rguenth at gcc dot gnu.org
2024-03-21  7:26 ` rguenth at gcc dot gnu.org
2024-03-21  7:45 ` rguenth at gcc dot gnu.org
2024-03-21  8:04 ` ubizjak at gmail dot com
2024-03-21  8:35 ` rguenther at suse dot de
2024-03-21  8:46 ` jakub at gcc dot gnu.org
2024-03-21  9:18 ` ubizjak at gmail dot com
2024-03-21  9:26 ` jakub at gcc dot gnu.org
2024-03-21  9:41 ` jakub at gcc dot gnu.org
2024-03-21  9:49 ` cvs-commit at gcc dot gnu.org
2024-03-21 11:49 ` cvs-commit at gcc dot gnu.org
2024-03-21 12:56 ` jakub at gcc dot gnu.org
2024-03-22  8:25 ` cvs-commit at gcc dot gnu.org
2024-03-25  9:13 ` ubizjak at gmail dot com
2024-03-25  9:31 ` jakub at gcc dot gnu.org
2024-03-25  9:45 ` jakub at gcc dot gnu.org
2024-03-25 10:20 ` ubizjak at gmail dot com
2024-03-26 10:13 ` cvs-commit at gcc dot gnu.org
2024-03-30  3:55 ` cvs-commit at gcc dot gnu.org
2024-03-30  3:55 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:40 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:41 ` ubizjak at gmail dot com
2024-05-20 19:53 ` pchelkin at ispras dot ru [this message]
2024-05-20 19:56 ` pchelkin at ispras dot ru
2024-05-20 19:57 ` pchelkin at ispras dot ru
2024-05-21  8:19 ` ubizjak at gmail dot com
2024-05-21  9:01 ` ubizjak at gmail dot com
2024-05-21  9:03 ` ubizjak at gmail dot com
2024-05-21  9:18 ` rguenth at gcc dot gnu.org
2024-05-21  9:20 ` ubizjak at gmail dot com
2024-05-21  9:55 ` ubizjak at gmail dot com

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=bug-111736-4-9yYlgGukv7@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).