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 466D81C3040 for ; Fri, 20 Dec 2024 14:59:56 +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=1734706798; cv=none; b=ECzo+cz8n8rPnzc32swPslw+baBh8VZeO2Om7fZELudlar6r86MtEUdZCMqtbE5vSxy9vjGg1h8AR5Dx5tNY49mLfG+cwP44YKmdUzckgjEmadCdb2qnhew3DgegkBQge8sHgAlNkJK8+8NHbDbkfyc8v9tx44750huSFXLGWT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734706798; c=relaxed/simple; bh=nxPMHzDMvUoFqLdFq2pdId/20/WEGvhzfOADSFLiJw0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=kmJagcIH/HCwRIUs6Nv+HyUjMOWaHEh5CZ7hEvGlUN4rTb6n8H/bHsAWZHYA4zju/frwIpdLw9eJb+PbDF63ScKtrFKklbE6c+c6nL+ih9fYisUAR2xhKuz39xBAHPYhOM9kqaSrnTgk5+3QVWhD2JuScDTMlDMWpG8SOnUs2vg= 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=M0LKaQor; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=pH0ahEJJ; 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="M0LKaQor"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pH0ahEJJ" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1734706795; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHCmj1V3RP2/0urF+KZipPoO9lkKnYDR9b9y+fDsMm0=; b=M0LKaQorK0+EnDrL27/IA+VT4ZRsehV99vJ8/ZYQknke+3Hm0YtjFVAL/Ysj9tyt2DHkzk 6kxd+/e6MaBWFKcWeu7MxMkprhnpwNiIhXsbC5sw3r40D8k/o0lNLyxesxgiUHY0LY80cs tRhxR5Lb9Q84cQ4xLVqN+dD8UCidtriefUW50e2hjygblnit+OhfV1LfQCuY4tZTPf9MiF cDpzFzJ/QY7llGS6TkvGWB3TLdBuPrGSvVlrDDsWSu4FWUSWE7liPegvjyYjqUTatsmFWx Q1/xjvXTk0EF0PHqs3/LCQs7zqSLin4Xs1anThXsKbr1RIkAYT8judjy/EWgiA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1734706795; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHCmj1V3RP2/0urF+KZipPoO9lkKnYDR9b9y+fDsMm0=; b=pH0ahEJJaCIa5fSiwCf4lGGvo70VyJozjlJIVy32TuEUXh2EpPjk8Q9edPUdM9S7vYTXxH fptwv8iK+lweApAA== To: Frederic Weisbecker Cc: syzbot , anna-maria@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, syzkaller-bugs@googlegroups.com, Eric Biederman , Oleg Nesterov Subject: Re: [PATCH] signal/posixtimers: Handle ignore/blocked sequences correctly In-Reply-To: References: <6761b16e.050a0220.29fcd0.006d.GAE@google.com> <87ikrf78xa.ffs@tglx> <87cyhm7azk.ffs@tglx> Date: Fri, 20 Dec 2024 15:59:54 +0100 Message-ID: <87a5cq7639.ffs@tglx> 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 Content-Transfer-Encoding: quoted-printable On Fri, Dec 20 2024 at 14:23, Frederic Weisbecker wrote: > Le Fri, Dec 20, 2024 at 02:14:07PM +0100, Thomas Gleixner a =C3=A9crit : >> On Fri, Dec 20 2024 at 14:06, Frederic Weisbecker wrote: >> > Le Thu, Dec 19, 2024 at 08:46:25PM +0100, Thomas Gleixner a =C3=A9crit= : >> >> if (!list_empty(&q->list)) { >> >> /* >> >> - * If task group is exiting with the signal already pending, >> >> - * wait for __exit_signal() to do its job. Otherwise if >> >> - * ignored, it's not supposed to be queued. Try to survive. >> >> + * The signal was ignored and blocked. The timer >> >> + * expiry queued it because blocked signals are >> >> + * queued independent of the ignored state. >> >> + * >> >> + * The unblocking set SIGPENDING, but the signal >> >> + * was not yet dequeued from the pending list, >> >> + * which would have put it back on the ignore list. >> > >> > I must be missing something. I don't see dequeue_signal() checking if = a signal >> > is ignored upon delivery. >>=20 >>=20 >> Sorry, I meant get_signal() which is what the actual signal delivery >> path on exit to user space invokes. dequeue itself does not care. >>=20 > Hmm, ok it eventually ignores the signal delivery to the user but: > > _ Dequeue signal has delivered it to posix timers > _ The signal isn't moved back to the ignored list (or I'm missing somethi= ng else?) Hmm. Right it is not, but that's correct for blocked signals because they can be also retrieved by sig[timed]wait(). For the case where the signal is ignored, the dequeue and posix timer delivery is not harmful. If it gets rearmed, then the next timer expiry will see ignored and move it to the ignored list. Let me stare at it some more and rewrite the comments to match reality. Thanks for pointing it out! tglx