From: Rusty Russell <rusty@rustcorp.com.au>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linus Torvalds <torvalds@transmeta.com>,
tridge@samba.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
cyeoh@samba.org, sfr@canb.auug.org.au, anton@samba.org,
paulus@samba.org, drepper@redhat.com
Subject: Re: [PATCH] Prevent setting 32 uids/gids in the error range
Date: Tue, 18 Feb 2003 15:01:29 +1100 [thread overview]
Message-ID: <20030218040149.17A5D2C04B@lists.samba.org> (raw)
In-Reply-To: Your message of "17 Feb 2003 14:55:20 -0000." <1045493720.19397.4.camel@irongate.swansea.linux.org.uk>
In message <1045493720.19397.4.camel@irongate.swansea.linux.org.uk> you write:
> On Mon, 2003-02-17 at 07:41, Rusty Russell wrote:
> > Tridge noticed that getegid() was returning EPERM.
> >
> > I used -1000 since that's what PTR_ERR uses, but i386 _syscall macros
> > use -125: I don't suppose it really matters.
>
> Thats a bug in the interface. getegid/getgid/setegid/setuid() is not permitted to fail.
> If libc is setting errno and returning -1 the libc wrapper is wrong.
OK, thanks. Note that out asm-i386/unistd.h syscallX macros do it
wrong, too.
AFAICT, glibc (2.3.1) gets this wrong, and interprets 0xffffffff
return from geteuid() as an error (ie. it's not just an strace bug).
Tested by Tridge.
Paulus points out that this also means special handling on archs (PPC
and PPC64 that I know of) which set a condition code on error: this
can be sidestepped in glibc, as well.
Other archs beware.
Thanks for the clarification,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-02-18 3:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-17 7:41 Rusty Russell
2003-02-17 14:55 ` Alan Cox
2003-02-17 15:05 ` Alan Cox
2003-02-18 4:01 ` Rusty Russell [this message]
2003-02-18 5:02 ` tridge
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=20030218040149.17A5D2C04B@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=anton@samba.org \
--cc=cyeoh@samba.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@transmeta.com \
--cc=tridge@samba.org \
/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
all inboxes | Powered by JetHome®