From nobody Sun Feb 8 06:04:43 2026 Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) (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 263D322F3A8 for ; Thu, 16 Jan 2025 21:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=158.69.130.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737061215; cv=none; b=jws06st1Qvr+PddQZqMMv8jQ/Tmbly7p0QtrUYLoXf00yllT+26JXq0W4VVysp7X/rs/X6f3aOhtMwbDOZaFlMTDFeFDIZxFH6zxK/lIol+YpXKm8N8Pp0BqSqxM2knWSAfcUyGd47M/tL3zi63wTZTeo9zbYfvvjutGXWVZ9i8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737061215; c=relaxed/simple; bh=vBOwEsPKOGiVUShDvMYKmt815IJetKBqlQtDFbkGnnw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LOkd/lzc5OFn+FS7nSXTv1Qkc0FbN2MhArVvyOJ9qgnUP3VYueRiuZMDcPQrTatGHETTYLUV9zKFYK0ffcifwrx2+BSO4Diy2qYEzt2QLRvA3SH0SPmvI1wOn4bO3abdjYVWuPhDN4J3i5A1CD9KN944cGIVUm0VSsWkQOwf2go= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=G05GEm5c; arc=none smtp.client-ip=158.69.130.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="G05GEm5c" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1737061204; bh=vBOwEsPKOGiVUShDvMYKmt815IJetKBqlQtDFbkGnnw=; h=From:To:Cc:Subject:Date:From; b=G05GEm5cgbckid2jZsGVOoS+ZvPV8mh5PFXg1UjVwAWd2KKMIjprkUR75IuEOg8PR w1+PSXcK2B4vO05+2y4iG+TVv16mX7OH3xzEtV7MlSZO3/9K/g9cfCncT8WXF7Twmm 8PQ+LdRk0pKhiJAT565WvPso4xNgYRE/poMtfPOT0JdKwJmwPS4X2lTdXzwR2wny88 yGZ0v8lHTeHEz6UV3ustu9Tl34ohyTjhnk0kO8gIWEnJu08shaEz1UUouIVn+Ccm/Z Wau1QWxo1qxKcI56M9b0aucIiHqgqo9ZUGC7N5skhkqyrKHjp6v59v39r4sjoM7n87 h/V32a/HJqcJg== Received: from thinkos.internal.efficios.com (96-127-217-162.qc.cable.ebox.net [96.127.217.162]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4YYwH84WPBzngD; Thu, 16 Jan 2025 16:00:04 -0500 (EST) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers Subject: [PATCH for sched/core] rseq: Fix rseq unregistration Date: Thu, 16 Jan 2025 15:59:56 -0500 Message-Id: <20250116205956.836074-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A logic inversion in rseq_reset_rseq_cpu_node_id() causes the rseq unregistration to fail when rseq_validate_ro_fields() succeeds rather than the opposite. This affects both CONFIG_DEBUG_RSEQ=3Dy and CONFIG_DEBUG_RSEQ=3Dn. Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ conf= ig") Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) --- kernel/rseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rseq.c b/kernel/rseq.c index e04bb30a2eb8..442aba29bc4c 100644 --- a/kernel/rseq.c +++ b/kernel/rseq.c @@ -201,7 +201,7 @@ static int rseq_reset_rseq_cpu_node_id(struct task_stru= ct *t) /* * Validate read-only rseq fields. */ - if (!rseq_validate_ro_fields(t)) + if (rseq_validate_ro_fields(t)) return -EFAULT; /* * Reset cpu_id_start to its initial state (0). --=20 2.39.5