Debian Bug report logs - #642452
SetUID-enabled binary doesn't run as root

Package: general; Maintainer for general is debian-devel@lists.debian.org;

Reported by: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>

Date: Thu, 22 Sep 2011 18:09:02 UTC

Severity: normal

Done: Julien Cristau <jcristau@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, unknown-package@qa.debian.org:
Bug#642452; Package setuid. (Thu, 22 Sep 2011 18:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>:
New Bug report received and forwarded. Copy sent to unknown-package@qa.debian.org. (Thu, 22 Sep 2011 18:09:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>
To: submit@bugs.debian.org
Subject: SetUID-enabled binary doesn't run as root
Date: Thu, 22 Sep 2011 13:07:28 -0500
Package: setuid
Severity: normal

*** Please type your report below this line ***
We have a custom C binary that checks for permitted paths and users, and if those checks pass, our binary runs as set-uid (as root) chmod and chgrp on some directories.

The general idea is that our programmers can correct permissions on folders to allow wider access for the other programmers, assuming the checks all pass.

Note this isn't *always* a problem, on either the 32 nor 64 bit machines discussed below.  Running the chmod and chgrp commands as root from the command line works fine when these fail.

This SetUID option works fine on Debian 5 machines here, but on Debian 6 x64 (x86.64) we get SegFaults:
cweber@athens:~/public_html/lps$ chperms `pwd`
Segmentation fault

and on Debian 6 x86.32 we get 'Operation not permitted':
wvincent@athens:~/public_html/lps/sites$ chperms `pwd`
chgrp -R staff /home/wvincent/public_html/lps/sites
chgrp: changing group of `/home/wvincent/public_html/lps/sites/default/files/feeds/studiolocations.csv': Operation not permitted
chgrp: changing group of `/home/wvincent/public_html/lps/sites/default/files/feeds': Operation not permitted
chmod -R g+wrx /home/wvincent/public_html/lps/sites
chmod: changing permissions of `/home/wvincent/public_html/lps/sites/default/files/feeds': Operation not permitted
chmod: changing permissions of `/home/wvincent/public_html/lps/sites/default/files/feeds/studiolocations.csv': Operation not permitted 



The file in question does have its permissions set correctly AFAICT:
-rwsr-sr-x 1 root root 7860 Sep  1 14:24 /bin/chperms.orig

The same file should be running on both Debian6 x86.64 and x86.32

root@berlin:~# file /bin/chperms.orig
/bin/chperms.orig: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

athens:~# file /bin/chperms.orig 
/bin/chperms.orig: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped





-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash




Information forwarded to debian-bugs-dist@lists.debian.org, unknown-package@qa.debian.org:
Bug#642452; Package setuid. (Thu, 22 Sep 2011 18:24:15 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gergely Nagy <algernon@madhouse-project.org>:
Extra info received and forwarded to list. Copy sent to unknown-package@qa.debian.org. (Thu, 22 Sep 2011 18:24:15 GMT) Full text and rfc822 format available.

Message #10 received at 642452@bugs.debian.org (full text, mbox):

From: Gergely Nagy <algernon@madhouse-project.org>
To: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>
Cc: 642452@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#642452: SetUID-enabled binary doesn't run as root
Date: Thu, 22 Sep 2011 20:23:11 +0200
reassign 642452 general
thanks

Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com> writes:

> Package: setuid
> Severity: normal

When reporting problems using the Debian BTS, the Package *must* be
either a real package, or one of the acceptable virtual packages.

In case of reporting problems that cannot be tied to any particular
package, and a bugreport does need to be filed (ie, various support
lists were already exhausted, and the bug was confirmed to be a bug in
the system, basically), then it should be filed against the "general"
pacakge.

I have reassigned the bug there now.

-- 
|8]




Bug reassigned from package 'setuid' to 'general'. Request was from Gergely Nagy <algernon@madhouse-project.org> to control@bugs.debian.org. (Thu, 22 Sep 2011 18:24:16 GMT) Full text and rfc822 format available.

Reply sent to Julien Cristau <jcristau@debian.org>:
You have taken responsibility. (Thu, 22 Sep 2011 18:54:18 GMT) Full text and rfc822 format available.

Notification sent to Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>:
Bug acknowledged by developer. (Thu, 22 Sep 2011 18:54:18 GMT) Full text and rfc822 format available.

Message #17 received at 642452-done@bugs.debian.org (full text, mbox):

From: Julien Cristau <jcristau@debian.org>
To: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>, 642452-done@bugs.debian.org
Subject: Re: Bug#642452: SetUID-enabled binary doesn't run as root
Date: Thu, 22 Sep 2011 20:52:30 +0200
On Thu, Sep 22, 2011 at 13:07:28 -0500, Jeffrey G Thomas wrote:

> Package: setuid
> Severity: normal
> 
> *** Please type your report below this line ***
> We have a custom C binary that checks for permitted paths and users, and if those checks pass, our binary runs as set-uid (as root) chmod and chgrp on some directories.
> 
> The general idea is that our programmers can correct permissions on folders to allow wider access for the other programmers, assuming the checks all pass.
> 
> Note this isn't *always* a problem, on either the 32 nor 64 bit machines discussed below.  Running the chmod and chgrp commands as root from the command line works fine when these fail.
> 
> This SetUID option works fine on Debian 5 machines here, but on Debian 6 x64 (x86.64) we get SegFaults:
> cweber@athens:~/public_html/lps$ chperms `pwd`
> Segmentation fault
> 
> and on Debian 6 x86.32 we get 'Operation not permitted':
> wvincent@athens:~/public_html/lps/sites$ chperms `pwd`
> chgrp -R staff /home/wvincent/public_html/lps/sites
> chgrp: changing group of `/home/wvincent/public_html/lps/sites/default/files/feeds/studiolocations.csv': Operation not permitted

I'm afraid that sounds like a bug in your program.

Cheers,
Julien




Message #18 received at 642452-done@bugs.debian.org (full text, mbox):

From: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>
To: Julien Cristau <jcristau@debian.org>
Cc: 642452-done@bugs.debian.org
Subject: Re: Bug#642452: SetUID-enabled binary doesn't run as root
Date: Thu, 22 Sep 2011 13:56:47 -0500
> > chgrp -R staff /home/wvincent/public_html/lps/sites
> > chgrp: changing group of `/home/wvincent/public_html/lps/sites/default/files/feeds/studiolocations.csv': Operation not permitted
> 
> I'm afraid that sounds like a bug in your program.

I don't see where that is a bug, when the command itself is displayed on the console and fails.  Not to say that you're wrong, but the command is being built and run properly it appears to me.


Jeffrey




Information forwarded to debian-bugs-dist@lists.debian.org, debian-devel@lists.debian.org:
Bug#642452; Package general. (Thu, 22 Sep 2011 19:06:15 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Cristau <jcristau@debian.org>:
Extra info received and forwarded to list. Copy sent to debian-devel@lists.debian.org. (Thu, 22 Sep 2011 19:06:15 GMT) Full text and rfc822 format available.

Message #23 received at 642452@bugs.debian.org (full text, mbox):

From: Julien Cristau <jcristau@debian.org>
To: Jeffrey G Thomas <Jeffrey.Thomas@nerdery.com>
Cc: 642452@bugs.debian.org
Subject: Re: Bug#642452: SetUID-enabled binary doesn't run as root
Date: Thu, 22 Sep 2011 21:02:24 +0200
On Thu, Sep 22, 2011 at 13:56:47 -0500, Jeffrey G Thomas wrote:

> > > chgrp -R staff /home/wvincent/public_html/lps/sites
> > > chgrp: changing group of `/home/wvincent/public_html/lps/sites/default/files/feeds/studiolocations.csv': Operation not permitted
> > 
> > I'm afraid that sounds like a bug in your program.
> 
> I don't see where that is a bug, when the command itself is displayed on the console and fails.  Not to say that you're wrong, but the command is being built and run properly it appears to me.
> 
I don't know what your program does, so I'm not going to guess further.
If you have something that can be reproduced by other people then please
share this, otherwise I don't think there's much more we can do.

Cheers,
Julien




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 21 Oct 2011 07:33:38 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 22:57:40 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.