lkml.org 
[lkml]   [2013]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs
On Wed, Aug 7, 2013 at 9:21 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> On 08/06, Andy Lutomirski wrote:
>>
>> I assume that what the man page means is that the return value is
>> whatever fsgid was prior to the call. On error, fsgid isn't changed, so
>> the return value is still "current".
>
> Probably... Still
>
> On success, the previous value of fsuid is returned.
> On error, the current value of fsuid is returned.
>
> looks confusing. sys_setfsuid() always returns the old value.
>
>> (FWIW, this behavior is awful and is probably the cause of a security
>> bug or three, since success and failure are indistinguishable.
>
> At least this all looks strange.
>
> I dunno if we can change this old behaviour. I won't be surprized
> if someone already uses setfsuid(-1) as getfsuid().

I suspect that changing this without introducing security or other
bugs is impossible. If someone wanted to add new_setfsuid that
returned an error when it failed, that would be a different story.
(I'm not going to do that myself.)

>
> And perhaps the man page should be changed. Add Michael.

Agreed. The text is a bit odd.

>
> Oleg.
>



--
Andy Lutomirski
AMA Capital Management, LLC


\
 
 \ /
  Last update: 2013-08-07 19:21    [W:0.102 / U:1.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site