netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Benjamin Thery" <ben.thery@gmail.com>
Cc: tilman@imap.cc, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, davem@davemloft.net, pekkas@netcore.fi,
	yoshfuji@linux-ipv6.org, dlezcano@fr.ibm.com, xemul@openvz.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [2.6.25-rc5-mm1] regression: cannot run Postfix sendmail command as non-root
Date: Wed, 19 Mar 2008 14:16:08 -0700	[thread overview]
Message-ID: <20080319141608.ede86a86.akpm@linux-foundation.org> (raw)
In-Reply-To: <939d53060803191052o2f43b75cu426d51f9f24e2a46@mail.gmail.com>

On Wed, 19 Mar 2008 18:52:41 +0100
"Benjamin Thery" <ben.thery@gmail.com> wrote:

> Tilman,
> 
> I've finally managed to reproduce your problem with Postfix on one of
> my victims.
> 
> Earlier, in the afternoon, I wrote a piece of code that triggered a
> similar behaviour,
> but I wasn't sure it was exactly the problem you found. So, I've
> rebuilt Postfix, added
> some traces and, voila, same issue as yours.
> (The version of Postfix originally  installed on my machine seems to
> have IPv6 disabled)
> 
> I bisected the problem to the commit "[NET]: Make /proc/net a symlink
> on /proc/self/net (v3)"
> 
> Here is what happens:
> 
> - Recently /proc/net has been moved to /proc/self/net, and
> /proc/self/net is a symlink
>   on this directory.
> - Before that everybody could access /proc/net and read /proc/net/if_inet6:
>    dr-xr-xr-x   6 root      root              0 2008-03-05 15:23 /proc/net
> 
> - Now, /proc/self/net has a more restrictive access mode and ony the
> owner of the
>   process can enter the directory:
>   dr-xr--r-- 5 toto toto 0 Mar 19 17:30 net
> 
>   This is not a problem in most of the cases, but it becomes annoying
> when a process
>   decides to change its UID or GID. It may loose access to its own
> /proc/self/net entries.
> 
> - What happens in the Postfix case is the 'sendmail' process executes the
>    '/usr/sbin/postdrop' binary to enqueue the message, but unfortunately
>    '/usr/bin/postdrop' has the setgid bit set:
>    -rwxr-sr-x 1 root postdrop 479475 Mar 19 17:14 /usr/sbin/postdrop
> 
>    The process egid changes and this seems to be problematic to access
>    /proc/self/net/if_inet6. :)
> 
> I've attached a tiny test program that can be used to reproduce the problem
> without Postfix.
> - Either execute it as root and give it an unprivileged uid in argument
>   ./test-proc_net_if_inet6 1001
> 
> - Or change its ownership and access mode to: -rwxr-sr-x root postdrop
>   and execute it as a lambda user.
>    chown root:postdrop test-proc_net_if_inet6; chmod 2755 test-proc_net_if_inet6
>    ./test-proc_net_if_inet6
> 
> I've found the cause but not the fix. :)
> (Adding Pavel in cc:)
> 

Thanks for that - most useful.

Although this is advertised as a 2.6.25-rc5-mm1 problem, I assume the
regression is also in mainline? 2.6.25-rc6?


  reply	other threads:[~2008-03-19 21:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080311011434.ad8c8d7d.akpm@linux-foundation.org>
     [not found] ` <20080311202300.GA8957@vino.hallyn.com>
     [not found]   ` <20080311133920.68dc410b.akpm@linux-foundation.org>
     [not found]     ` <64bb37e0803121233v30d12a58i77a1e23fd02ea6f2@mail.gmail.com>
2008-03-12 19:44       ` 2.6.25-rc5-mm1 Andrew Morton
2008-03-12 20:01         ` 2.6.25-rc5-mm1 Torsten Kaiser
2008-03-13 22:05           ` 2.6.25-rc5-mm1 Torsten Kaiser
2008-03-13 22:35             ` 2.6.25-rc5-mm1 Andrew Morton
2008-03-13 23:10               ` 2.6.25-rc5-mm1 Badari Pulavarty
2008-03-21 12:12                 ` 2.6.25-rc5-mm1 Ingo Molnar
2008-03-13 19:48 ` [2.6.25-rc5-mm1] regression: cannot run Postfix sendmail command as non-root Tilman Schmidt
2008-03-13 22:21   ` Daniel Lezcano
2008-03-14  0:08     ` Tilman Schmidt
2008-03-17 10:44       ` Daniel Lezcano
2008-03-17 12:50         ` Benjamin Thery
2008-03-17 13:35           ` Tilman Schmidt
2008-03-17 13:06         ` Tilman Schmidt
2008-03-17 13:17           ` Daniel Lezcano
2008-03-19 17:52   ` Benjamin Thery
2008-03-19 21:16     ` Andrew Morton [this message]
2008-03-19 22:14       ` Benjamin Thery
2008-03-19 22:49       ` David Miller
2008-03-20  8:26         ` Benjamin Thery
2008-03-20 10:21           ` Rafael J. Wysocki
2008-03-20 12:52             ` Pavel Emelyanov
2008-03-20 13:48               ` Benjamin Thery
2008-03-20 14:38                 ` Rafael J. Wysocki
2008-03-19 23:31       ` Tilman Schmidt

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=20080319141608.ede86a86.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ben.thery@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dlezcano@fr.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pekkas@netcore.fi \
    --cc=rjw@sisk.pl \
    --cc=tilman@imap.cc \
    --cc=xemul@openvz.org \
    --cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).