Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread David Newall
Bill Davidsen wrote: It seems there are (at least) two parts to this, one regarding changing working directory which is clearly stated in the standards and must work as it does, and the various issues regarding getting out of the chroot after the cwd has entered that changed root. That second

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Bill Davidsen
Theodore Tso wrote: On Thu, Sep 27, 2007 at 09:28:08AM +0200, Christer Weinigel wrote: So the OpenBSD man page seems to be in the minority here. Any portable code can not assume that CWD changes. And changing the Linux behaviour now would be a rather big change which might break userspace.

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Theodore Tso
On Thu, Sep 27, 2007 at 09:28:08AM +0200, Christer Weinigel wrote: > So the OpenBSD man page seems to be in the minority here. Any portable > code can not assume that CWD changes. And changing the Linux behaviour > now would be a rather big change which might break userspace. And yes, > there

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Christer Weinigel
On Thu, 27 Sep 2007 06:49:28 +0930 David Newall <[EMAIL PROTECTED]> wrote: > For sure, "a root user can get out of a chroot a million different > ways." Young Alan said as much at the beginning of this > conversation, and I have always agreed. I don't hope to secure Linux > within chroot,

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 04:12:53PM +0930, David Newall wrote: > Adrian Bunk wrote: >> You claimed: >> >> <-- snip --> >> >> Look, when chroot was being designed, I think they intended that even root >> should be unable to get out. They went so far as to say that dot-dot >> wouldn't let you

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread David Newall
Adrian Bunk wrote: You claimed: <-- snip --> Look, when chroot was being designed, I think they intended that even root should be unable to get out. They went so far as to say that dot-dot wouldn't let you out; and it doesn't. <-- snip --> You were clearly saying that whom you call

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread David Newall
Adrian Bunk wrote: You claimed: -- snip -- Look, when chroot was being designed, I think they intended that even root should be unable to get out. They went so far as to say that dot-dot wouldn't let you out; and it doesn't. -- snip -- You were clearly saying that whom you call they

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 04:12:53PM +0930, David Newall wrote: Adrian Bunk wrote: You claimed: -- snip -- Look, when chroot was being designed, I think they intended that even root should be unable to get out. They went so far as to say that dot-dot wouldn't let you out; and it doesn't.

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Christer Weinigel
On Thu, 27 Sep 2007 06:49:28 +0930 David Newall [EMAIL PROTECTED] wrote: For sure, a root user can get out of a chroot a million different ways. Young Alan said as much at the beginning of this conversation, and I have always agreed. I don't hope to secure Linux within chroot, simply to

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Theodore Tso
On Thu, Sep 27, 2007 at 09:28:08AM +0200, Christer Weinigel wrote: So the OpenBSD man page seems to be in the minority here. Any portable code can not assume that CWD changes. And changing the Linux behaviour now would be a rather big change which might break userspace. And yes, there are

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread Bill Davidsen
Theodore Tso wrote: On Thu, Sep 27, 2007 at 09:28:08AM +0200, Christer Weinigel wrote: So the OpenBSD man page seems to be in the minority here. Any portable code can not assume that CWD changes. And changing the Linux behaviour now would be a rather big change which might break userspace.

Re: sys_chroot+sys_fchdir Fix

2007-09-27 Thread David Newall
Bill Davidsen wrote: It seems there are (at least) two parts to this, one regarding changing working directory which is clearly stated in the standards and must work as it does, and the various issues regarding getting out of the chroot after the cwd has entered that changed root. That second

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Al Viro
On Thu, Sep 27, 2007 at 02:01:37AM +0200, Adrian Bunk wrote: > <-- snip --> > > Look, when chroot was being designed, I think they intended that even root > should be unable to get out. They went so far as to say that dot-dot > wouldn't let you out; and it doesn't. > > <-- snip --> > >

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 09:05:33AM +0930, David Newall wrote: > Adrian Bunk wrote: >> You are claiming "They went so far as to say that dot-dot wouldn't let you >> out"? >> > > I phrased it in a somewhat conversational way. The promise, which I've now > quoted from multiple sources, is

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Adrian Bunk wrote: You are claiming "They went so far as to say that dot-dot wouldn't let you out"? I phrased it in a somewhat conversational way. The promise, which I've now quoted from multiple sources, is expressed variously, including: The dot-dot entry in the root directory is

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 06:49:28AM +0930, David Newall wrote: >... > Look, when chroot was being designed, I think they intended that even root > should be unable to get out. They went so far as to say that dot-dot > wouldn't let you out; and it doesn't. >... You are claiming "They went so far

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Christer Weinigel wrote: *spends five minutes with Google* From the OpenBSD FAQ (an operating system most know for being really, really focused on security): http://www.openbsd.org/faq/faq10.html Any application which has to assume root privileges to operate is pointless to

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Christer Weinigel
On Wed, 26 Sep 2007 20:04:14 +0930 David Newall <[EMAIL PROTECTED]> wrote: > Al Viro wrote: > > Oh, for fsck sake... Folks, it's standard-required behaviour. > > Ability to chroot() implies the ability to break out of it. Could > > we please add that (along with reference to SuS) to l-k FAQ and

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-26 Thread Bodo Eggert
On Wed, 26 Sep 2007, David Newall wrote: > Miloslav Semler pointed out that a root process can chdir("..") out of > its chroot. Although this is documented in the man page, it conflicts > with the essential function, which is to change the root directory of > the process. The root directory,

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Al Viro
On Wed, Sep 26, 2007 at 08:04:14PM +0930, David Newall wrote: > Al Viro wrote: > >Oh, for fsck sake... Folks, it's standard-required behaviour. Ability > >to chroot() implies the ability to break out of it. Could we please > >add that (along with reference to SuS) to l-k FAQ and be done with

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: ** Plonk ** Welcome to my killfile. Well that's a relief. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
** Plonk ** Welcome to my killfile. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: You quoted the standard, I merely pointed out you forgot to read it properly. Thats your problem not mine. How bizarre. Last email you claimed to quote the standards (but you never did.) Your becoming an embarrassment. You were rude, and multiple times. Please just

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
You quoted the standard, I merely pointed out you forgot to read it properly. Thats your problem not mine. Alan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan, Alan Cox wrote: therefore it must be right. You present no reasoning to explain why the behavior is correct; instead you use insults. I've exhausted my tolerance for rudeness. Well if citing standards documents at people is rudeness so be it. Did you just tell a porky? Did

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Chris Adams
Once upon a time, Alan Cox <[EMAIL PROTECTED]> said: >Well if citing standards documents at people is rudeness so be it. I hate to get involved in this, but actually chroot() is no longer part of SuS as of version 3. For other Unix versions, both Tru64 (5.1B) and Solaris (9) chroot(2) man pages

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
> therefore it must be right. You present no reasoning to explain why the > behavior is correct; instead you use insults. I've exhausted my > tolerance for rudeness. Well if citing standards documents at people is rudeness so be it. Alan - To unsubscribe from this list: send the line

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: Now see I've been working on Unix systems since 1988 or so and in that time I've learned to read the documentation properly (you haven't) My, my, you can be unpleasant when you try. There's no need for it. As it happens I have years of UNIX experience on you. (Newbie!)

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
> I've made no error. The documentation says what it says, and what it > doesn't say, other than for Linux, is that there is an unspecified way > of breaking out. Now see I've been working on Unix systems since 1988 or so and in that time I've learned to read the documentation properly (you

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: On Wed, 26 Sep 2007 20:04:14 +0930 David Newall <[EMAIL PROTECTED]> wrote: Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS)

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
On Wed, 26 Sep 2007 20:04:14 +0930 David Newall <[EMAIL PROTECTED]> wrote: > Al Viro wrote: > > Oh, for fsck sake... Folks, it's standard-required behaviour. Ability > > to chroot() implies the ability to break out of it. Could we please > > add that (along with reference to SuS) to l-k FAQ

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to l-k FAQ and be done with that nonsense? I'm pretty confident that it's only standard behavior

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Nick Craig-Wood
Al Viro <[EMAIL PROTECTED]> wrote: > If you are within chroot jail and capable of chroot(), you can chdir to > its root, then chroot() to subdirectory and you've got cwd outside of > your new root. After that you can chdir all way out to original > root. Here is some code I wrote a while

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Nick Craig-Wood
Al Viro [EMAIL PROTECTED] wrote: If you are within chroot jail and capable of chroot(), you can chdir to its root, then chroot() to subdirectory and you've got cwd outside of your new root. After that you can chdir all way out to original root. Here is some code I wrote a while back to

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to l-k FAQ and be done with that nonsense? I'm pretty confident that it's only standard behavior

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
On Wed, 26 Sep 2007 20:04:14 +0930 David Newall [EMAIL PROTECTED] wrote: Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to l-k FAQ and be done

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: On Wed, 26 Sep 2007 20:04:14 +0930 David Newall [EMAIL PROTECTED] wrote: Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
I've made no error. The documentation says what it says, and what it doesn't say, other than for Linux, is that there is an unspecified way of breaking out. Now see I've been working on Unix systems since 1988 or so and in that time I've learned to read the documentation properly (you

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: Now see I've been working on Unix systems since 1988 or so and in that time I've learned to read the documentation properly (you haven't) My, my, you can be unpleasant when you try. There's no need for it. As it happens I have years of UNIX experience on you. (Newbie!)

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
therefore it must be right. You present no reasoning to explain why the behavior is correct; instead you use insults. I've exhausted my tolerance for rudeness. Well if citing standards documents at people is rudeness so be it. Alan - To unsubscribe from this list: send the line

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Chris Adams
Once upon a time, Alan Cox [EMAIL PROTECTED] said: Well if citing standards documents at people is rudeness so be it. I hate to get involved in this, but actually chroot() is no longer part of SuS as of version 3. For other Unix versions, both Tru64 (5.1B) and Solaris (9) chroot(2) man pages

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan, Alan Cox wrote: therefore it must be right. You present no reasoning to explain why the behavior is correct; instead you use insults. I've exhausted my tolerance for rudeness. Well if citing standards documents at people is rudeness so be it. Did you just tell a porky? Did

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
You quoted the standard, I merely pointed out you forgot to read it properly. Thats your problem not mine. Alan - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: You quoted the standard, I merely pointed out you forgot to read it properly. Thats your problem not mine. How bizarre. Last email you claimed to quote the standards (but you never did.) Your becoming an embarrassment. You were rude, and multiple times. Please just

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Alan Cox
** Plonk ** Welcome to my killfile. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Alan Cox wrote: ** Plonk ** Welcome to my killfile. Well that's a relief. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Al Viro
On Wed, Sep 26, 2007 at 08:04:14PM +0930, David Newall wrote: Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to l-k FAQ and be done with that

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-26 Thread Bodo Eggert
On Wed, 26 Sep 2007, David Newall wrote: Miloslav Semler pointed out that a root process can chdir(..) out of its chroot. Although this is documented in the man page, it conflicts with the essential function, which is to change the root directory of the process. The root directory, '/'

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Christer Weinigel
On Wed, 26 Sep 2007 20:04:14 +0930 David Newall [EMAIL PROTECTED] wrote: Al Viro wrote: Oh, for fsck sake... Folks, it's standard-required behaviour. Ability to chroot() implies the ability to break out of it. Could we please add that (along with reference to SuS) to l-k FAQ and be

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Christer Weinigel wrote: *spends five minutes with Google* From the OpenBSD FAQ (an operating system most know for being really, really focused on security): http://www.openbsd.org/faq/faq10.html Any application which has to assume root privileges to operate is pointless to

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 06:49:28AM +0930, David Newall wrote: ... Look, when chroot was being designed, I think they intended that even root should be unable to get out. They went so far as to say that dot-dot wouldn't let you out; and it doesn't. ... You are claiming They went so far as to

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread David Newall
Adrian Bunk wrote: You are claiming They went so far as to say that dot-dot wouldn't let you out? I phrased it in a somewhat conversational way. The promise, which I've now quoted from multiple sources, is expressed variously, including: The dot-dot entry in the root directory is

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Adrian Bunk
On Thu, Sep 27, 2007 at 09:05:33AM +0930, David Newall wrote: Adrian Bunk wrote: You are claiming They went so far as to say that dot-dot wouldn't let you out? I phrased it in a somewhat conversational way. The promise, which I've now quoted from multiple sources, is expressed

Re: sys_chroot+sys_fchdir Fix

2007-09-26 Thread Al Viro
On Thu, Sep 27, 2007 at 02:01:37AM +0200, Adrian Bunk wrote: -- snip -- Look, when chroot was being designed, I think they intended that even root should be unable to get out. They went so far as to say that dot-dot wouldn't let you out; and it doesn't. -- snip -- You were

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Al Viro
On Tue, Sep 25, 2007 at 04:53:00PM -0400, Phillip Susi wrote: > Alan Cox wrote: > >On Fri, 21 Sep 2007 13:39:34 -0400 > >Phillip Susi <[EMAIL PROTECTED]> wrote: > > > >>David Newall wrote: > >>>* In particular, the superuser can escape from a =91chroot jail=92 by d= > >>>oing=20 > >>>=91mkdir foo;

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Phillip Susi
Alan Cox wrote: On Fri, 21 Sep 2007 13:39:34 -0400 Phillip Susi <[EMAIL PROTECTED]> wrote: David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92. No, he can not. The superuser can escape that way - its

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Adrian Bunk
On Wed, Sep 26, 2007 at 12:40:27AM +0930, David Newall wrote: > Miloslav Semler pointed out that a root process can chdir("..") out of its > chroot. Although this is documented in the man page, it conflicts with the > essential function, which is to change the root directory of the process.

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Alan Cox
> Marek's loading dynamic libraries, it seems clear that the prime purpose > of chroot is to aid security. Being able to cd your way out is handy Does it - I can't find any evidence for that. I think you are confusing containers and chroot. They are quite different things. A root user can get

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Jan Engelhardt
On Sep 26 2007 00:40, David Newall wrote: > > Miloslav Semler pointed out that a root process can chdir("..") out of its > chroot. Although this is documented in the man page, it conflicts with the > essential function, which is to change the root directory of the process. In > addition to any

Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread David Newall
Miloslav Semler pointed out that a root process can chdir("..") out of its chroot. Although this is documented in the man page, it conflicts with the essential function, which is to change the root directory of the process. In addition to any creative uses, for example Philipp Marek's

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread David Newall
Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): It might be tidy if pivot_root could be used (instead of a hack based on a chroot bug), but it'd still be unportable. It can.

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): > Serge E. Hallyn wrote: >> Quoting David Newall ([EMAIL PROTECTED]): >> >>> It might be tidy if pivot_root could be used (instead of a hack based on >>> a chroot bug), but it'd still be unportable. >>> >> >> It can. >> >> Please re-read my

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread David Newall
Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): It might be tidy if pivot_root could be used (instead of a hack based on a chroot bug), but it'd still be unportable. It can. Please re-read my previous msg. I read it. Currently pivot_root can't be used to affect a

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread David Newall
Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): It might be tidy if pivot_root could be used (instead of a hack based on a chroot bug), but it'd still be unportable. It can. Please re-read my previous msg. I read it. Currently pivot_root can't be used to affect a

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): It might be tidy if pivot_root could be used (instead of a hack based on a chroot bug), but it'd still be unportable. It can. Please re-read my previous msg. I read it.

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread David Newall
Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): Serge E. Hallyn wrote: Quoting David Newall ([EMAIL PROTECTED]): It might be tidy if pivot_root could be used (instead of a hack based on a chroot bug), but it'd still be unportable. It can.

Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread David Newall
Miloslav Semler pointed out that a root process can chdir(..) out of its chroot. Although this is documented in the man page, it conflicts with the essential function, which is to change the root directory of the process. In addition to any creative uses, for example Philipp Marek's loading

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Jan Engelhardt
On Sep 26 2007 00:40, David Newall wrote: Miloslav Semler pointed out that a root process can chdir(..) out of its chroot. Although this is documented in the man page, it conflicts with the essential function, which is to change the root directory of the process. In addition to any

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Alan Cox
Marek's loading dynamic libraries, it seems clear that the prime purpose of chroot is to aid security. Being able to cd your way out is handy Does it - I can't find any evidence for that. I think you are confusing containers and chroot. They are quite different things. A root user can get

Re: Chroot bug (was: sys_chroot+sys_fchdir Fix)

2007-09-25 Thread Adrian Bunk
On Wed, Sep 26, 2007 at 12:40:27AM +0930, David Newall wrote: Miloslav Semler pointed out that a root process can chdir(..) out of its chroot. Although this is documented in the man page, it conflicts with the essential function, which is to change the root directory of the process. In

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Phillip Susi
Alan Cox wrote: On Fri, 21 Sep 2007 13:39:34 -0400 Phillip Susi [EMAIL PROTECTED] wrote: David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92. No, he can not. The superuser can escape that way - its expected

Re: sys_chroot+sys_fchdir Fix

2007-09-25 Thread Al Viro
On Tue, Sep 25, 2007 at 04:53:00PM -0400, Phillip Susi wrote: Alan Cox wrote: On Fri, 21 Sep 2007 13:39:34 -0400 Phillip Susi [EMAIL PROTECTED] wrote: David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92.

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): > Serge E. Hallyn wrote: >> No reason for any new parameters to pivot_root. Just clone your mounts >> namespace first. >> >> unshare(CLONE_NEWNS); >> chdir(new_dir); >> pivot_root(new_dir, oldroot); >> >> Since pivot_root actually fiddles

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): > Serge E. Hallyn wrote: >> No reason for any new parameters to pivot_root. Just clone your mounts >> namespace first. >> >> unshare(CLONE_NEWNS); >> chdir(new_dir); >> pivot_root(new_dir, oldroot); >> >> Since pivot_root actually fiddles

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread David Newall
Serge E. Hallyn wrote: No reason for any new parameters to pivot_root. Just clone your mounts namespace first. unshare(CLONE_NEWNS); chdir(new_dir); pivot_root(new_dir, oldroot); Since pivot_root actually fiddles with the vfsmnts, this is really the only way to go

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): > Bill Davidsen wrote: >> there is no question that pivot_root is intended to have breadth for more >> than one process. > > I think it's clear from the man page that the original idea was to be able > to pivot_root for individual processes. The reason

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): Bill Davidsen wrote: there is no question that pivot_root is intended to have breadth for more than one process. I think it's clear from the man page that the original idea was to be able to pivot_root for individual processes. The reason it

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread David Newall
Serge E. Hallyn wrote: No reason for any new parameters to pivot_root. Just clone your mounts namespace first. unshare(CLONE_NEWNS); chdir(new_dir); pivot_root(new_dir, oldroot); Since pivot_root actually fiddles with the vfsmnts, this is really the only way to go

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): Serge E. Hallyn wrote: No reason for any new parameters to pivot_root. Just clone your mounts namespace first. unshare(CLONE_NEWNS); chdir(new_dir); pivot_root(new_dir, oldroot); Since pivot_root actually fiddles with the vfsmnts,

Re: sys_chroot+sys_fchdir Fix

2007-09-24 Thread Serge E. Hallyn
Quoting David Newall ([EMAIL PROTECTED]): Serge E. Hallyn wrote: No reason for any new parameters to pivot_root. Just clone your mounts namespace first. unshare(CLONE_NEWNS); chdir(new_dir); pivot_root(new_dir, oldroot); Since pivot_root actually fiddles with the vfsmnts,

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread Alan Cox
On Fri, 21 Sep 2007 13:39:34 -0400 Phillip Susi <[EMAIL PROTECTED]> wrote: > David Newall wrote: > > * In particular, the superuser can escape from a =91chroot jail=92 by d= > > oing=20 > > =91mkdir foo; chroot foo; cd ..=92. > > No, he can not. The superuser can escape that way - its expected

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread Phillip Susi
David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92. No, he can not. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread David Newall
Bill Davidsen wrote: there is no question that pivot_root is intended to have breadth for more than one process. I think it's clear from the man page that the original idea was to be able to pivot_root for individual processes. The reason it doesn't do that, the reason it affects all

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread David Newall
Bill Davidsen wrote: there is no question that pivot_root is intended to have breadth for more than one process. I think it's clear from the man page that the original idea was to be able to pivot_root for individual processes. The reason it doesn't do that, the reason it affects all

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread Phillip Susi
David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92. No, he can not. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: sys_chroot+sys_fchdir Fix

2007-09-21 Thread Alan Cox
On Fri, 21 Sep 2007 13:39:34 -0400 Phillip Susi [EMAIL PROTECTED] wrote: David Newall wrote: * In particular, the superuser can escape from a =91chroot jail=92 by d= oing=20 =91mkdir foo; chroot foo; cd ..=92. No, he can not. The superuser can escape that way - its expected and fine

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Bill Davidsen
David Newall wrote: Philipp Marek wrote: AFAIK pivot_root() changes the / mapping for *all* processes, no? The manual page is confusing. It even admits to being "intentionally vague". However the goal seems clear: "pivot_root() moves the root file system of the current process to

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread David Newall
Philipp Marek wrote: AFAIK pivot_root() changes the / mapping for *all* processes, no? The manual page is confusing. It even admits to being "intentionally vague". However the goal seems clear: "pivot_root() moves the root file system of the current process to the directory

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Philipp Marek
On Thursday 20 September 2007 David Newall wrote: > Philipp Marek wrote: > > - User starts a small wrapper, > > - that opens "/", > > - chroot()s into a directory and starts fsvs. > > - fsvs gets its libraries loaded > > - and chroot()s back to the original system. > > Isn't that what pivot_root

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread David Newall
Philipp Marek wrote: - User starts a small wrapper, - that opens "/", - chroot()s into a directory and starts fsvs. - fsvs gets its libraries loaded - and chroot()s back to the original system. Isn't that what pivot_root was meant for? - To unsubscribe from this list: send the line

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread majkls
Philipp Marek napsal(a): Please, everybody, don't change that. I'm currently using that *feature* (yes, I see it as that) in my fsvs-chrooter-utility (see http://fsvs.tigris.org/source/browse/*checkout*/fsvs/trunk/www/doxygen/html/group__howto__chroot.html) for easier usage of fsvs on older

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Philipp Marek
Please, everybody, don't change that. I'm currently using that *feature* (yes, I see it as that) in my fsvs-chrooter-utility (see http://fsvs.tigris.org/source/browse/*checkout*/fsvs/trunk/www/doxygen/html/group__howto__chroot.html) for easier usage of fsvs on older systems. - User starts a

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Bodo Eggert
David Newall <[EMAIL PROTECTED]> wrote: >> Normal users cannot use chroot() themselves so they can't use chroot to >> get back out > > I think Bill is right, that this is to fix a method that non-root > processes can use to escape their chroot. The exploit, which is > documented in chroot(2)*,

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Bodo Eggert
David Newall [EMAIL PROTECTED] wrote: Normal users cannot use chroot() themselves so they can't use chroot to get back out I think Bill is right, that this is to fix a method that non-root processes can use to escape their chroot. The exploit, which is documented in chroot(2)*, is to

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Philipp Marek
Please, everybody, don't change that. I'm currently using that *feature* (yes, I see it as that) in my fsvs-chrooter-utility (see http://fsvs.tigris.org/source/browse/*checkout*/fsvs/trunk/www/doxygen/html/group__howto__chroot.html) for easier usage of fsvs on older systems. - User starts a

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread majkls
Philipp Marek napsal(a): Please, everybody, don't change that. I'm currently using that *feature* (yes, I see it as that) in my fsvs-chrooter-utility (see http://fsvs.tigris.org/source/browse/*checkout*/fsvs/trunk/www/doxygen/html/group__howto__chroot.html) for easier usage of fsvs on older

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread David Newall
Philipp Marek wrote: - User starts a small wrapper, - that opens /, - chroot()s into a directory and starts fsvs. - fsvs gets its libraries loaded - and chroot()s back to the original system. Isn't that what pivot_root was meant for? - To unsubscribe from this list: send the line unsubscribe

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Philipp Marek
On Thursday 20 September 2007 David Newall wrote: Philipp Marek wrote: - User starts a small wrapper, - that opens /, - chroot()s into a directory and starts fsvs. - fsvs gets its libraries loaded - and chroot()s back to the original system. Isn't that what pivot_root was meant for?

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread David Newall
Philipp Marek wrote: AFAIK pivot_root() changes the / mapping for *all* processes, no? The manual page is confusing. It even admits to being intentionally vague. However the goal seems clear: pivot_root() moves the root file system of the current process to the directory put_old

Re: sys_chroot+sys_fchdir Fix

2007-09-20 Thread Bill Davidsen
David Newall wrote: Philipp Marek wrote: AFAIK pivot_root() changes the / mapping for *all* processes, no? The manual page is confusing. It even admits to being intentionally vague. However the goal seems clear: pivot_root() moves the root file system of the current process to

  1   2   >