mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	Markus Trippelsdorf <markus@trippelsdorf.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result
Date: Sun, 8 Jul 2007 11:40:48 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707081138320.31544@woody.linux-foundation.org> (raw)
In-Reply-To: <46912BF5.8080201@redhat.com>



On Sun, 8 Jul 2007, Ulrich Drepper wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Linus Torvalds wrote:
> > notify_change() does *not* do permission checks for 
> > ATTR_CTIME/MTIME/ATIME.
> 
> Then I don't understand
> 
>         /* Check for setting the inode time. */
>         if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) {
>                 if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
>                         goto error;
>         }
> 
> in inode_change_ok.  This seems to me exactly like the check needed.

No it's not. It really allows only the _owner_ to change MTIME/ATIME.

And the thing is, other people _can_ change MTIME/ATIME, but only to the 
current time!

This is why ATTR_MTIME_SET ("set it to a _specific_ time") is so different 
from ATTR_MTIME ("set it to the _current_ time").

The former is for times() with times != NULL, and is strictly limited to 
only the owner (or root).

The latter is a "anybody who can change the inode can implicitly also 
change the inode timestamps, but only to the _current_ time".

In other words, the ATTR_A/MTIME_SET thing allows people to _lie_ about 
the time, and only the owner is allowed to do that. Which is why they are 
very different.

		Linus

  parent reply	other threads:[~2007-07-08 18:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  5:14 2.6.22-rc6-mm1-cfs-v19 Unable to handle kernel NULL pointer dereference (reproducable) Markus Trippelsdorf
2007-07-08  8:20 ` Andrew Morton
2007-07-08 10:09   ` Markus Trippelsdorf
2007-07-08 15:28     ` 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result Markus Trippelsdorf
2007-07-08 17:02       ` Linus Torvalds
2007-07-08 17:06       ` Ulrich Drepper
2007-07-08 17:33         ` Markus Trippelsdorf
2007-07-08 17:34         ` Al Viro
2007-07-08 17:41           ` Ulrich Drepper
2007-07-08 18:12             ` Linus Torvalds
2007-07-08 18:24               ` Ulrich Drepper
2007-07-08 18:31                 ` Al Viro
2007-07-08 18:40                 ` Linus Torvalds [this message]
2007-07-08 18:30               ` Linus Torvalds
2007-07-08 18:34                 ` Al Viro
2007-07-08 18:38                 ` Linus Torvalds
2007-07-08 18:51                   ` Al Viro
2007-07-08 19:00                     ` Linus Torvalds
2007-07-08 19:26                       ` Al Viro
2007-07-08 18:19             ` Al Viro
2007-07-09 12:40 ` 2.6.22-rc6-mm1-cfs-v19 Unable to handle kernel NULL pointer dereference (reproducable) Lenar Lõhmus

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=alpine.LFD.0.999.0707081138320.31544@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=viro@ftp.linux.org.uk \
    /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®