lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1skca2vi3.fsf@fess.ebiederm.org>
Date:	Thu, 19 Nov 2009 10:57:08 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Jeff Layton <jlayton@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	pavel@....cz
Subject: Re: [PATCH] procfs: make /proc style symlinks behave like "normal" symlinks

Jeff Layton <jlayton@...hat.com> writes:

> On Thu, 19 Nov 2009 09:07:16 -0800
> ebiederm@...ssion.com (Eric W. Biederman) wrote:
>
>> 
>> Nacked-by: "Eric W. Biederman" <ebiederm@...ssion.com>
>> 
>> This is broken.  If the referenced file is in a different mount namespace
>> the path returned could point to a completely different path in your
>> own mount namespace.  Even in your own mount namespace this makes the
>> proc symlinks racy and not guaranteed to return the file of interest.
>> 
>> I don't see any hope of this approach ever working.
>> 
>> Eric
>> 
>
> Then is proc_pid_readlink broken in the same way?

proc_pid_readlink has the same deficiencies.  The race is fundamental
to all readlink operations, the difference is that for normal symlinks
it is a don't care, and for proc it is incorrect behavior if you follow
the symlink to the wrong file.   If you are dealing with a file in a
different namespace or a socket what you get back doesn't actually
work as a file in your local namespace but that is the best we can do
with a pathname, and if you know the context of what is going on readlink
is still useful.

Adding all of the short comings to followlink that readlink has is a problem,
especially as followlink does much better now.

At a practical level I think your changes are much easier to exploit than
Pavels contrived example.

I really don't have any problems with your first patch to proc to add the
missing revalidate.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ