All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] setfsuid02: using -1 as invalid fsuid for setfsuid()
Date: Mon, 31 Oct 2022 14:50:10 +0100	[thread overview]
Message-ID: <Y1/SkicyE3Mg9Fpc@pevik> (raw)
In-Reply-To: <ad63ddb5-b443-c0ee-fb1b-748bded5f151@suse.cz>

Hi Martin, Avinesh,

> On 31. 10. 22 12:37, Petr Vorel wrote:
> > Hi Avinesh,

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

> > Here was supposed to be
> > Fixes: 85f0b8478 ("setfsuid02: Rewrite using new LTP API")

> > as the problem was introduced in your rewrite, right?

> No, the original test was already broken, it just didn't do any real failure
> checks so it always passed.
Right, thanks!

> > It also does not make sense to check invalid_uid, it should have been
> > current_uid in 85f0b8478 (my bad not catching this):

> > UID16_CHECK(current_uid, setfsuid);

> No, UID16_CHECK(invalid_uid, setfsuid); is the correct test call. The test
> is supposed to verify that trying to set invalid_uid will fail, and the only
> way to verify that it failed is to call setfsuid(invalid_uid) again and
> check that it returns current_uid.
I'm somehow blind today. UID16_CHECK() in compat_tst_16.h calls
UID_SIZE_CHECK(), which just checks the uid value. I don't see setfsuid() call,
IMHO that's done in SETFSUID().

Kind regards,
Petr

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

  reply	other threads:[~2022-10-31 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 14:09 [LTP] [PATCH] setfsuid02: using -1 as invalid fsuid for setfsuid() Avinesh Kumar
2022-10-31 11:37 ` Petr Vorel
2022-10-31 13:36   ` Martin Doucha
2022-10-31 13:50     ` Petr Vorel [this message]
2022-10-31 14:00       ` Martin Doucha
2022-10-31 14:56         ` Petr Vorel
2022-10-31 17:23           ` Martin Doucha
2022-10-31 21:39             ` Petr Vorel
2022-11-02  7:40               ` Avinesh Kumar
2022-10-31 13:01 ` Richard Palethorpe
2022-10-31 21:40   ` Petr Vorel
2022-11-01  9:03     ` Richard Palethorpe
2022-11-02  7:52       ` Avinesh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1/SkicyE3Mg9Fpc@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.