From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB410C77B7A for ; Tue, 6 Jun 2023 14:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238347AbjFFOkq (ORCPT ); Tue, 6 Jun 2023 10:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238254AbjFFOj0 (ORCPT ); Tue, 6 Jun 2023 10:39:26 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D35C91FD8 for ; Tue, 6 Jun 2023 07:38:27 -0700 (PDT) Message-ID: <20230606142033.225765113@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686062301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=FIVxxbxY5nm7gn9Zivm/IXjYdCBMNgvVCHW/aP5AbxI=; b=G6i/iDvAKRjpnjskrO4KtqHQuYJKJRrXwL2YweYtiuegs0NCLAy6Pb25JWXlFoQwMKyfpR 1nRwTmeynWyQ4FMaNIv5tDh+79wZYFWD31QE57op231XuvU37+E/JZs8aMd/eV4nTWMtrC cSoO1FqNmROB5HyQI6MP98mhXwmjO8W4CM+1W6BrKA3UYPJMrtLf98GHN9i/CxU9IxWhq7 NpTmwR769D1GgHACm2qoDWQrWjBQsOmN7RyHGBe1iTcHqS6nDcVrMAE/mTD+KJ0aspBt5Y 2XRZAzo/z2Wx6OIMcm/j+qk/PEFXZLct23pJPTZac0jmRFxVqXZrd2IHQX5hqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686062301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=FIVxxbxY5nm7gn9Zivm/IXjYdCBMNgvVCHW/aP5AbxI=; b=Vge8TkXGkw3jGg0X9UkQfMUAPmd57LOptsE0K6Wi3GYHsXdCwD/sfyqwSZmzU1CooGTGkg R6GpuyzvnFWsO8CA== From: Thomas Gleixner To: LKML Cc: Frederic Weisbecker , Anna-Maria Behnsen , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch 39/45] signal: Provide ignored_posix_timers list References: <20230606132949.068951363@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 6 Jun 2023 16:38:20 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To prepare for handling posix timer signals on sigaction(SIG_IGN) properly, add a list to task::signal. This list will be used to queue posix timers so their signal can be requeued when SIG_IGN is lifted later. Signed-off-by: Thomas Gleixner --- include/linux/sched/signal.h | 1 + init/init_task.c | 5 +++-- kernel/fork.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -137,6 +137,7 @@ struct signal_struct { /* POSIX.1b Interval Timers */ unsigned int next_posix_timer_id; struct hlist_head posix_timers; + struct hlist_head ignored_posix_timers; /* ITIMER_REAL timer for the process */ struct hrtimer real_timer; --- a/init/init_task.c +++ b/init/init_task.c @@ -28,8 +28,9 @@ static struct signal_struct init_signals .cred_guard_mutex = __MUTEX_INITIALIZER(init_signals.cred_guard_mutex), .exec_update_lock = __RWSEM_INITIALIZER(init_signals.exec_update_lock), #ifdef CONFIG_POSIX_TIMERS - .posix_timers = HLIST_HEAD_INIT, - .cputimer = { + .posix_timers = HLIST_HEAD_INIT, + .ignored_posix_timers = HLIST_HEAD_INIT, + .cputimer = { .cputime_atomic = INIT_CPUTIME_ATOMIC, }, #endif --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1881,6 +1881,7 @@ static int copy_signal(unsigned long clo #ifdef CONFIG_POSIX_TIMERS INIT_HLIST_HEAD(&sig->posix_timers); + INIT_HLIST_HEAD(&sig->ignored_posix_timers); hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); sig->real_timer.function = it_real_fn; #endif