From: Oleg Nesterov <oleg@redhat.com>
To: chenqiwu <qiwuchen55@gmail.com>
Cc: corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org,
paulmck@kernel.org, akpm@linux-foundation.org,
linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH v4 2/2] arm64: show signal info for global init
Date: Wed, 25 Sep 2024 14:05:47 +0200 [thread overview]
Message-ID: <20240925120546.GA26882@redhat.com> (raw)
In-Reply-To: <20240925035440.GA2941@rlk>
On 09/25, chenqiwu wrote:
>
> On Tue, Sep 24, 2024 at 08:36:35PM +0200, Oleg Nesterov wrote:
> >
> > So what does this patch try to do? Note that unhandled_signal(tsk) returns true
> > if is_global_init(tsk).
> >
> > So it seems that this patch just tries to bypass the show_unhandled_signals and
> > __ratelimit() checks? Or what?
> >
> Yes, this patch just try to bypass the show_unhandled_signals and
> __ratelimit() checks for the global init.
I think the changelog should explain this.
But this doesn't look right to me, see below.
> > OTOH. The is_global_init() check in unhandled_signal() (which predates the git
> > history) doesn't look right to me. If init has a handler for, say, SIGSEGV, why
> > should the kernel complain? I need to recheck this logic...
> >
> I think the orignal logic is the signal sent to the global init is
> regarded as unhandled becuase it has SIGNAL_UNKILLABLE feature.
And? How does this relate to SIGNAL_UNKILLABLE? Again, this check predates
the git history and the SIGNAL_UNKILLABLE feature. And SIGNAL_UNKILLABLE
has no effect in this case, see force_sig_info_to_task().
I am running this program
void sigh(int sig)
{
printf("SIGSEGV %d\n", getpid());
execl("/usr/bin/sh", "sh", NULL);
printf("exec failed\n");
}
int main(void)
{
signal(SIGSEGV, sigh);
*((char*)(1234)) = 0;
return 1;
}
as a global init under KVM. It works but dmesg reports
init[1]: segfault at 4d2 ip 00000000004006b5 sp 00007ffcf2975170 error 6 in init[6b5,400000+1000] likely on CPU 0 (core 0, socket 0)
Code: e8 c0 fe ff ff bf 6b 07 40 00 e8 56 fe ff ff 90 c9 c3 55 48 89 e5 be 56 06 40 00 bf 0b 00 00 00 e8 80 fe ff ff b8 d2 04 00 00 <c6> 00 00 b8 01 00 00 00 5d c3 90 41 57 41 56 41 89 ff 41 55 41 54
I'll send the patch which removes the is_global_init check from unhandled_signal()
which actually has more problems, afaics. But this all is offtopic.
Oleg.
next prev parent reply other threads:[~2024-09-25 12:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 7:43 [PATCH v4 1/2] panic: add option to dump task maps info in panic_print qiwu.chen
2024-09-24 7:43 ` [PATCH v4 2/2] arm64: show signal info for global init qiwu.chen
2024-09-24 18:36 ` Oleg Nesterov
2024-09-25 3:54 ` chenqiwu
2024-09-25 12:05 ` Oleg Nesterov [this message]
2024-09-26 10:12 ` chenqiwu
2024-09-24 11:33 ` [PATCH v4 1/2] panic: add option to dump task maps info in panic_print Oleg Nesterov
2024-09-25 8:27 ` chenqiwu
2024-09-25 12:19 ` Oleg Nesterov
2024-09-26 3:30 ` chenqiwu
2024-09-24 15:06 ` kernel test robot
2024-09-24 15:06 ` kernel test robot
2024-10-01 11:23 ` Lorenzo Stoakes
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=20240925120546.GA26882@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=paulmck@kernel.org \
--cc=qiwuchen55@gmail.com \
--cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.