mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: NiTRo <nitroml@ntd.homelinux.org>,
	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: Fri, 23 Oct 2009 22:54:18 +0200	[thread overview]
Message-ID: <20091023205418.GF27185@elf.ucw.cz> (raw)
In-Reply-To: <20091023204442.GA7332@joi.lan>

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.

> > 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-10-23 20:55 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 [this message]
2009-10-23 22:42     ` NiTRo
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=20091023205418.GF27185@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=cve@mitre.org \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=nitroml@ntd.homelinux.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

all inboxes | Powered by JetHome®