All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
@ 2022-10-13 14:03 zhaogongyi via ltp
  2022-10-13 22:26 ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: zhaogongyi via ltp @ 2022-10-13 14:03 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi Petr,

> 
> > Hi Petr,
> 
> > It is failed on my system:
> 
> > sh-4.4$ ./msgget03
> > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > msgget03.c:42: TINFO: Current environment 0 message queues are
> already
> > in use
> > msgget03.c:45: TBROK: Failed to open FILE '/proc/sys/kernel/msgmni'
> > for writing: EACCES (13)
> 
> Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the need for
> root. IMHO this one is valid.
> 
> I'd suggest to remove needs_root for needs_device and mount_device
> now (i.e. send v2).

Just remove the patch 1 and keep adding needs_root in patch 2?

> 
> nit: FYI most of the people use bottom posting on mailing lists, you use top
> posting. Combine both makes it hard to follow.
> 
> https://en.wikipedia.org/wiki/Posting_style

Thanks for your reminder, I will reply to emails according to the posting_style.

> 
> Kind regards,
> Petr
> 
> 
> > Summary:
> > passed   0
> > failed   0
> > broken   1
> > skipped  0
> > warnings 0
> > tst_sys_conf.c:118: TWARN: Failed to open FILE
> '/proc/sys/kernel/msgmni'

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
  2022-10-13 14:03 [LTP] [PATCH 2/2] needs_root: Add setting of needs_root zhaogongyi via ltp
@ 2022-10-13 22:26 ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2022-10-13 22:26 UTC (permalink / raw)
  To: zhaogongyi; +Cc: ltp

> Hi Petr,


> > > Hi Petr,

> > > It is failed on my system:

> > > sh-4.4$ ./msgget03
> > > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > > msgget03.c:42: TINFO: Current environment 0 message queues are
> > already
> > > in use
> > > msgget03.c:45: TBROK: Failed to open FILE '/proc/sys/kernel/msgmni'
> > > for writing: EACCES (13)

> > Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the need for
> > root. IMHO this one is valid.

> > I'd suggest to remove needs_root for needs_device and mount_device
> > now (i.e. send v2).

> Just remove the patch 1 and keep adding needs_root in patch 2?

If you haven't added it to any test which would have needs_device or
mount_device, then v2 can be kept.

But process_vm_readv02 works for me (on master, on Debian) without root:

$ ./process_vm_readv02
tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
process_vm_readv02.c:32: TINFO: child 0: memory allocated and initialized
process_vm_readv02.c:49: TINFO: child 1: reading string from same memory location
process_vm_readv02.c:61: TPASS: expected string received

Summary:
passed   1
failed   0
broken   0
skipped  0
warnings 0

Also process_vm_readv03, process_vm_writev02 (I stopped checking now).

Why you need it?

Kind regards,
Petr


> > nit: FYI most of the people use bottom posting on mailing lists, you use top
> > posting. Combine both makes it hard to follow.

> > https://en.wikipedia.org/wiki/Posting_style

> Thanks for your reminder, I will reply to emails according to the posting_style.

Thank you!

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
@ 2022-10-20 12:21 zhaogongyi via ltp
  0 siblings, 0 replies; 10+ messages in thread
From: zhaogongyi via ltp @ 2022-10-20 12:21 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Richard Palethorpe, ltp, Martin Doucha

Hi,

> 
> Hi all,
> 
> > Hi,
> 
> 
> > > > > > Hi Petr,
> 
> > > > > > It is failed on my system:
> 
> > > > > > sh-4.4$ ./msgget03
> > > > > > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > > > > > msgget03.c:42: TINFO: Current environment 0 message queues
> are
> > > > > already
> > > > > > in use
> > > > > > msgget03.c:45: TBROK: Failed to open FILE
> > > '/proc/sys/kernel/msgmni'
> > > > > > for writing: EACCES (13)
> 
> > > > > Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the
> > > > > need for root. IMHO this one is valid.
> 
> > > > > I'd suggest to remove needs_root for needs_device and
> > > mount_device
> > > > > now (i.e. send v2).
> 
> > > > Just remove the patch 1 and keep adding needs_root in patch 2?
> 
> > > If you haven't added it to any test which would have needs_device or
> > > mount_device, then v2 can be kept.
> 
> > > But process_vm_readv02 works for me (on master, on Debian) without
> > > root:
> 
> > > $ ./process_vm_readv02
> > > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> > > process_vm_readv02.c:32: TINFO: child 0: memory allocated and
> > > initialized
> > > process_vm_readv02.c:49: TINFO: child 1: reading string from same
> > > memory location
> > > process_vm_readv02.c:61: TPASS: expected string received
> 
> > > Summary:
> > > passed   1
> > > failed   0
> > > broken   0
> > > skipped  0
> > > warnings 0
> 
> > > Also process_vm_readv03, process_vm_writev02 (I stopped checking
> > > now).
> 
> > > Why you need it?
> 
> 
> 
> > On my system, these testcases failed and report EPERM:
> 
> > sh-4.4$ ./process_vm_readv02
> OK, your system is Alpine (it can shorten our discussion next time if you
> report you have problems on musl - i.e. which kernel and libc + versions
> you use).
> 
> Well, we should first check if this is not a bug in musl or Alpine before
> requiring root.
> 
> It'd be interesting to know whether
> tools/testing/selftests/vm/memfd_secret.c
> and tools/testing/selftests/x86/test_vsyscall.c also require root.
> 
> > tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
> > process_vm_readv02.c:32: TINFO: child 0: memory allocated and
> > initialized
> > process_vm_readv02.c:49: TINFO: child 1: reading string from same
> > memory location
> > process_vm_readv02.c:55: TBROK: process_vm_readv: EPERM
> > process_vm_readv02.c:107: TFAIL: child 1: exited with 2
> 

Because of the tests bind06/msgget03/sendto03/setsockopt0[5-9]/swapon01 don't reference to
mount device or different outcome on kinds of kernel versions, should I resubmit a new patch to fix them first?

In fact, I have no a system with kernel version 4.15 that can trace what has happened for tests process_vm_* now.

Regards,
Gongyi

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
@ 2022-10-14  7:02 zhaogongyi via ltp
  0 siblings, 0 replies; 10+ messages in thread
From: zhaogongyi via ltp @ 2022-10-14  7:02 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Richard Palethorpe, ltp, Martin Doucha

Hi Petr,

> Hi all,
> 
> > Hi,
> 
> 
> > > > > > Hi Petr,
> 
> > > > > > It is failed on my system:
> 
> > > > > > sh-4.4$ ./msgget03
> > > > > > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > > > > > msgget03.c:42: TINFO: Current environment 0 message queues
> are
> > > > > already
> > > > > > in use
> > > > > > msgget03.c:45: TBROK: Failed to open FILE
> > > '/proc/sys/kernel/msgmni'
> > > > > > for writing: EACCES (13)
> 
> > > > > Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the
> > > > > need for root. IMHO this one is valid.
> 
> > > > > I'd suggest to remove needs_root for needs_device and
> > > mount_device
> > > > > now (i.e. send v2).
> 
> > > > Just remove the patch 1 and keep adding needs_root in patch 2?
> 
> > > If you haven't added it to any test which would have needs_device or
> > > mount_device, then v2 can be kept.
> 
> > > But process_vm_readv02 works for me (on master, on Debian) without
> > > root:
> 
> > > $ ./process_vm_readv02
> > > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> > > process_vm_readv02.c:32: TINFO: child 0: memory allocated and
> > > initialized
> > > process_vm_readv02.c:49: TINFO: child 1: reading string from same
> > > memory location
> > > process_vm_readv02.c:61: TPASS: expected string received
> 
> > > Summary:
> > > passed   1
> > > failed   0
> > > broken   0
> > > skipped  0
> > > warnings 0
> 
> > > Also process_vm_readv03, process_vm_writev02 (I stopped checking
> > > now).
> 
> > > Why you need it?
> 
> 
> 
> > On my system, these testcases failed and report EPERM:
> 
> > sh-4.4$ ./process_vm_readv02
> OK, your system is Alpine (it can shorten our discussion next time if you
> report you have problems on musl - i.e. which kernel and libc + versions
> you use).

My system is base on kernel version 4.15.0 and glibc 2.27.

When I run the test on the kernel version 6.0 system with non-root, it is passed.

Regards,
Gongyi
 

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
  2022-10-14  2:00 zhaogongyi via ltp
@ 2022-10-14  6:50 ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2022-10-14  6:50 UTC (permalink / raw)
  To: zhaogongyi; +Cc: Richard Palethorpe, ltp, Martin Doucha

Hi all,

> Hi,


> > > > > Hi Petr,

> > > > > It is failed on my system:

> > > > > sh-4.4$ ./msgget03
> > > > > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > > > > msgget03.c:42: TINFO: Current environment 0 message queues are
> > > > already
> > > > > in use
> > > > > msgget03.c:45: TBROK: Failed to open FILE
> > '/proc/sys/kernel/msgmni'
> > > > > for writing: EACCES (13)

> > > > Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the need
> > > > for root. IMHO this one is valid.

> > > > I'd suggest to remove needs_root for needs_device and
> > mount_device
> > > > now (i.e. send v2).

> > > Just remove the patch 1 and keep adding needs_root in patch 2?

> > If you haven't added it to any test which would have needs_device or
> > mount_device, then v2 can be kept.

> > But process_vm_readv02 works for me (on master, on Debian) without
> > root:

> > $ ./process_vm_readv02
> > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> > process_vm_readv02.c:32: TINFO: child 0: memory allocated and
> > initialized
> > process_vm_readv02.c:49: TINFO: child 1: reading string from same
> > memory location
> > process_vm_readv02.c:61: TPASS: expected string received

> > Summary:
> > passed   1
> > failed   0
> > broken   0
> > skipped  0
> > warnings 0

> > Also process_vm_readv03, process_vm_writev02 (I stopped checking
> > now).

> > Why you need it?



> On my system, these testcases failed and report EPERM:

> sh-4.4$ ./process_vm_readv02
OK, your system is Alpine (it can shorten our discussion next time if you report
you have problems on musl - i.e. which kernel and libc + versions you use).

Well, we should first check if this is not a bug in musl or Alpine before
requiring root.

It'd be interesting to know whether tools/testing/selftests/vm/memfd_secret.c
and tools/testing/selftests/x86/test_vsyscall.c also require root.

> tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
> process_vm_readv02.c:32: TINFO: child 0: memory allocated and initialized
> process_vm_readv02.c:49: TINFO: child 1: reading string from same memory location
> process_vm_readv02.c:55: TBROK: process_vm_readv: EPERM
> process_vm_readv02.c:107: TFAIL: child 1: exited with 2

Before I wrote to musl ML and/or ptrace maintainer, anybody knows why
__NR_process_vm_readv requires root? Looking at kernel mm/process_vm_access.c,
process_vm_rw() calls process_vm_rw_core(), where:

	mm = mm_access(task, PTRACE_MODE_ATTACH_REALCREDS);
	if (!mm || IS_ERR(mm)) {
		rc = IS_ERR(mm) ? PTR_ERR(mm) : -ESRCH;
		/*
		 * Explicitly map EACCES to EPERM as EPERM is a more
		 * appropriate error code for process_vw_readv/writev
		 */
		if (rc == -EACCES)
			rc = -EPERM;
		goto put_task_struct;
	}

=> kernel/fork.c

struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
{
	...
	mm = get_task_mm(task);
	if (mm && mm != current->mm &&
			!ptrace_may_access(task, mode)) {
		mmput(mm);
		mm = ERR_PTR(-EACCES);
	}

=> kernel/ptrace.c

/* Returns 0 on success, -errno on denial. */
static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
{
	const struct cred *cred = current_cred(), *tcred;
	struct mm_struct *mm;
	kuid_t caller_uid;
	kgid_t caller_gid;

	if (!(mode & PTRACE_MODE_FSCREDS) == !(mode & PTRACE_MODE_REALCREDS)) {
		WARN(1, "denying ptrace access check without PTRACE_MODE_*CREDS\n");
		return -EPERM;
	}

	...
	rcu_read_unlock();
	return -EPERM;
ok:
	...

Failing LTP code:
	TEST(tst_syscall(__NR_process_vm_readv, pid_alloc, &local, 1UL, &remote,
					 1UL, 0UL));

	if (TST_RET != length)
		tst_brk(TBROK, "process_vm_readv: %s", tst_strerrno(-TST_RET));

> Summary:
> passed   0
> failed   1
> broken   1
> skipped  0
> warnings 0

> sh-4.4$ ./process_vm_readv03
> tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=1024, local_iovecs=8
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=512, local_iovecs=16
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=256, local_iovecs=32
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=128, local_iovecs=64
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=64, local_iovecs=128
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=32, local_iovecs=256
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=16, local_iovecs=512
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=8, local_iovecs=1024
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=1024, local_iovecs=8
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=512, local_iovecs=16
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=256, local_iovecs=32
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=128, local_iovecs=64
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=64, local_iovecs=128
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=32, local_iovecs=256
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=16, local_iovecs=512
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2
> process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=8, local_iovecs=1024
> process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
> process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
> process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
> process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
> process_vm_readv03.c:185: TFAIL: child_read: exited with 2

> Summary:
> passed   0
> failed   32
> broken   16
> skipped  0
> warnings 0



> sh-4.4$ ./process_vm_writev02
> tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
> process_vm_writev02.c:32: TINFO: child 0: allocate memory
> process_vm_writev02.c:55: TINFO: child 1: write to the same memory location
> process_vm_writev02.c:65: TFAIL: tst_syscall(__NR_process_vm_writev, pid_alloc, &local, 1UL, &remote, 1UL, 0UL) failed: EPERM (1)
> process_vm_writev02.c:69: TBROK: process_vm_writev: expected 100000 bytes but got -1
> process_vm_writev02.c:112: TFAIL: write child: exited with 2
> process_vm_writev02.c:45: TFAIL: child 0: found 100000 differences from expected data

> Summary:
> passed   0
> failed   3
> broken   1
> skipped  0
> warnings 0

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
@ 2022-10-14  2:00 zhaogongyi via ltp
  2022-10-14  6:50 ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: zhaogongyi via ltp @ 2022-10-14  2:00 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi,

> 
> > > > Hi Petr,
> 
> > > > It is failed on my system:
> 
> > > > sh-4.4$ ./msgget03
> > > > tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> > > > msgget03.c:42: TINFO: Current environment 0 message queues are
> > > already
> > > > in use
> > > > msgget03.c:45: TBROK: Failed to open FILE
> '/proc/sys/kernel/msgmni'
> > > > for writing: EACCES (13)
> 
> > > Ah, b740bfac5 ("msgget03: Set custom queue limit") causes the need
> > > for root. IMHO this one is valid.
> 
> > > I'd suggest to remove needs_root for needs_device and
> mount_device
> > > now (i.e. send v2).
> 
> > Just remove the patch 1 and keep adding needs_root in patch 2?
> 
> If you haven't added it to any test which would have needs_device or
> mount_device, then v2 can be kept.
> 
> But process_vm_readv02 works for me (on master, on Debian) without
> root:
> 
> $ ./process_vm_readv02
> tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> process_vm_readv02.c:32: TINFO: child 0: memory allocated and
> initialized
> process_vm_readv02.c:49: TINFO: child 1: reading string from same
> memory location
> process_vm_readv02.c:61: TPASS: expected string received
> 
> Summary:
> passed   1
> failed   0
> broken   0
> skipped  0
> warnings 0
> 
> Also process_vm_readv03, process_vm_writev02 (I stopped checking
> now).
> 
> Why you need it?
> 


On my system, these testcases failed and report EPERM:

sh-4.4$ ./process_vm_readv02
tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
process_vm_readv02.c:32: TINFO: child 0: memory allocated and initialized
process_vm_readv02.c:49: TINFO: child 1: reading string from same memory location
process_vm_readv02.c:55: TBROK: process_vm_readv: EPERM
process_vm_readv02.c:107: TFAIL: child 1: exited with 2

Summary:
passed   0
failed   1
broken   1
skipped  0
warnings 0

sh-4.4$ ./process_vm_readv03
tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=1024, local_iovecs=8
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=512, local_iovecs=16
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=256, local_iovecs=32
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=128, local_iovecs=64
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=64, local_iovecs=128
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=32, local_iovecs=256
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=16, local_iovecs=512
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=1024, remote_iovecs=8, local_iovecs=1024
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 1024 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=1024, local_iovecs=8
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=512, local_iovecs=16
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=256, local_iovecs=32
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=128, local_iovecs=64
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=64, local_iovecs=128
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=32, local_iovecs=256
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=16, local_iovecs=512
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2
process_vm_readv03.c:165: TINFO: bufsize=131072, remote_iovecs=8, local_iovecs=1024
process_vm_readv03.c:83: TINFO: child_alloc: memory allocated and initialized
process_vm_readv03.c:110: TINFO: child_read: reading string from same memory location
process_vm_readv03.c:114: TFAIL: process_vm_read() failed: EPERM (1)
process_vm_readv03.c:118: TBROK: process_vm_readv: expected 131072 bytes but got -1
process_vm_readv03.c:185: TFAIL: child_read: exited with 2

Summary:
passed   0
failed   32
broken   16
skipped  0
warnings 0



sh-4.4$ ./process_vm_writev02
tst_test.c:1528: TINFO: Timeout per run is 0h 00m 30s
process_vm_writev02.c:32: TINFO: child 0: allocate memory
process_vm_writev02.c:55: TINFO: child 1: write to the same memory location
process_vm_writev02.c:65: TFAIL: tst_syscall(__NR_process_vm_writev, pid_alloc, &local, 1UL, &remote, 1UL, 0UL) failed: EPERM (1)
process_vm_writev02.c:69: TBROK: process_vm_writev: expected 100000 bytes but got -1
process_vm_writev02.c:112: TFAIL: write child: exited with 2
process_vm_writev02.c:45: TFAIL: child 0: found 100000 differences from expected data

Summary:
passed   0
failed   3
broken   1
skipped  0
warnings 0

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
  2022-10-13  7:45 zhaogongyi via ltp
@ 2022-10-13  9:19 ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2022-10-13  9:19 UTC (permalink / raw)
  To: zhaogongyi; +Cc: ltp

> Hi Petr,

> It is failed on my system:

> sh-4.4$ ./msgget03
> tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
> msgget03.c:42: TINFO: Current environment 0 message queues are already in use
> msgget03.c:45: TBROK: Failed to open FILE '/proc/sys/kernel/msgmni' for writing: EACCES (13)

Ah, b740bfac5 ("msgget03: Set custom queue limit")
causes the need for root. IMHO this one is valid.

I'd suggest to remove needs_root for needs_device and mount_device now
(i.e. send v2).

nit: FYI most of the people use bottom posting on mailing lists, you use top
posting. Combine both makes it hard to follow.

https://en.wikipedia.org/wiki/Posting_style

Kind regards,
Petr


> Summary:
> passed   0
> failed   0
> broken   1
> skipped  0
> warnings 0
> tst_sys_conf.c:118: TWARN: Failed to open FILE '/proc/sys/kernel/msgmni'

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
@ 2022-10-13  7:45 zhaogongyi via ltp
  2022-10-13  9:19 ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: zhaogongyi via ltp @ 2022-10-13  7:45 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi Petr,

It is failed on my system:

sh-4.4$ ./msgget03
tst_test.c:1535: TINFO: Timeout per run is 0h 00m 30s
msgget03.c:42: TINFO: Current environment 0 message queues are already in use
msgget03.c:45: TBROK: Failed to open FILE '/proc/sys/kernel/msgmni' for writing: EACCES (13)

Summary:
passed   0
failed   0
broken   1
skipped  0
warnings 0
tst_sys_conf.c:118: TWARN: Failed to open FILE '/proc/sys/kernel/msgmni'

> > Add setting of  needs_root, otherwise run the test without root will
> > fail and report EACCESS or EPERM.
> ...
> >  testcases/kernel/syscalls/bind/bind06.c                       | 1 +
> >  testcases/kernel/syscalls/cma/process_vm_readv02.c            | 1
> +
> >  testcases/kernel/syscalls/cma/process_vm_readv03.c            | 1
> +
> >  testcases/kernel/syscalls/cma/process_vm_writev02.c           | 1
> +
> >  testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
> >  testcases/kernel/syscalls/ipc/msgget/msgget03.c               | 1 +
> >  testcases/kernel/syscalls/preadv/preadv03.c                   | 1 +
> >  testcases/kernel/syscalls/pwritev/pwritev03.c                 | 1 +
> >  testcases/kernel/syscalls/sendto/sendto03.c                   | 1 +
> >  testcases/kernel/syscalls/setsockopt/setsockopt05.c           | 1 +
> >  testcases/kernel/syscalls/setsockopt/setsockopt06.c           | 1 +
> >  testcases/kernel/syscalls/setsockopt/setsockopt07.c           | 1 +
> >  testcases/kernel/syscalls/setsockopt/setsockopt08.c           | 1 +
> >  testcases/kernel/syscalls/setsockopt/setsockopt09.c           | 1 +
> >  testcases/kernel/syscalls/swapon/swapon01.c                   | 1
> +
> >  15 files changed, 15 insertions(+)
> ...
> > +++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> > @@ -72,6 +72,7 @@ static void cleanup(void)
> 
> >  static struct tst_test test = {
> >  	.needs_tmpdir = 1,
> > +	.needs_root = 1,
> >  	.setup = setup,
> >  	.cleanup = cleanup,
> >  	.test_all = verify_msgget,
> 
> At least this one is working without root:
> 
> $ ./testcases/kernel/syscalls/ipc/msgget/msgget03
> tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> msgget03.c:41: TINFO: Current environment 0 message queues are
> already in use
> msgget03.c:55: TINFO: The maximum number of message queues (32000)
> reached
> msgget03.c:30: TPASS: msgget(1629588886, 1536) : ENOSPC (28)
> 
> Summary:
> passed   1
> failed   0
> broken   0
> skipped  0
> warnings 0
> 
> Kind regards,
> Petr

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
  2022-10-12  9:15 ` [LTP] [PATCH 2/2] needs_root: Add setting of needs_root Zhao Gongyi via ltp
@ 2022-10-13  7:41   ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2022-10-13  7:41 UTC (permalink / raw)
  To: Zhao Gongyi; +Cc: ltp

Hi Zhao,

> Add setting of  needs_root, otherwise run the test without root
> will fail and report EACCESS or EPERM.
...
>  testcases/kernel/syscalls/bind/bind06.c                       | 1 +
>  testcases/kernel/syscalls/cma/process_vm_readv02.c            | 1 +
>  testcases/kernel/syscalls/cma/process_vm_readv03.c            | 1 +
>  testcases/kernel/syscalls/cma/process_vm_writev02.c           | 1 +
>  testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
>  testcases/kernel/syscalls/ipc/msgget/msgget03.c               | 1 +
>  testcases/kernel/syscalls/preadv/preadv03.c                   | 1 +
>  testcases/kernel/syscalls/pwritev/pwritev03.c                 | 1 +
>  testcases/kernel/syscalls/sendto/sendto03.c                   | 1 +
>  testcases/kernel/syscalls/setsockopt/setsockopt05.c           | 1 +
>  testcases/kernel/syscalls/setsockopt/setsockopt06.c           | 1 +
>  testcases/kernel/syscalls/setsockopt/setsockopt07.c           | 1 +
>  testcases/kernel/syscalls/setsockopt/setsockopt08.c           | 1 +
>  testcases/kernel/syscalls/setsockopt/setsockopt09.c           | 1 +
>  testcases/kernel/syscalls/swapon/swapon01.c                   | 1 +
>  15 files changed, 15 insertions(+)
...
> +++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> @@ -72,6 +72,7 @@ static void cleanup(void)

>  static struct tst_test test = {
>  	.needs_tmpdir = 1,
> +	.needs_root = 1,
>  	.setup = setup,
>  	.cleanup = cleanup,
>  	.test_all = verify_msgget,

At least this one is working without root:

$ ./testcases/kernel/syscalls/ipc/msgget/msgget03
tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
msgget03.c:41: TINFO: Current environment 0 message queues are already in use
msgget03.c:55: TINFO: The maximum number of message queues (32000) reached
msgget03.c:30: TPASS: msgget(1629588886, 1536) : ENOSPC (28)

Summary:
passed   1
failed   0
broken   0
skipped  0
warnings 0

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH 2/2] needs_root: Add setting of needs_root
  2022-10-12  9:15 [LTP] [PATCH 0/2] Optimization reference to needs_root Zhao Gongyi via ltp
@ 2022-10-12  9:15 ` Zhao Gongyi via ltp
  2022-10-13  7:41   ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: Zhao Gongyi via ltp @ 2022-10-12  9:15 UTC (permalink / raw)
  To: ltp

Add setting of  needs_root, otherwise run the test without root
will fail and report EACCESS or EPERM.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 testcases/kernel/syscalls/bind/bind06.c                       | 1 +
 testcases/kernel/syscalls/cma/process_vm_readv02.c            | 1 +
 testcases/kernel/syscalls/cma/process_vm_readv03.c            | 1 +
 testcases/kernel/syscalls/cma/process_vm_writev02.c           | 1 +
 testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
 testcases/kernel/syscalls/ipc/msgget/msgget03.c               | 1 +
 testcases/kernel/syscalls/preadv/preadv03.c                   | 1 +
 testcases/kernel/syscalls/pwritev/pwritev03.c                 | 1 +
 testcases/kernel/syscalls/sendto/sendto03.c                   | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt05.c           | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt06.c           | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt07.c           | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt08.c           | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt09.c           | 1 +
 testcases/kernel/syscalls/swapon/swapon01.c                   | 1 +
 15 files changed, 15 insertions(+)

diff --git a/testcases/kernel/syscalls/bind/bind06.c b/testcases/kernel/syscalls/bind/bind06.c
index 618cfce46..3b6e1c99e 100644
--- a/testcases/kernel/syscalls/bind/bind06.c
+++ b/testcases/kernel/syscalls/bind/bind06.c
@@ -100,6 +100,7 @@ static void run(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.max_runtime = 300,
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv02.c b/testcases/kernel/syscalls/cma/process_vm_readv02.c
index 2bd66a49f..97a1595e3 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv02.c
@@ -116,6 +116,7 @@ static void run(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.forks_child = 1,
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv03.c b/testcases/kernel/syscalls/cma/process_vm_readv03.c
index 4caafe867..e2fc84e06 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv03.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv03.c
@@ -189,6 +189,7 @@ static void run(unsigned int i)

 static struct tst_test test = {
 	.test = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.forks_child = 1,
diff --git a/testcases/kernel/syscalls/cma/process_vm_writev02.c b/testcases/kernel/syscalls/cma/process_vm_writev02.c
index 991110d24..794b9d04f 100644
--- a/testcases/kernel/syscalls/cma/process_vm_writev02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_writev02.c
@@ -116,6 +116,7 @@ static void run(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.forks_child = 1,
diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
index bbcb0ca3b..edcd5c368 100644
--- a/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
+++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
@@ -225,6 +225,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.setup = setup,
+	.needs_root = 1,
 	.cleanup = cleanup,
 	.tcnt = ARRAY_SIZE(tcases),
 	.mount_device = 1,
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
index 2257ae0f9..d3e4bbc59 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
@@ -72,6 +72,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.needs_tmpdir = 1,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = verify_msgget,
diff --git a/testcases/kernel/syscalls/preadv/preadv03.c b/testcases/kernel/syscalls/preadv/preadv03.c
index 00b25c549..7b69c77f9 100644
--- a/testcases/kernel/syscalls/preadv/preadv03.c
+++ b/testcases/kernel/syscalls/preadv/preadv03.c
@@ -128,6 +128,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.test = verify_direct_preadv,
diff --git a/testcases/kernel/syscalls/pwritev/pwritev03.c b/testcases/kernel/syscalls/pwritev/pwritev03.c
index 91a5e3c54..ded3c9b7a 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev03.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev03.c
@@ -127,6 +127,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.test = verify_direct_pwritev,
diff --git a/testcases/kernel/syscalls/sendto/sendto03.c b/testcases/kernel/syscalls/sendto/sendto03.c
index 5d2c1e112..49dded5bb 100644
--- a/testcases/kernel/syscalls/sendto/sendto03.c
+++ b/testcases/kernel/syscalls/sendto/sendto03.c
@@ -208,6 +208,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.test = run,
+	.needs_root = 1,
 	.tcnt = ARRAY_SIZE(testcase_list),
 	.setup = setup,
 	.cleanup = cleanup,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt05.c b/testcases/kernel/syscalls/setsockopt/setsockopt05.c
index 651583fb6..cfff4b970 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt05.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt05.c
@@ -93,6 +93,7 @@ static void run(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.taint_check = TST_TAINT_W | TST_TAINT_D,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt06.c b/testcases/kernel/syscalls/setsockopt/setsockopt06.c
index 9c818646b..7daf293b1 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt06.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt06.c
@@ -120,6 +120,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.max_runtime = 270,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt07.c b/testcases/kernel/syscalls/setsockopt/setsockopt07.c
index 616159a90..417fcd077 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt07.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt07.c
@@ -134,6 +134,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.max_runtime = 150,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt08.c b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
index 563444635..ce9409521 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt08.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt08.c
@@ -144,6 +144,7 @@ void run(void)

 static struct tst_test test = {
 	.setup = setup,
+	.needs_root = 1,
 	.test_all = run,
 	.taint_check = TST_TAINT_W | TST_TAINT_D,
 	.forks_child = 1,
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt09.c b/testcases/kernel/syscalls/setsockopt/setsockopt09.c
index 98f7fd00e..08d07dd44 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt09.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt09.c
@@ -115,6 +115,7 @@ static void cleanup(void)

 static struct tst_test test = {
 	.test_all = run,
+	.needs_root = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.taint_check = TST_TAINT_W | TST_TAINT_D,
diff --git a/testcases/kernel/syscalls/swapon/swapon01.c b/testcases/kernel/syscalls/swapon/swapon01.c
index c334ae246..98dc92079 100644
--- a/testcases/kernel/syscalls/swapon/swapon01.c
+++ b/testcases/kernel/syscalls/swapon/swapon01.c
@@ -41,6 +41,7 @@ static void setup(void)

 static struct tst_test test = {
 	.needs_tmpdir = 1,
+	.needs_root = 1,
 	.test_all = verify_swapon,
 	.setup = setup
 };
--
2.17.1


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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-10-20 12:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13 14:03 [LTP] [PATCH 2/2] needs_root: Add setting of needs_root zhaogongyi via ltp
2022-10-13 22:26 ` Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2022-10-20 12:21 zhaogongyi via ltp
2022-10-14  7:02 zhaogongyi via ltp
2022-10-14  2:00 zhaogongyi via ltp
2022-10-14  6:50 ` Petr Vorel
2022-10-13  7:45 zhaogongyi via ltp
2022-10-13  9:19 ` Petr Vorel
2022-10-12  9:15 [LTP] [PATCH 0/2] Optimization reference to needs_root Zhao Gongyi via ltp
2022-10-12  9:15 ` [LTP] [PATCH 2/2] needs_root: Add setting of needs_root Zhao Gongyi via ltp
2022-10-13  7:41   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.