Skip to contentSkip to conversation

needs_root: Add setting of needs_root

PATCH zhaogongyi via ltp 1 participant 1 message Oct 20, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 64 lines

Hi all,

Quoted 10 lines

Hi,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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

Quoted 39 lines
Quoted 38 lines
Quoted 3 lines
Quoted 3 lines

already

Quoted 2 lines

in use
msgget03.c:45: TBROK: Failed to open FILE

'/proc/sys/kernel/msgmni'

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

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

Quoted 3 lines
Quoted 1 line

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).

Quoted 7 lines
Quoted 1 line

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).

Quoted 15 lines

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.

Quoted 7 lines

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

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp