From mboxrd@z Thu Jan 1 00:00:00 1970 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 26AD42472B8; Sun, 5 Jul 2026 10:18:58 +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=1783246739; cv=none; b=nq9zxk86Q1L6nK3MU/tH29qfjPsfNd9l9QT5aOtZhNB5wh1d850nUnTQtvYG4O+p7VukJHn0E7plLBDg9NT7um/AzN3H6Jeu8roV27pnSUUo1FEzjCJ5sbnqiyVPWb7K6dt7dzTL2NFfbA3YbFPdZCKXxq3Kv5ED9gFlzDLSRO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783246739; c=relaxed/simple; bh=KOAAfFH5fBfE6BbOVPXUYfLaKNdBqwIdLaeDGsju0xM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=IAR0gdppr1JLVAlzkDneaKQZScKWfjIZqASqy4VXYhkwb9s4eC3lRImEi3WQl6+uVskdAGPtXKDqH049ZpYbs160RwkjKqNF/BQUT46J5CjmEXz0n3UBn6x6Suftu+awmf/Fdz/OQbXHyAicvfCgycNLb0Jua8Jg3KOeM+h3Jpo= 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=g0KGb1gF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Rm34LhEh; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="g0KGb1gF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Rm34LhEh" Date: Sun, 05 Jul 2026 10:18:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783246736; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CmAImxrYQ7gVMSsl0A/x+hw6lKvYRF3qLBVJB6I1Z9I=; b=g0KGb1gFOWFRi6Yq2l9H+rVRFs3fisTBdXIF23fZt5nHa19pItUzC3/3eqCF/al/TewAa2 4ON6ms/IVegXVMWlvo2R5ohALK0AKldBDCowpc1xqt3JS5//UE+LBX+qJf9dP+0aLtGs1W tGo63Iw7WVYbnJ8C9knNtE8CH1V+y6LPSPZFyzDcNS1ZzCeNiH32UgIeWB6S5DWY5eQQ0Y b5r0IR2Fhx5MPonLSzLn7F+29IyCTlco/b5Xyh/MKrlE/DMMRHtV8NOgcpHyAFKdmzgKcQ 0s0MVOaFxc8HwssrAZTwZtxT3dgS2JfUMvhrhlC9cQykKAzbJekKYJQdYmbYWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783246736; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CmAImxrYQ7gVMSsl0A/x+hw6lKvYRF3qLBVJB6I1Z9I=; b=Rm34LhEhomRWJDwjCVekCTUktALge0+Q8JrZobc9O5v/9WJpnXhB1YNq9KYeYgWV72Terj QgdApOA8p5fVKUAg== From: "tip-bot2 for Oleg Nesterov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] posix-cpu-timers: Don't abuse lock_task_sighand() in handle_posix_cpu_timers() Cc: Oleg Nesterov , Thomas Gleixner , Bradley Morgan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178324673422.744054.16955516111098598048.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: a73d7f98e41a96d6e1bcb0e731ab185d9d67878e Gitweb: https://git.kernel.org/tip/a73d7f98e41a96d6e1bcb0e731ab185d9d6= 7878e Author: Oleg Nesterov AuthorDate: Sat, 04 Jul 2026 13:09:36 +02:00 Committer: Thomas Gleixner CommitterDate: Sun, 05 Jul 2026 12:15:22 +02:00 posix-cpu-timers: Don't abuse lock_task_sighand() in handle_posix_cpu_timers() After commit f90fff1e152d ("posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()"), tsk->sighand is stable in handle_posix_cpu_timers(), so it can use the plain spin_lock_irqsave(&tsk->sighand->siglock). Signed-off-by: Oleg Nesterov Signed-off-by: Thomas Gleixner Reviewed-by: Bradley Morgan Link: https://patch.msgid.link/akjp8AGpY8eJG5I1@redhat.com --- kernel/time/posix-cpu-timers.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 5e633d8..c8a9b52 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -1300,8 +1300,11 @@ static void handle_posix_cpu_timers(struct task_struct= *tsk) unsigned long flags, start; LIST_HEAD(firing); =20 - if (!lock_task_sighand(tsk, &flags)) - return; + /* + * tsk is current and ->sighand is stable, see the + * tsk->exit_state check in run_posix_cpu_timers() + */ + spin_lock_irqsave(&tsk->sighand->siglock, flags); =20 do { /* @@ -1361,7 +1364,7 @@ static void handle_posix_cpu_timers(struct task_struct = *tsk) * that gets the timer lock before we do will give it up and * spin until we've taken care of that timer below. */ - unlock_task_sighand(tsk, &flags); + spin_unlock_irqrestore(&tsk->sighand->siglock, flags); =20 /* * Now that all the timers on our list have the firing flag,