From patchwork Tue Jun 18 17:42:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 13702802 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64AE813F00A for ; Tue, 18 Jun 2024 17:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718732567; cv=none; b=UD5fjuH93b2o6RVVW1ys7wYlec1AO7sHitLWQouDkSZxr8WBUciUJdZ95l85maz9mIhgrBub+T5/bkZIpHl8bQbQVYPER1VvwLHU3OjlSOnrmaNc+YgyMPf295Dg858gQHuSUv2zCDcva+s2q6XAwfM+ndvLBCkcIyi0BoOxVj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718732567; c=relaxed/simple; bh=+KXHaWJRWeE9SvAOhI7bkcjwVi5BF70oFRcy1jR3idk=; h=Content-Type:Message-ID:Date:MIME-Version:To:Cc:From:Subject; b=op6u5v8edm5fjo9lHLTnYz6p0aByKUHOwtu/xtt0ZHWAlWOOCLWual0AKmm3Z/0591gnN0PSpBjs52L1ZtsV67bTcY26haOPa7JmJZafxQeMsyzaQR1uzQmMOSnP7Sq0i1/Up7qVeRSxpyc5wj5XhmsNlpHagFisHkefywocSaY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cGA6nXUm; arc=none smtp.client-ip=209.85.166.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cGA6nXUm" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-375858224b8so3100065ab.2 for ; Tue, 18 Jun 2024 10:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1718732564; x=1719337364; darn=vger.kernel.org; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=k4kuU5u9SGuQEygwCjUeiFjjBzMumH1fP75ahMq3wIQ=; b=cGA6nXUmooQoWHinl1fni5opQsfYufi2e8JaIIx6jb3GN3xHVTd7tboNLcPNJebX3V YAafZIyruR3Qa2VXX+anACJe7jLHufn+/BvmpLGroGhm30ZSiFHPhbVQ2oSpf1ZEOxGp ULxGJlfV2BoG7Q3IUiLbJnj0dukgS2dyxPVZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718732564; x=1719337364; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k4kuU5u9SGuQEygwCjUeiFjjBzMumH1fP75ahMq3wIQ=; b=mhtzakK76Xmja4iuz6gykVwuUFNzo/hJ0DgJZFYnz52VI5UNAr/RnZ5DPtBqQpO9Iw 2RWHGc7C1NWgBA0EGsRX4aP91v5I8PxI5XtUnGAE84UzqzxGn/vxsPhw7waurBlOysy+ K+ICS+/eTmsmxGqjjFedsBQIjjv5Atl8mdTlYyX7EE6gWH0xko0ok+KLIyibNJwymS8T Qr5aW3z/v2onv4QvV+sTubsgwZ6gPVoAWMOxYOKAl48yAYbfuZvmNxnjoT14Dwo79AEv eGmtEDTO084u8moD4F44Jr7Ihf37dXWr81gSxj30rC7W+lRkABPdzAOlzcFdT8jj8d/L IXRg== X-Forwarded-Encrypted: i=1; AJvYcCU5AAw8+YC363ow9+KUocd5D5jnp+mRGRAFedEU6jblBfRWmsQbS7Al+EZKEAYpwtGhKTxxjnbL/g17Ac5YqyIf3GhbOvUeVBm2FitsL6g/ X-Gm-Message-State: AOJu0YxFdxLYxutle/MO2kHQfSNxTRKnUj7C6moTDnoanOmckTDCCAkd 6XIh5FotbXoirf2AMGGR/EqDr8Pd1Ra37rsB8N2N3QaG1yWTfSIFLl3h3SGBTo4biYqL7WcHk9g Z X-Google-Smtp-Source: AGHT+IF7G4RmejRcO1xloqnVQ5ZeUGAmm9vPWOpgZXO47kbtYs4Jf3cx0KK1+808T1dcENznmujtAw== X-Received: by 2002:a05:6602:1d57:b0:7eb:ea26:3471 with SMTP id ca18e2360f4ac-7f13ee6c867mr56834239f.2.1718732564389; Tue, 18 Jun 2024 10:42:44 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b956a20bc6sm3301638173.123.2024.06.18.10.42.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jun 2024 10:42:43 -0700 (PDT) Message-ID: <772723d8-a7bb-4053-be40-b00680b518bf@linuxfoundation.org> Date: Tue, 18 Jun 2024 11:42:42 -0600 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Linus Torvalds Cc: Shuah Khan , shuah , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] Kselftest fixes for Linux 6.10-rc5 Hi Linus, Please pull this kselftest fixes update for Linux 6.10-rc5. This kselftest fixes update consists of 4 fixes to the following build warnings: - filesystems: warn_unused_result warnings - seccomp: format-zero-length warnings - fchmodat2: clang build warnings due to-static-libasan - openat2: clang build warnings due to static-libasan, LOCAL_HDRS diff for pull request is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 4bf15b1c657d22d1d70173e43264e4606dfe75ff: selftests/futex: don't pass a const char* to asprintf(3) (2024-05-31 14:37:10 -0600) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-fixes-6.10-rc5 for you to fetch changes up to ed3994ac847e0d6605f248e7f6776b1d4f445f4b: selftests/fchmodat2: fix clang build failure due to -static-libasan (2024-06-11 15:05:05 -0600) ---------------------------------------------------------------- linux_kselftest-fixes-6.10-rc5 This kselftest fixes update consists of 4 fixes to the following build warnings: - filesystems: warn_unused_result warnings - seccomp: format-zero-length warnings - fchmodat2: clang build warnings due to-static-libasan - openat2: clang build warnings due to static-libasan, LOCAL_HDRS ---------------------------------------------------------------- Amer Al Shanawany (2): selftests: filesystems: fix warn_unused_result build warnings selftests: seccomp: fix format-zero-length warnings John Hubbard (2): selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS selftests/fchmodat2: fix clang build failure due to -static-libasan tools/testing/selftests/fchmodat2/Makefile | 11 ++++++++++- .../selftests/filesystems/statmount/statmount_test.c | 12 ++++++++++-- tools/testing/selftests/openat2/Makefile | 14 ++++++++++++-- tools/testing/selftests/seccomp/seccomp_benchmark.c | 6 +++--- 4 files changed, 35 insertions(+), 8 deletions(-) ---------------------------------------------------------------- diff --git a/tools/testing/selftests/fchmodat2/Makefile b/tools/testing/selftests/fchmodat2/Makefile index 71ec34bf1501..4373cea79b79 100644 --- a/tools/testing/selftests/fchmodat2/Makefile +++ b/tools/testing/selftests/fchmodat2/Makefile @@ -1,6 +1,15 @@ # SPDX-License-Identifier: GPL-2.0-or-later -CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan $(KHDR_INCLUDES) +CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES) + +# gcc requires -static-libasan in order to ensure that Address Sanitizer's +# library is the first one loaded. However, clang already statically links the +# Address Sanitizer if -fsanitize is specified. Therefore, simply omit +# -static-libasan for clang builds. +ifeq ($(LLVM),) + CFLAGS += -static-libasan +endif + TEST_GEN_PROGS := fchmodat2_test include ../lib.mk diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c index e6d7c4f1c85b..e8c019d72cbf 100644 --- a/tools/testing/selftests/filesystems/statmount/statmount_test.c +++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c @@ -125,8 +125,16 @@ static uint32_t old_root_id, old_parent_id; static void cleanup_namespace(void) { - fchdir(orig_root); - chroot("."); + int ret; + + ret = fchdir(orig_root); + if (ret == -1) + ksft_perror("fchdir to original root"); + + ret = chroot("."); + if (ret == -1) + ksft_perror("chroot to original root"); + umount2(root_mntpoint, MNT_DETACH); rmdir(root_mntpoint); } diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selftests/openat2/Makefile index 254d676a2689..185dc76ebb5f 100644 --- a/tools/testing/selftests/openat2/Makefile +++ b/tools/testing/selftests/openat2/Makefile @@ -1,8 +1,18 @@ # SPDX-License-Identifier: GPL-2.0-or-later -CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan +CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test +# gcc requires -static-libasan in order to ensure that Address Sanitizer's +# library is the first one loaded. However, clang already statically links the +# Address Sanitizer if -fsanitize is specified. Therefore, simply omit +# -static-libasan for clang builds. +ifeq ($(LLVM),) + CFLAGS += -static-libasan +endif + +LOCAL_HDRS += helpers.h + include ../lib.mk -$(TEST_GEN_PROGS): helpers.c helpers.h +$(TEST_GEN_PROGS): helpers.c diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c index b83099160fbc..94886c82ae60 100644 --- a/tools/testing/selftests/seccomp/seccomp_benchmark.c +++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c @@ -194,14 +194,14 @@ int main(int argc, char *argv[]) ksft_set_plan(7); ksft_print_msg("Running on:\n"); - ksft_print_msg(""); + ksft_print_msg("%s", ""); system("uname -a"); ksft_print_msg("Current BPF sysctl settings:\n"); /* Avoid using "sysctl" which may not be installed. */ - ksft_print_msg(""); + ksft_print_msg("%s", ""); system("grep -H . /proc/sys/net/core/bpf_jit_enable"); - ksft_print_msg(""); + ksft_print_msg("%s", ""); system("grep -H . /proc/sys/net/core/bpf_jit_harden"); affinity();