[LTP] [PATCH] setfsuid02: using -1 as invalid fsuid for setfsuid()

Avinesh Kumar akumar@suse.de
Wed Nov 2 08:52:37 CET 2022


Hi Richie,

On Tuesday, November 1, 2022 2:33:00 PM IST Richard Palethorpe wrote:
> Hello,
> 
> Petr Vorel <pvorel@suse.cz> writes:
> 
> >> Hello,
> >
> >> Avinesh Kumar <akumar@suse.de> writes:
> >
> >> > a uid which does not have an entry in the /etc/passwd
> >> > file is not really an invalid fsuid for setfsuid(), so changing
> >> > the test to use -1 as an invalid fsuid.
> >> > And second setfsuid(-1) call is to verify that preceding call has
> >> > actually failed and there is no change in the fsuid.
> >
> >> I think the original test is flawed and testing what using -1 does is
> >> not very interesting as the kernel uses standard boilerplate to deal
> >> with this.
> >
> >> AFAICT we don't test what happens if a non-root user tries to set the
> >> fsuid to a uid that is not the euid, ruid or saved uid or 0/-1.

> >
> >> Possibly that is something for a new test though.
I'll post a new patch for this. Thank you for the suggestion.

> >
> > Ah, sorry, I overlooked this, merged now.
> 
> No problem, I think that is the correct thing to do. I'll leave it to
> Avinesh or someone else to extend the test (or not).
> 
> 

Regards,
Avinesh




More information about the ltp mailing list