Message ID | 167214323279.4906.12457162726827402464.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1364858wrt; Tue, 27 Dec 2022 04:26:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXugMfxmE/zNBOM5m1RoVPS6XeOmFSQSmN4doie2oH4WrNZjbim7YfO0tElrlssU4aCkbAqN X-Received: by 2002:a17:907:874c:b0:7fc:4242:f9ec with SMTP id qo12-20020a170907874c00b007fc4242f9ecmr17605801ejc.43.1672143969116; Tue, 27 Dec 2022 04:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672143969; cv=none; d=google.com; s=arc-20160816; b=0/YVF2zQkIlV2rH9KlyICuPGTjHkuyvKu+FaUib6FNWtXTZ0/b5mchmLP2zja5Dncz x4hYyY2P2w6K2xipj+YuvLXfauyw24VfW+ZubCbXbUZOVDNmId50OkxRQQ0z69/pgCv9 yzVLA1TzBjeOZv3ySNIo6Tax6qY5LFOJxt/E3Fu4oGHGMPli1kIjcpbgK7MGUm0ghQTK RlsRk2YGsLVKorr+ppjaEHnkqYZeooktw6R2Z1soP1FOnNHxiC7cWKbk9dWTgqJUaGAN nzsBlmMx5v0XKWD5ohEiPnxJ3E9A9LpFHELwePS1t8MwbwLMtHcyQLjF+3HLgRvDevBN V2LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=hulIJpjMgo6pOe8FjgQRymuJwZUMCCYKSFHvu1/1r9s=; b=N4g2KhJM4xpsJhYZ5y/2HQgYMzBvujIPnTJtQlZEYA9fyWgnrznxt65AGecqatAK5a /vYWqpM7LgB+SOZbxjEv6gg6MKFoJImT395MB0gnMnZiQN8BxljS6EBwIy9Gk/9C31jG Dft4bIskiIh4ZK6Ct6xRiZYkG1GEixQj2sD/jpYAWynZUqfcrL8gnVtk51Nzg/Dgh6mg 6wymN8yQd34sjPUByNM4VvQNSaudRoP2KC+SOO76AzSyrL3W3N+/MqmQ+QflK4VHd47S hOASqZooheWZ6vKPTKhoQlVjXP26dB45+D7sy7tvoDO57d7noOPGQl+8X/oTbMFiWXRm RlxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WJyri35S; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he7-20020a1709073d8700b007da4fe085d4si12141135ejc.694.2022.12.27.04.25.44; Tue, 27 Dec 2022 04:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WJyri35S; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbiL0MQn (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Tue, 27 Dec 2022 07:16:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbiL0MOn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Dec 2022 07:14:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365F563FF; Tue, 27 Dec 2022 04:13:56 -0800 (PST) Date: Tue, 27 Dec 2022 12:13:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672143233; 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=hulIJpjMgo6pOe8FjgQRymuJwZUMCCYKSFHvu1/1r9s=; b=WJyri35SpY+6VrrUTSEbHH0xkbOZuOfXy8Kjw8BHu+XBiKcR1QePxGMRvBLeshfLkrvDVF s6Jn3lKXF6s/Bnus2PBXylzlI7Oot8S2GDFN8eRjP69q/yKMtbMQmPIQAKlq4sGk6wkGfI uonIOND3YW/UAiXPmgMFY7qCcKwUmw5C0CfY/1XogBK8F7BwJ5992tYQYRaMGK19vM8W1T My4HogM6o+ViKvDgjBE6bH1DBiDOGOoFADWDnAODBxS6F0kB4l8sWIM9ofFACGd8bIJVSy Flvsk9sVMoaUBmbmcOL9eeC2rc4ZfuEu7630DEfdpREEfVbFlONv1dTOy56eqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672143233; 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=hulIJpjMgo6pOe8FjgQRymuJwZUMCCYKSFHvu1/1r9s=; b=xoRZfHCSJyKy5ctgOrpsNzDVqqCbIVMkX5AsRuGZS6avlsyFda3HkJI6K6voa2x3kkxYc3 PZRrcDye5Tf5aWBA== From: "tip-bot2 for Mathieu Desnoyers" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] selftests/rseq: Fix: Fail thread registration when CONFIG_RSEQ=n Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, "Peter Zijlstra (Intel)" <peterz@infradead.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221122203932.231377-2-mathieu.desnoyers@efficios.com> References: <20221122203932.231377-2-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Message-ID: <167214323279.4906.12457162726827402464.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750230285509441150?= X-GMAIL-MSGID: =?utf-8?q?1753370034647127479?= |
Series |
[tip:,sched/core] selftests/rseq: Fix: Fail thread registration when CONFIG_RSEQ=n
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Dec. 27, 2022, 12:13 p.m. UTC
The following commit has been merged into the sched/core branch of tip: Commit-ID: 4842dadfc66f627083ec46c4e9a426e805c765f3 Gitweb: https://git.kernel.org/tip/4842dadfc66f627083ec46c4e9a426e805c765f3 Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> AuthorDate: Tue, 22 Nov 2022 15:39:03 -05:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 27 Dec 2022 12:52:10 +01:00 selftests/rseq: Fix: Fail thread registration when CONFIG_RSEQ=n When linking the selftests against a libc which does not handle rseq registration (before 2.35), rseq thread registration silently succeed even with CONFIG_RSEQ=n because it erroneously thinks that libc is handling rseq registration. This is caused by setting the rseq ownership flag only after the rseq_available() check. It should rather be set before the rseq_available() check. Set the rseq_size to 0 (error value) immediately after the rseq_available() check fails rather than in the thread registration functions. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20221122203932.231377-2-mathieu.desnoyers@efficios.com --- tools/testing/selftests/rseq/rseq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 4177f95..376a73f 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -119,9 +119,11 @@ void rseq_init(void) rseq_flags = *libc_rseq_flags_p; return; } - if (!rseq_available()) - return; rseq_ownership = 1; + if (!rseq_available()) { + rseq_size = 0; + return; + } rseq_offset = (void *)&__rseq_abi - rseq_thread_pointer(); rseq_size = sizeof(struct rseq_abi); rseq_flags = 0;