linux-um archives
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Hajime Tazaki <thehajime@gmail.com>
Cc: linux-um@lists.infradead.org
Subject: Re: [PATCH] um: mprotect() __init memory
Date: Sat, 26 Sep 2026 11:16:56 +0200	[thread overview]
Message-ID: <4a99ab637eb8fbe6d72d788ddc0d2e141e7c9821.camel@sipsolutions.net> (raw)
In-Reply-To: <m24ifc4v6m.wl-thehajime@gmail.com> (sfid-20260926_041255_844241_7AADBB53)

On Sat, 2026-09-26 at 11:12 +0900, Hajime Tazaki wrote:
> Hello,
> 
> I recently pulled uml/next branch and faced an issue on the exit.
> 
> ```
> Thread 1 "vmlinux" received signal SIGSEGV, Segmentation fault.
> 0x0000000060003cf3 in start_uml () at ../arch/um/kernel/skas/process.c:41
> 41      }
> (gdb) bt
> #0  0x0000000060003cf3 in start_uml () at ../arch/um/kernel/skas/process.c:41
> #1  0x0000000060003a69 in linux_main (argc=argc@entry=9, argv=argv@entry=0x7fffffffe118,
>     envp=envp@entry=0x7fffffffe168) at ../arch/um/kernel/um_arch.c:404
> #2  0x00000000600049dc in main (argc=9, argv=0x7fffffffe118, envp=0x7fffffffe168)
>     at ../arch/um/os-Linux/main.c:153
> ```
> 
> and bisected that this commit is the first rev to introduce this.

I didn't get that, hmm.

> indeed, now .text section is in __init label but some of startup code
> (start_uml, linux_main) remain un-returned even after init is done.
> 
> a quick change below avoid this issue, but not sure if it is your
> intention of the original patch.

No, clearly not - we shouldn't execute __init code after init either :)

So I guess we found a but elsewhere, but I don't immediately see what
needs to be not marked __init, clearly linux_main() is still used on the
way out so that must be, but ...

Or we could mprotect(..., 0, 0, 1) internally on the way out again,
since really _while_ running we also shouldn't be in __init code, it's
just a side effect of how UML shuts down?

Got a config or so? I really don't see this.

johannes


  reply	other threads:[~2026-09-26  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 10:29 [PATCH] um: mprotect() __init memory Johannes Berg
2026-09-26  2:12 ` Hajime Tazaki
2026-09-26  9:16   ` Johannes Berg [this message]
2026-09-28  7:33     ` Johannes Berg

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=4a99ab637eb8fbe6d72d788ddc0d2e141e7c9821.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=thehajime@gmail.com \
    /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