Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp488574lqp; Mon, 10 Jun 2024 09:53:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxno3cQYm6CGHB4z/AwrWSEArGIaZXes/+apxM7tFDM1hyhK2Nq8aQ7kCjwZ0+cEz4m3dAaVZBBh+JWqtEv5WUpDoYHQF2YkEzxvhNMg== X-Google-Smtp-Source: AGHT+IHZ+Y0RA1/iWes+UYXLN6pD8yh6SoWdK9Z8vW5C5kHPE6pfBLdhOM2z+oe0XFzVAllWyuO9 X-Received: by 2002:a05:6a20:a111:b0:1af:f50f:cbe5 with SMTP id adf61e73a8af0-1b86bd7876dmr331449637.8.1718038429649; Mon, 10 Jun 2024 09:53:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718038429; cv=pass; d=google.com; s=arc-20160816; b=qw8EoaEGM1WO1aZ8uQGZ8ymldTiO7yHvr/Q7leG42UPN9yZa17LEO1XZFbsVnTu8Oa O9qdO4dgR2b9t6inko8EOVWnVwO6zMsIK2i9gpN2CmUbFOeEuQT+mjNUThdL9nA/Ll34 9xtaW84HRq2/mRJQYPC0WkcRbeSUB9/oviz+4W3kvk7nGwsP5MJq6J3i6lGemRsohlRP 2SpSDSZ2bEbNyZ1MnAh0CjBNqpMuH2RvBPGUjz1mMqh6MluNawjaNDmq9l7xRMOjwv9D SpqMKagWP9UvM1xGXVxoyqKiYTBMYotRNzrXIsfDN7AMWlRiYZLhWRQUFkvBaegclZ0v vt5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=pv6YrQN2ETIiH5UgbcE48m3AAv3y/nIIur52dGrER6A=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=RGyGy/PwsWjfK4RMu3uGtAWTcGQ1SAUqLNVs0b5zNaVnd74MzIIh9Ncytt8IhkVm0p BxtkpF2M4PZzKEifPNGJVknzy8rvndQMPmprGdsiXWAT326oVbqaIis9OwM+nf3uMKaT s0qrasGB5nGnBA5kFBN3gsYhy54yfeMJAdvjEg9CjS144XnEScjrljcBfOq0bNWqy2qq 8x3doipkEPs/6bo5fvni8hWSQcKQ58Vy95wZF9i3muOs4WpdX1BOPl/GJ2xswrYMz2bZ FVun9L7Uw6IeMgz5jZi4knfVnd7wnM5a5Wgi5stHi/rkS99uHRDTru5sU+INPyPot/Ri 7qDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ckMsYXKC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e4e910dea6si5267146a12.299.2024.06.10.09.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ckMsYXKC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F3A1128653B for ; Mon, 10 Jun 2024 16:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93092158DA6; Mon, 10 Jun 2024 16:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ckMsYXKC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mTNAr643" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 283C414C5B8 for ; Mon, 10 Jun 2024 16:43:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037785; cv=none; b=HnHratq8/UZvhfzWD7Zdy47bggjViKDs49dG7Ve4Zn6jvu1J/5+EbDvSB65XPcTE6Suq0kdZsjPATpfyAwWw7/Z6USVNo+/NMZ20XvZm6IXCZ2P5CGck4Z8tR9CsOFnhmQzuckCbJgxPRoSgNmCRCoorKgVOiXT82LszD4SbUxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037785; c=relaxed/simple; bh=cp19dVUb7xvWUsokdlmPF5WkDY+X0uWwwuOAQ7Ty6Vc=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=bSPV5AJc+8O/EAwUkVaKbbdZ3j0unKY2JajFn8S7kXYhXXaut4VxcAHmu/bYfeGMqoEPDiZqrOmZqTqb9liNzkvP3lYaVMmSe0t88FG70vrgV+1DvLquziFyvSzaIHyF9kn7i09EVvf4+FimcQLj3eld18p8zajoKtRAU9km0e0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ckMsYXKC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mTNAr643; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Message-ID: <20240610164028.288945590@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037781; 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=pv6YrQN2ETIiH5UgbcE48m3AAv3y/nIIur52dGrER6A=; b=ckMsYXKCAAMEzrCAiqvrISbsyr0HCIwLj4dk+onV593ag1zXOF6iX+iG7qZOdoiYEtlbtB +zCNVR0y4NaF8+KoYiyyBM/Mn1SQ+jlc2G1UZy7Ni7oSaa+OBco4xKouhSCqejcfUDkI13 2iLsD4Bw/IW4TyP73y5UCEF5S6H2fSAsLavva+yxrTVHbAfmS0zSb+6YaZCwBu4C6YqB3o N54wMlLJ9e+KUF1Tg4ywvosDLYw7TkAbhBioxBbkqAD8rSZTWRF2Tk1lPza3+MuLUeRg5h sL5fGqtPkJoTNeYKrxmDrtiUUheJ/G4g/Ui0XFJHFoi0xvJgvjGmMJmGZxKLBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037781; 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=pv6YrQN2ETIiH5UgbcE48m3AAv3y/nIIur52dGrER6A=; b=mTNAr643KAJBm62oTRMqq22cOienvIFgka6csOHmutJ8NfZqCtLbaB9fM2hu9WrFkBjW78 M96Fh2edgxwHeXDA== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch V3 45/51] signal: Provide ignored_posix_timers list References: <20240610163452.591699700@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 10 Jun 2024 18:43:00 +0200 (CEST) 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 @@ -138,6 +138,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 @@ -29,8 +29,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 @@ -1877,6 +1877,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