lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 May 2024 18:38:07 -0700
From: Joseph Jang <jjang@...dia.com>
To: <shuah@...nel.org>, <alexandre.belloni@...tlin.com>, <avagin@...gle.com>,
	<jjang@...dia.com>, <amir73il@...il.com>, <brauner@...nel.org>,
	<mochs@...dia.com>, <kobak@...dia.com>, <linux-kernel@...r.kernel.org>,
	<linux-rtc@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
CC: <linux-tegra@...r.kernel.org>
Subject: [PATCH 2/2] selftest: rtc: Check if could access /dev/rtc0 before testing

The rtctest requires the read permission on /dev/rtc0. The rtctest will
be skipped if the /dev/rtc0 is not readable.

Reviewed-by: Koba Ko <kobak@...dia.com>
Reviewed-by: Matthew R. Ochs <mochs@...dia.com>
Signed-off-by: Joseph Jang <jjang@...dia.com>
---
 tools/testing/selftests/rtc/rtctest.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
index 2b12497eb30d..d104f5326cf4 100644
--- a/tools/testing/selftests/rtc/rtctest.c
+++ b/tools/testing/selftests/rtc/rtctest.c
@@ -483,6 +483,8 @@ __constructor_order_last(void)
 
 int main(int argc, char **argv)
 {
+	int ret = -1;
+
 	switch (argc) {
 	case 2:
 		rtc_file = argv[1];
@@ -494,5 +496,12 @@ int main(int argc, char **argv)
 		return 1;
 	}
 
-	return test_harness_run(argc, argv);
+	/* Run the test if rtc_file is accessible */
+	if (access(rtc_file, R_OK) == 0)
+		ret = test_harness_run(argc, argv);
+	else
+		ksft_exit_skip("[SKIP]: Cannot access rtc file %s - Exiting\n",
+						rtc_file);
+
+	return ret;
 }
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ