Skip to contentSkip to conversation

bind/bind02: Testcase failed when no root user run it

PATCH New Cui Bixuan 4 participants 27 messages Oct 28, 2015 – Nov 3, 2015

lore
Share & tools
lore

Cui Bixuan

author
#0 lore raw

PATCH 1/11 bind/bind02: Testcase failed when no root user run it

Add tst_require_root() to testcase for setegid().

---
 testcases/kernel/syscalls/bind/bind02.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/bind/bind02.c +2 -0
index 721f525..3dc5652 100644
@@ -127,6 +127,8 @@ int main(int argc, char *argv[])
 	 * Linux doesn't have that limitation apparently. */
 	char *username = NULL;
 
+	tst_require_root();
+
 	if (argc != 2) {
 		tst_resm(TINFO, "Defaulting to user nobody");
 		username = strdup(nobody_uid);
Signature · 1 line
1.6.0.2
author
#1 lore raw

PATCH 2/11 capset/capset02: Testcase failed when no root user run it

Add tst_require_root() to testcase for seteuid().

---
 testcases/kernel/syscalls/capset/capset02.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/capset/capset02.c +1 -0
index 146755c..d08878e 100644
@@ -174,6 +174,7 @@ int main(int ac, char **av)
 
 void setup(void)
 {
+	tst_require_root();
 
 	TEST_PAUSE;
 
Signature · 1 line
1.6.0.2
author
#2 lore raw

PATCH 3/11 chroot/chroot04: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for seteuid().

---
 testcases/kernel/syscalls/chroot/chroot04.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/chroot/chroot04.c +2 -0
index 6d1d46b..254db0c 100644
@@ -99,6 +99,8 @@ void setup(void)
 {
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	/* make a temporary directory and cd to it */
Signature · 1 line
1.6.0.2
author
#3 lore raw

PATCH 4/11 execve/execve03: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for setgid().

---
 testcases/kernel/syscalls/execve/execve03.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/execve/execve03.c +2 -0
index a3e589e..15b575d 100644
@@ -166,6 +166,8 @@ void setup(void)
 	char *cwdname = NULL;
 	int fd;
 
+	tst_require_root();
+
 	umask(0);
 
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
Signature · 1 line
1.6.0.2
author
#4 lore raw

PATCH 5/11 syscalls/fcntl: Testcases failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for setreuid().

---
 testcases/kernel/syscalls/fcntl/fcntl18.c |    2 ++
 testcases/kernel/syscalls/fcntl/fcntl33.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl18.c +2 -0
index 6b9a7aa..5eefbd1 100644
@@ -171,6 +171,8 @@ void setup(void)
 
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	umask(0);
 
 	TEST_PAUSE;
testcases/kernel/syscalls/fcntl/fcntl33.c +2 -0
index bffb9cb..161c814 100644
@@ -112,6 +112,8 @@ static void setup(void)
 {
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	tst_timer_check(CLOCK_MONOTONIC);
 
 	/* Backup and set the lease-break-time. */
Signature · 1 line
1.6.0.2
author
#5 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for open /proc/self/pagemap file.

---
 testcases/kernel/syscalls/mmap/mmap12.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/mmap/mmap12.c +2 -0
index ba8c646..7484601 100644
@@ -143,6 +143,8 @@ static void setup(void)
 {
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	if ((tst_kvercmp(2, 6, 25)) < 0)
 		tst_brkm(TCONF, NULL,
 			"This test can only run on kernels that are 2.6.25 and "
Signature · 1 line
1.6.0.2
#6 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#7 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

I look my system and others:

1) SUSE SP2: 3.0.13-0.27-default (uname -a); test PASS;  -r--r--r-- 1 root root 0 Oct 30 16:13 /proc/self/pagemap
2) Ubuntu: 3.13.0-32-generic;                test PASS;  -r--r--r--. 1 cuibixuan cuibixuan 0 10? 30 16:19 /proc/self/pagemap
3) SUSE: 4.2.0-0.11-default;                 test FAIL;  -r-------- 1 root root 0 Nov 13 01:39 /proc/self/pagemap
4) arm64: linux 4.1.6;                       test FAIL;  -r-------- 1 root root 0 Jan 18 01:53 /proc/self/pagemap

Maybe the higher version of the kernel change the file attributes of /proc/self/pagemap, I think.

But I read the Documentation/vm/pagemap.txt and look at the source code in kernel, can't get it. :-(

Someone help?

Quoted 1 line
#8 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

----- Original Message -----

Quoted 24 lines

From: "Cui Bixuan" <[email protected]>
To: "Cyril Hrubis" <[email protected]>
Cc: [email protected], [email protected], [email protected]
Sent: Friday, 30 October, 2015 9:56:36 AM
Subject: Re: [LTP] [PATCH 6/11] mmap/mmap12: Testcase failed when no root user run it

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

I look my system and others:
1) SUSE SP2: 3.0.13-0.27-default (uname -a); test PASS; -r--r--r-- 1 root root 0 Oct 30 16:13 /proc/self/pagemap
2) Ubuntu: 3.13.0-32-generic; test PASS; -r--r--r--. 1
cuibixuan cuibixuan 0 10? 30 16:19 /proc/self/pagemap
3) SUSE: 4.2.0-0.11-default; test FAIL; -r-------- 1 root
root 0 Nov 13 01:39 /proc/self/pagemap
4) arm64: linux 4.1.6; test FAIL; -r-------- 1 root
root 0 Jan 18 01:53 /proc/self/pagemap

Quoted 2 lines

Maybe the higher version of the kernel change the file attributes of /proc/self/pagemap, I think.

commit 32ed74a4b968a4faff7aaaff557035ce5d5e70ab

Author: Djalal Harouni <[email protected]>
Date:   Mon Apr 7 15:38:38 2014 -0700

procfs: make /proc/*/pagemap 0400

The /proc/*/pagemap contain sensitive information and currently its mode is 0444. Change this to 0400, so the VFS will prevent unprivileged processes from getting file descriptors on arbitrary privileged /proc/*/pagemap files.

but that doesn't explain why process can't read its own pagemap. For 3) and 4): Did you run that as unprivileged user or as a root?

Can you paste full output from mmap12 run (the one that fails)?

Regards,
Jan

Quoted 12 lines

But I read the Documentation/vm/pagemap.txt and look at the source code in kernel,
can't get it. :-(

Someone help?

Quoted 1 line

--
Mailing list info: http://lists.linux.it/listinfo/ltp

author
#9 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

Quoted 43 lines · Jan Stancek

----- Original Message -----

Quoted 24 lines

From: "Cui Bixuan" <[email protected]>
To: "Cyril Hrubis" <[email protected]>
Cc: [email protected], [email protected], [email protected]
Sent: Friday, 30 October, 2015 9:56:36 AM
Subject: Re: [LTP] [PATCH 6/11] mmap/mmap12: Testcase failed when no root user run it

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

I look my system and others:
1) SUSE SP2: 3.0.13-0.27-default (uname -a); test PASS; -r--r--r-- 1 root root 0 Oct 30 16:13 /proc/self/pagemap
2) Ubuntu: 3.13.0-32-generic; test PASS; -r--r--r--. 1
cuibixuan cuibixuan 0 10? 30 16:19 /proc/self/pagemap
3) SUSE: 4.2.0-0.11-default; test FAIL; -r-------- 1 root
root 0 Nov 13 01:39 /proc/self/pagemap
4) arm64: linux 4.1.6; test FAIL; -r-------- 1 root
root 0 Jan 18 01:53 /proc/self/pagemap

Quoted 2 lines

Maybe the higher version of the kernel change the file attributes of /proc/self/pagemap, I think.

commit 32ed74a4b968a4faff7aaaff557035ce5d5e70ab

Author: Djalal Harouni <[email protected]>
Date:   Mon Apr 7 15:38:38 2014 -0700

procfs: make /proc/*/pagemap 0400

The /proc/*/pagemap contain sensitive information and currently its mode is 0444. Change this to 0400, so the VFS will prevent unprivileged processes from getting file descriptors on arbitrary privileged /proc/*/pagemap files.

Quoted 5 lines

but that doesn't explain why process can't read its own pagemap. For 3) and 4): Did you run that as unprivileged user or as a root?

Can you paste full output from mmap12 run (the one that fails)?

Ok,

3)
linux-91x6:/home/cuibixuan/ltp.git/testcases/kernel/syscalls/mmap # ./mmap12
mmap12 1 TPASS : Functionality of mmap() successful
linux-91x6:/home/cuibixuan/ltp.git/testcases/kernel/syscalls/mmap # uname -a
Linux linux-91x6 4.2.0-0.11-default #1 SMP Mon Sep 28 06:25:26 CST 2015 x86_64 x86_64 x86_64 GNU/Linux linux-91x6:/home/cuibixuan/ltp.git/testcases/kernel/syscalls/mmap # ./mmap12
mmap12 1 TPASS : Functionality of mmap() successful
linux-91x6:/home/cuibixuan/ltp.git/testcases/kernel/syscalls/mmap # su cuibixuan cuibixuan@linux-91x6:~/ltp.git/testcases/kernel/syscalls/mmap> ./mmap12
mmap12 1 TFAIL : mmap12.c:112: Open dev pagemap failed: errno=EPERM(1): Operation not permitted
cuibixuan@linux-91x6:~/ltp.git/testcases/kernel/syscalls/mmap> ls -l /proc/self/pagemap -r-------- 1 cuibixuan users 0 Nov 13 18:19 /proc/self/pagemap

4)
[root@localhost tmp]# ./mmap12
mmap12 1 TPASS : Functionality of mmap() successful
[root@localhost tmp]# su cuibixuan
[cuibixuan@localhost tmp]$ ./mmap12
mmap12 1 TFAIL : mmap12.c:112: Open dev pagemap failed: errno=EPERM(1): Operation not permitted
[cuibixuan@localhost tmp]$ ls -l /proc/self/pagemap -r-------- 1 cuibixuan cuibixuan 0 Jun 2 18:03 /proc/self/pagemap [cuibixuan@localhost tmp]$ uname -r
4.1.6+
[cuibixuan@localhost tmp]$ uname -i
aarch64

Quoted 18 lines

Regards,
Jan

Quoted 5 lines

But I read the Documentation/vm/pagemap.txt and look at the source code in kernel,
can't get it. :-(

Quoted 7 lines

Someone help?

Quoted 1 line

--
Mailing list info: http://lists.linux.it/listinfo/ltp

.

#10 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

----- Original Message -----

Quoted 6 lines

From: "Cui Bixuan" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "Cyril Hrubis" <[email protected]>, [email protected], [email protected], [email protected]
Sent: Saturday, 31 October, 2015 1:54:07 AM
Subject: Re: [LTP] [PATCH 6/11] mmap/mmap12: Testcase failed when no root user run it

Quoted 49 lines
Quoted 48 lines · Jan Stancek

----- Original Message -----

Quoted 25 lines

From: "Cui Bixuan" <[email protected]>
To: "Cyril Hrubis" <[email protected]>
Cc: [email protected], [email protected], [email protected]
Sent: Friday, 30 October, 2015 9:56:36 AM
Subject: Re: [LTP] [PATCH 6/11] mmap/mmap12: Testcase failed when no root user run it

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

I look my system and others:
1) SUSE SP2: 3.0.13-0.27-default (uname -a); test PASS; -r--r--r-- 1 root root 0 Oct 30 16:13 /proc/self/pagemap
2) Ubuntu: 3.13.0-32-generic; test PASS; -r--r--r--. 1
cuibixuan cuibixuan 0 10? 30 16:19 /proc/self/pagemap
3) SUSE: 4.2.0-0.11-default; test FAIL; -r-------- 1 root
root 0 Nov 13 01:39 /proc/self/pagemap
4) arm64: linux 4.1.6; test FAIL; -r-------- 1 root
root 0 Jan 18 01:53 /proc/self/pagemap

Quoted 2 lines

Maybe the higher version of the kernel change the file attributes of /proc/self/pagemap, I think.

commit 32ed74a4b968a4faff7aaaff557035ce5d5e70ab

Author: Djalal Harouni <[email protected]>
Date:   Mon Apr 7 15:38:38 2014 -0700

procfs: make /proc/*/pagemap 0400

The /proc/*/pagemap contain sensitive information and currently its mode
is 0444. Change this to 0400, so the VFS will prevent unprivileged processes from getting file descriptors on arbitrary privileged /proc/*/pagemap files.

but that doesn't explain why process can't read its own pagemap. For 3) and 4): Did you run that as unprivileged user or as a root?

Looks like the EPERM is from this patch, which disabled reading for non-privileged users:

commit ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce

Author: Kirill A. Shutemov <[email protected]>
Date:   Mon Mar 9 23:11:12 2015 +0200

pagemap: do not leak physical addresses to non-privileged userspace

it was later removed in:

commit 1c90308e7a77af6742a97d1021cca923b23b7f0d

Author: Konstantin Khlebnikov <[email protected]>
Date:   Tue Sep 8 15:00:07 2015 -0700

pagemap: hide physical addresses from non-privileged users

So I'm thinking that we should check "if euid != 0 and opening pagemap gives EPERM", then quit with TCONF.

Regards,
Jan

Quoted 21 lines
Quoted 19 lines

Regards,
Jan

Quoted 5 lines

But I read the Documentation/vm/pagemap.txt and look at the source code in kernel,
can't get it. :-(

Quoted 7 lines

Someone help?

Quoted 1 line

--
Mailing list info: http://lists.linux.it/listinfo/ltp

.

#11 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

Hi!

Quoted 2 lines

So I'm thinking that we should check "if euid != 0 and opening pagemap gives EPERM", then quit with TCONF.

Sounds good to me.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#12 lore raw

PATCH v2 6/11 mmap/mmap12: Testcase failed for non-root user

Unprivileged user open /proc/self/pagemap fail so add check for it

---
 testcases/kernel/syscalls/mmap/mmap12.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap12.c +8 -2
index ba8c646..ebc44ae 100644
@@ -108,8 +108,14 @@ static int page_check(void)
 	index = (vmstart / page_sz) * sizeof(uint64_t);
 
 	pm = open("/proc/self/pagemap", O_RDONLY);
-	if (pm == -1)
-		tst_brkm(TFAIL | TERRNO, NULL, "Open dev pagemap failed");
+	if (pm == -1) {
+		if ((0 != geteuid()) && (errno == EPERM))
+			tst_brkm(TCONF | TERRNO, NULL,
+				"don't have permission to open dev pagemap");
+		else
+			tst_brkm(TFAIL | TERRNO, NULL,
+				"Open dev pagemap failed");
+	}
 
 	offset = lseek(pm, index, SEEK_SET);
 	if (offset != index)
Signature · 1 line
1.6.0.2
#13 lore raw

PATCH v2 6/11 mmap/mmap12: Testcase failed for non-root user

----- Original Message -----

Quoted 9 lines

From: "Cui Bixuan" <[email protected]>
To: "Cyril Hrubis" <[email protected]>
Cc: "Jan Stancek" <[email protected]>, [email protected], [email protected], [email protected]
Sent: Tuesday, 3 November, 2015 9:01:22 AM
Subject: [LTP] [PATCH 6/11 v2] mmap/mmap12: Testcase failed for non-root user

Unprivileged user open /proc/self/pagemap fail so add check for it

Pushed with more verbose commit message and small changes to style.

Regards,
Jan

Quoted 29 lines
---
 testcases/kernel/syscalls/mmap/mmap12.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap12.c +8 -3
index ba8c646..ebc44ae 100644
@@ -108,8 +108,14 @@ static int page_check(void)
 	index = (vmstart / page_sz) * sizeof(uint64_t);
 
 	pm = open("/proc/self/pagemap", O_RDONLY);
-	if (pm == -1)
-		tst_brkm(TFAIL | TERRNO, NULL, "Open dev pagemap failed");
+	if (pm == -1) {
+		if ((0 != geteuid()) && (errno == EPERM))
+			tst_brkm(TCONF | TERRNO, NULL,
+				"don't have permission to open dev pagemap");
+		else
+			tst_brkm(TFAIL | TERRNO, NULL,
+				"Open dev pagemap failed");
+	}
 
 	offset = lseek(pm, index, SEEK_SET);
 	if (offset != index)
--

1.6.0.2

author
#14 lore raw

PATCH v2 6/11 mmap/mmap12: Testcase failed for non-root user

Quoted 11 lines · Jan Stancek

----- Original Message -----

Quoted 6 lines

From: "Cui Bixuan" <[email protected]>
To: "Cyril Hrubis" <[email protected]>
Cc: "Jan Stancek" <[email protected]>, [email protected], [email protected], [email protected]
Sent: Tuesday, 3 November, 2015 9:01:22 AM
Subject: [LTP] [PATCH 6/11 v2] mmap/mmap12: Testcase failed for non-root user

Quoted 6 lines
Quoted 3 lines

Unprivileged user open /proc/self/pagemap fail so add check for it

Pushed with more verbose commit message and small changes to style.

Thank you for your help.

Cui Bixuan

Quoted 35 lines

Regards,
Jan

Quoted 27 lines
---
 testcases/kernel/syscalls/mmap/mmap12.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap12.c +8 -3
index ba8c646..ebc44ae 100644
@@ -108,8 +108,14 @@ static int page_check(void)
 	index = (vmstart / page_sz) * sizeof(uint64_t);
 
 	pm = open("/proc/self/pagemap", O_RDONLY);
-	if (pm == -1)
-		tst_brkm(TFAIL | TERRNO, NULL, "Open dev pagemap failed");
+	if (pm == -1) {
+		if ((0 != geteuid()) && (errno == EPERM))
+			tst_brkm(TCONF | TERRNO, NULL,
+				"don't have permission to open dev pagemap");
+		else
+			tst_brkm(TFAIL | TERRNO, NULL,
+				"Open dev pagemap failed");
+	}
 
 	offset = lseek(pm, index, SEEK_SET);
 	if (offset != index)
--
Quoted 2 lines

1.6.0.2

.

author
#15 lore raw

PATCH 6/11 mmap/mmap12: Testcase failed when no root user run it

In reply to Cyril Hrubis
Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 1 line

Add tst_require_root() to testcase for open /proc/self/pagemap file.

On my machines the /proc/self/pagemap is readable by the process (it's owned by the user that has started the program).

What is output of ls -l /proc/self/pagemap on your machine?

I look my system and others:

1) SUSE SP2: 3.0.13-0.27-default (uname -a); test PASS;  -r--r--r-- 1 root root 0 Oct 30 16:13 /proc/self/pagemap
2) Ubuntu: 3.13.0-32-generic;                test PASS;  -r--r--r--. 1 cuibixuan cuibixuan 0 10? 30 16:19 /proc/self/pagemap
3) SUSE: 4.2.0-0.11-default;                 test FAIL;  -r-------- 1 root root 0 Nov 13 01:39 /proc/self/pagemap
4) arm64: linux 4.1.6;                       test FAIL;  -r-------- 1 root root 0 Jan 18 01:53 /proc/self/pagemap

Maybe the higher version of the kernel change the file attributes of /proc/self/pagemap, I think.

But I read the Documentation/vm/pagemap.txt and look at the source code in kernel, can't get it. :-(

Someone help?

Quoted 1 line
author
#16 lore raw

PATCH 7/11 mq_open/mq_open01: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for mq_open().

---
 testcases/kernel/syscalls/mq_open/mq_open01.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/mq_open/mq_open01.c +2 -0
index 529dd7a..f53b4bc 100644
@@ -112,6 +112,8 @@ void cleanup(void)
 /******************************************************************************/
 void setup(void)
 {
+	tst_require_root();
+
 	/* Capture signals if any */
 	/* Create temporary directories */
 	TEST_PAUSE;
Signature · 1 line
1.6.0.2
author
#17 lore raw

PATCH 8/11 ipc/msgctl: Testcases failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for msgctl().

---
 testcases/kernel/syscalls/ipc/msgctl/msgctl06.c |    2 ++
 testcases/kernel/syscalls/ipc/msgctl/msgctl07.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/ipc/msgctl/msgctl06.c +2 -0
index a0b1d35..6c7108f 100644
@@ -123,6 +123,8 @@ int main(int argc, char *argv[])
  *   ****************************************************************/
 void setup(void)
 {
+	tst_require_root();
+
 	/* You will want to enable some signal handling so you can capture
 	 * unexpected signals like SIGSEGV.
 	 */
testcases/kernel/syscalls/ipc/msgctl/msgctl07.c +2 -0
index ac1215c..0eebfb6 100644
@@ -299,6 +299,8 @@ void setup(void)
 {
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();
Signature · 1 line
1.6.0.2
author
#18 lore raw

PATCH 9/11 ipc/semctl: Testcases failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for semop() and semget().

---
 testcases/kernel/syscalls/ipc/semctl/semctl06.c |    2 ++
 testcases/kernel/syscalls/ipc/semctl/semctl07.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/ipc/semctl/semctl06.c +2 -0
index c298345..0b7d853 100644
@@ -387,6 +387,8 @@ void setup(void)
 {
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();
testcases/kernel/syscalls/ipc/semctl/semctl07.c +2 -0
index 3cc1eff..2eb9b5e 100644
@@ -155,6 +155,8 @@ void setup(void)
 {
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();
Signature · 1 line
1.6.0.2
#19 lore raw

PATCH 9/11 ipc/semctl: Testcases failed when no root user run it

Hi!

testcases/kernel/syscalls/ipc/semctl/semctl07.c void setup(void) · line 162

Quoted 13 lines
testcases/kernel/syscalls/ipc/semctl/semctl07.c +2 -0
index 3cc1eff..2eb9b5e 100644
@@ -155,6 +155,8 @@ void setup(void)
 {
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();

This test runs fine without root for me.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#20 lore raw

PATCH 10/11 ipc/shmctl: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for shmctl().

---
 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +2 -0
index ac66ceb..5aa039f 100644
@@ -470,6 +470,8 @@ void setup(void)
 {
 	tst_sig(FORK, sighandler, cleanup);
 
+	Add tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();
Signature · 1 line
1.6.0.2
#21 lore raw

PATCH 10/11 ipc/shmctl: Testcase failed when no root user run it

Hi,

Quoted 12 lines · Cui Bixuan

Add tst_require_root() to testcase for shmctl().

---
 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +0 -0
index ac66ceb..5aa039f 100644

testcases/kernel/syscalls/ipc/shmctl/shmctl01.c void setup(void) · line 474

Quoted 5 lines
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +2 -0
@@ -470,6 +470,8 @@ void setup(void)
 {
 	tst_sig(FORK, sighandler, cleanup);
 
+	Add tst_require_root();
+

tst_requite_root();

Thanks,
Zeng

Quoted 7 lines
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +0 -0
 	TEST_PAUSE;
 
 	tst_tmpdir();
Signature · 1 line
1.6.0.2
author
#22 lore raw

PATCH v2 10/11 ipc/shmctl: Testcase failed when no root user run it

Add tst_require_root() to testcase for shmctl().

---
 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +2 -0
index ac66ceb..5aa039f 100644
@@ -470,6 +470,8 @@ void setup(void)
 {
 	tst_sig(FORK, sighandler, cleanup);
 
+	tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();

-- 1.6.0.2

author
#23 lore raw

PATCH 10/11 ipc/shmctl: Testcase failed when no root user run it

In reply to Zeng Linggang
Quoted 5 lines · Zeng Linggang

Hi,

Quoted 3 lines

{
tst_sig(FORK, sighandler, cleanup);

Quoted 7 lines

testcases/kernel/syscalls/ipc/shmctl/shmctl01.c void setup(void) · line 474

Quoted 2 lines
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +2 -0
+	Add tst_require_root();
+

tst_requite_root();

Thanks,
Zeng

Thank you :-)

Cui Bixuan

Quoted 12 lines
Quoted 8 lines
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +0 -0
 	TEST_PAUSE;
 
 	tst_tmpdir();
Signature · 1 line
1.6.0.2
#24 lore raw

PATCH 10/11 ipc/shmctl: Testcase failed when no root user run it

In reply to Cui Bixuan

Hi!

testcases/kernel/syscalls/ipc/shmctl/shmctl01.c void setup(void) · line 477

Quoted 13 lines
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +2 -0
index ac66ceb..5aa039f 100644
@@ -470,6 +470,8 @@ void setup(void)
 {
 	tst_sig(FORK, sighandler, cleanup);
 
+	Add tst_require_root();
+
 	TEST_PAUSE;
 
 	tst_tmpdir();

This one runs fine as well.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#25 lore raw

PATCH 11/11 unshare/unshare01: Testcase failed when no root user run it

In reply to Cui Bixuan

Add tst_require_root() to testcase for unshare().

---
 testcases/kernel/syscalls/unshare/unshare01.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/kernel/syscalls/unshare/unshare01.c +2 -0
index 17a5a5f..84d1892 100644
@@ -144,6 +144,8 @@ void cleanup(void)
 /******************************************************************************/
 void setup(void)
 {
+	tst_require_root();
+
 	/* Capture signals if any */
 	/* Create temporary directories */
 	TEST_PAUSE;
Signature · 1 line
1.6.0.2
#26 lore raw

PATCH 11/11 unshare/unshare01: Testcase failed when no root user run it

Hi!
And the rest (patches I didn't commented) is pushed with slightly shortened commit message topic (ideally it should fit to 50 chars), thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]