From patchwork Thu Jun 29 16:22:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13297148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F29DC001B0 for ; Thu, 29 Jun 2023 16:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S2aaSmEe/+9zQQT4QzniuIcRohK6F/komIlS/PR/Dwc=; b=DaY9OSs2vQuS/8 h0TF640JHDcpFOgQpBFzCAe0cv+P74Hs2tf55i/aydrR8QdF4I2hBe8ThG/KO7OVvMdD0AJlecFyn 56oJvTNdoUPxviKlkR4if7GTlldBi5pLglBRv2Ia8VJ3eHoV8oSHri6OPN31Jvh3pD6aLecPt+27z htWAdy8nwiWgd4Iw5GzPTQM9parIfrXd0OzTw9aBp+OUGC6D5En70+tgktDVkhpnkMnKn3vAasTiB Jdo0dY39XHsYNEPtb2hU/TqPDjlleP7psuQ/hDL2T3qhvEkD8yTgddgObkzam2keyRTOL6snn1WjN 7Ixg6FHlKhrMl3OMpvBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEuQS-001WOU-1E; Thu, 29 Jun 2023 16:23:20 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEuQN-001WMS-31 for linux-riscv@lists.infradead.org; Thu, 29 Jun 2023 16:23:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B39D61572; Thu, 29 Jun 2023 16:23:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C17D3C433CA; Thu, 29 Jun 2023 16:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688055794; bh=XKHVV9536ZEIq0lSPWe7Ma20H9zvrB69ScTYKRNgSug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6kZoAurVeEfkpLZfC9kxcAJWpzl/UUi+VNi5k1i3Dndk9Pb9ABQQu6Vuhx4/V8Ym eYeawEma6ZTO9P034Brnv+y+iANOqT7owHEUXd79yDDf0EE8zQV1kg/E+13nQfIehy bi2qq9G/sfCXcpXVSG8tsSx3dd5zLBJmJSYNixYZ0JRhsNYKQ1jnxQoBwfzM4lNxHs XLxAFCeETZrWAqGnxg/3yTeN0voW/UL/EQ+m1SxkxBivGz2Q16XKHs34qfHrcfA1nh qjGGdKBBR6AiJjCflcdzAfy8xLzozEfx/hq89IOm3E6G8GxRGM7Qjgvb2HRl/t4C0H XezKnlpSIying== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Shuah Khan , linux-kselftest@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Alexey Dobriyan , linux-fsdevel@vger.kernel.org, Anders Roxell Subject: [PATCH 1/2] selftests/openat2: Run-time check for -fsanitize=undefined Date: Thu, 29 Jun 2023 18:22:59 +0200 Message-Id: <20230629162301.1234157-2-bjorn@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230629162301.1234157-1-bjorn@kernel.org> References: <20230629162301.1234157-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_092316_016566_8E92AC0D X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Björn Töpel Some architectures, e.g. riscv, does not have support for the GCC option '-fsanitize=undefined'. Check for '-fsanitize=undefined' support, and only add it to CFLAGS if supported. Signed-off-by: Björn Töpel --- tools/testing/selftests/openat2/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selftests/openat2/Makefile index 843ba56d8e49..f13ad02a18ea 100644 --- a/tools/testing/selftests/openat2/Makefile +++ b/tools/testing/selftests/openat2/Makefile @@ -1,6 +1,13 @@ # SPDX-License-Identifier: GPL-2.0-or-later -CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined +# We need this for the "try-run" macro. +include ../../../build/Build.include + +CFLAGS += -Wall -O2 -g -fsanitize=address +CFLAGS += $(call try-run, \ + echo 'int main() {}' | $(CC) -fsanitize=undefined -x c - -o /dev/null, \ + -fsanitize=undefined,) + TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test include ../lib.mk From patchwork Thu Jun 29 16:23:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13297149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9DCAEB64DC for ; Thu, 29 Jun 2023 16:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VvxYPEWEMoApheRPywq0eC7v1shdaT/ygVes5WniJX0=; b=Pe3pCYVb9WGUm/ yrst9aS1ab/WLIQy0dOLWbHQs0HvFRWhaIl5bj7H2wqwQmNesCnTTe0AmUrffCFwIFWIoHg4bqBS5 iSmsRJ8EVT4I7mPrjIgOeGKNG1UsGpaUgI4q1Q2CEUmWq7kchwGB3FkihLnS3vRzdPsgaXDr4bBm6 VHIXp3bPR6X83/+AGtqOD3RMYYEr3N31w2ijCEsveiGVT2krL+aJArj492LF37XrobvGi6kLdX00V e9tVka9SfeRLVuqYOVPMJwagWRklcliBDPbm7jU0H1IjfvtQ4PATR2gFUSfi1XJZjugiVuBb+ktyH ukR31VyZ3QdK04itREiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEuQV-001WQ8-0B; Thu, 29 Jun 2023 16:23:23 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEuQR-001WNd-0A for linux-riscv@lists.infradead.org; Thu, 29 Jun 2023 16:23:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8C46D61594; Thu, 29 Jun 2023 16:23:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7985CC433C8; Thu, 29 Jun 2023 16:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688055798; bh=eSikYjWsf1u1YgOapbpSLUxaH7RnxQ8gql0i+FIyKOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GH5vzihxkqKrWfUSkEKUdSRtT7VCzM3913wENVZNjt2Ql/kVpdzrxhXsx/kjSSTio kpKtokaAAj1o0/AnrmymQb6xOXoKr/DjEOAI/TAMMf1UUPT+K7TmoDi35HpGUawsKR NqyorhSn7WiV6Y4f3mZxc/hvyYK48p/J9iF5JoNaWgkRZTSuAxylqqdxFllwGMw/hb thcQVYfMLEfqO6w1Mn8o8xI3muqD0PkJtpRb4EYWM3O5MDhi2nrEvlI3VT1GQdcPhS 0CmMhC0Zq7YLi7sUBMqF6xpezgMz0gmHhPR55oFW/hKGJJ1/+Ae1B0NsGc3o/eZ0uf 9jT9uq6fOl0CA== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Shuah Khan , linux-kselftest@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Alexey Dobriyan , linux-fsdevel@vger.kernel.org, Anders Roxell Subject: [PATCH 2/2] selftests/proc: Do not build x86-64 tests on non-x86-64 builds Date: Thu, 29 Jun 2023 18:23:00 +0200 Message-Id: <20230629162301.1234157-3-bjorn@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230629162301.1234157-1-bjorn@kernel.org> References: <20230629162301.1234157-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_092319_127555_45662794 X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Björn Töpel The proc-empty-vm test is x86-64 only. Remove that test from non-x86-64 builds. Signed-off-by: Björn Töpel --- tools/testing/selftests/proc/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile index cd95369254c0..35e765f79b6d 100644 --- a/tools/testing/selftests/proc/Makefile +++ b/tools/testing/selftests/proc/Makefile @@ -8,7 +8,11 @@ TEST_GEN_PROGS += fd-001-lookup TEST_GEN_PROGS += fd-002-posix-eq TEST_GEN_PROGS += fd-003-kthread TEST_GEN_PROGS += proc-loadavg-001 + +ifneq (,$(filter $(ARCH),x86_64)) TEST_GEN_PROGS += proc-empty-vm +endif + TEST_GEN_PROGS += proc-pid-vm TEST_GEN_PROGS += proc-self-map-files-001 TEST_GEN_PROGS += proc-self-map-files-002