From: Oleg Nesterov <oleg@redhat.com>
To: Hui Peng <benquike@gmail.com>
Cc: akpm@linux-foundation.org, brauner@kernel.org, tglx@kernel.org,
elver@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signal: re-arm ignored periodic POSIX timers when handler is installed in do_sigaction()
Date: Sun, 20 Sep 2026 15:01:10 +0200 [thread overview]
Message-ID: <aq_ZFsHg50ZlqgnO@redhat.com> (raw)
In-Reply-To: <20260919221731.3707506-1-benquike@gmail.com>
On 09/19, Hui Peng wrote:
>
> When a periodic POSIX timer fires while its target signal is ignored
> (e.g. default SIGCONT/SIGCHLD/SIGURG/SIGWINCH or SIG_IGN), the signal is
> dropped without advancing or queueing the timer's sigqueue, leaving the
> periodic timer stalled even after userspace installs a signal handler
> via sigaction(). Check and re-arm any pending ignored POSIX timers on
> the thread group when do_sigaction() transitions a signal out of the
> ignored state.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Well, It was supposed to have been fixed by caf77435dd8a ("signal: Handle
ignored signals in do_sigaction(action != SIG_IGN)") and other commits in
that series...
Do you have a test-case?
Oleg.
> Assisted-by: LLM
> Signed-off-by: Hui Peng <benquike@gmail.com>
> ---
> diff --git a/kernel/signal.c b/kernel/signal.c
> index ec30550951ec..49ba188296c4 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -4351,7 +4351,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
> sigaction_compat_abi(act, oact);
>
> if (act) {
> - bool was_ignored = k->sa.sa_handler == SIG_IGN;
> + bool was_ignored = sig_task_ignored(p, sig, false);
>
> sigdelsetmask(&act->sa.sa_mask,
> sigmask(SIGKILL) | sigmask(SIGSTOP));
> @@ -4367,7 +4367,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
> * (for example, SIGCHLD), shall cause the pending signal to
> * be discarded, whether or not it is blocked"
> */
> - if (sig_handler_ignored(sig_handler(p, sig), sig)) {
> + if (sig_task_ignored(p, sig, false)) {
> sigemptyset(&mask);
> sigaddset(&mask, sig);
> flush_sigqueue_mask(p, &mask, &p->signal->shared_pending);
>
prev parent reply other threads:[~2026-09-20 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 22:17 Hui Peng
2026-09-20 13:01 ` Oleg Nesterov [this message]
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=aq_ZFsHg50ZlqgnO@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=benquike@gmail.com \
--cc=brauner@kernel.org \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®