public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: ltp-list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] lib/tst_uid_gid.c: fix checking return value errors about getpwuid_r/getgrgid_r
Date: Tue, 8 Apr 2014 16:49:54 +0200	[thread overview]
Message-ID: <20140408144954.GA1841@rei> (raw)
In-Reply-To: <5344069B.8010101@oracle.com>

Hi!
> > Applied for now, thanks.
> >
> > Howvever if I remeber correctly the past discussion we do not strictly
> > need system unused uid and gid in the  setregid02 and setregid03
> > testcases and the failures were caused by the clash between nobody uid
> > and arbitrary constatnt hardcoded into the source.
> 
> setregid03 doesn't use GET_UNUSED_GID(). That time we talked about 
> setregid02 and setresuid03.

Right, git grep GET_UNUSED shows these two.

> > If I understand this correctly all need is a uid/gid different from the
> > nobody user used for the testing, right?
> >
> Yes.
> 
> And, actually, bin.gr_gid is equivalent to inval_user for purposes of 
> setregid02 testing.
> 
> Therefore, theoretically, we can cut off:
>          &inval_user, &neg_one, EINVAL, &nobody, &nobody,
>                      "After setregid(invalid group, -1),"}, {
>          &neg_one, &inval_user, EINVAL, &nobody, &nobody,
>                      "After setregid(-1, invalid group),"},};
> 
> from there.

Hmm, as far as I can see the the error for bin.gr_gid is EPERM, while
invalid user test expect EINVAL, so something must be different.

And it looks like you can really get EINVAL in the setregid() in
kernel/sys.c. And that it depends on namespace mappings. See
kernel/user_namespace.c make_kgid() that calls map_id_down(), although I
haven't yet figured out exact conditions yet.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-04-08 14:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20  2:10 [LTP] [PATCH] lib/tst_uid_gid.c: fix checking return value errors about getpwuid_r/getgrgid_r Zeng Linggang
2014-02-20  7:53 ` Stanislav Kholmanskikh
2014-03-06 11:34   ` Zeng Linggang
2014-03-06 12:36     ` Stanislav Kholmanskikh
2014-03-10  8:13       ` Zeng Linggang
2014-03-13  8:33 ` Zeng Linggang
     [not found] ` <1396944482.2100.1.camel@G08JYZSD130126>
2014-04-08 11:19   ` chrubis
     [not found]     ` <5344069B.8010101@oracle.com>
2014-04-08 14:49       ` chrubis [this message]
2014-04-08 15:52         ` chrubis
     [not found]           ` <5344E5C8.3070306@oracle.com>
2014-04-09 13:08             ` chrubis
     [not found]               ` <53454939.2030704@oracle.com>
2014-04-09 13:23                 ` chrubis
2014-04-09 14:39                   ` chrubis

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=20140408144954.GA1841@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=stanislav.kholmanskikh@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox