Skip to contentSkip to conversation

syscalls/setfsgid02: Bugfix for running as root

PATCH New zhaogongyi 1 participant 1 message May 8, 2021

lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

PATCH 1/1 syscalls/setfsgid02: Bugfix for running as root

Hi Cyril,

Thanks for your review!

I have resubmitted the patch and rewrite setfsgid02.c,

please see: https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Thanks so much!

Best Regards,
Gongyi

Quoted 28 lines

Hi!

Quoted 2 lines

When we run the test as root id, and with the option "-i 2", test will fail.

Looking at the test there is much more to fix.

- the description does not match what the test is doing
- the pass/fail condition and TFAIL message does not make any sense

And its the same for the rest of the setfsgid tests.

Looking at the manual pages for this oddball syscall we should check if:

- unpriviledged process cannot change the value i.e. value that is different from return from ret=setfsgid(-1) is passed as setfsgid(ret+1) followed by setfsgid(-1) and all of these returns the same value and the value also matches process effective group ID

- priviledged process can change the value i.e. the same as unpriviledged but we expect the last setfsgid(-1) return the new value. We either have to reset the setfsgid() at the end of the test or run it in a fork()-ed process so that we start with a clean plate for each iteration

--
Cyril Hrubis
[email protected]