mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NiTRo <nitroml@ntd.homelinux.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>,
	linux-kernel@vger.kernel.org, cve@mitre.org,
	Jamie Lokier <jamie@shareable.org>
Subject: Re: SECURITY PROBLEM: filesystem permiossion bypass on FD already opened
Date: Sat, 24 Oct 2009 00:42:03 +0200	[thread overview]
Message-ID: <4AE2313B.3020901@ntd.homelinux.org> (raw)
In-Reply-To: <20091023205418.GF27185@elf.ucw.cz>

Pavel Machek ha scritto:
> On Fri 2009-10-23 22:44:44, Marcin Slusarz wrote:
>   
>> On Fri, Oct 23, 2009 at 10:00:47PM +0200, NiTRo wrote:
>>     
>>> Hi to all,
>>>     Sorry for my bad english.
>>>     Just discovered this security problem on my Suse 11 (Linux xxxx
>>>       
>> You did not.
>> http://lkml.org/lkml/2009/10/23/159
>>     
>
> Actually, no, this is something different... and old/known AFAICT.
>   
Marcin, I just saw this, it's quite similar, right... But I don't fall back to /proc/self/fd for reading... I still use the same FD...

>   
>>> 2.6.25.18-0.2-pae #1 SMP 2008-10-21 16:30:26 +0200 i686 i686 i386
>>> GNU/Linux) and my Slackware 10.1.0 (Linux xxxx 2.4.29-ow1 #1 Wed Feb 2
>>> 00:05:42 CET 2005 i586 unknown unknown GNU/Linux) with OpenWall patch.
>>> If a FD is opened on a allowed file and then the permission is changed
>>> the file is still redeable starting from the already read position to
>>> the EOF.
>>>
>>> This is the scenario:
>>>
>>> <root> creates a file /tmp/aaaa with 666 permission an with the "test"
>>> string inside it
>>>         xxx:/tmp # echo test > /tmp/aaaa
>>>         xxx:/tmp # chmod 666 /tmp/aaaa
>>> <sb> opens this file hooking it in a shell as FD number 3
>>>         sb@xxx:~> bash 3< /tmp/aaaa
>>> <sb> read and prints it
>>>         sb@xxx:~> read a <&3
>>>         sb@xxx:~> echo $a
>>>         test
>>>         sb@xxx:~>
>>> ...anythig as expected...
>>> <root> changes the permissions on file to 600 and changes its content
>>> into "test o.o I cannot believe it..."
>>>         xxx:/tmp # chmod 600 /tmp/aaaa
>>>         xxx:/tmp # echo "test o.o I cannot believe it..." > /tmp/aaaa
>>> <sb> continue to try reading the file
>>>         sb@xxx:~> read a <&3
>>>         sb@xxx:~> echo $a
>>>         o.o I cannot believe it...
>>>         sb@test:~>
>>> ... and this is not expected...
>>>       
>
>
> Really? I'd expect it. I have file open for reading, you wrote
> something new to it, so I can read it back. What is the problem?
> 									Pavel
>   

I sow the second mail to... Shurely you have right... I'm sorry for this
"no-bug"...
I'd expect a read error due to permissions change... Sorry

Thanks a lot
Alessandro

  reply	other threads:[~2009-10-23 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 20:00 NiTRo
2009-10-23 20:44 ` Marcin Slusarz
2009-10-23 20:54   ` Pavel Machek
2009-10-23 22:42     ` NiTRo [this message]
2009-10-23 20:59 ` Pavel Machek
2009-10-23 22:55 ` David Wagner
2009-10-25  6:30   ` Pavel Machek

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=4AE2313B.3020901@ntd.homelinux.org \
    --to=nitroml@ntd.homelinux.org \
    --cc=cve@mitre.org \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=pavel@ucw.cz \
    /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

all inboxes | Powered by JetHome®