From: Al Viro <viro@ftp.linux.org.uk>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org
Subject: Re: 2.6.22-rc6(mm1) Unable to handle kernel NULL pointer dereference - git-bisect result
Date: Sun, 8 Jul 2007 19:19:54 +0100 [thread overview]
Message-ID: <20070708181954.GH21668@ftp.linux.org.uk> (raw)
In-Reply-To: <469121DA.6030600@redhat.com>
On Sun, Jul 08, 2007 at 10:41:46AM -0700, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Al Viro wrote:
> > Like hell. At the very least you want it to be opened for write.
> > And even that is dubious, since "process has write access to file"
> > is not quite the same thing as "somebody had given the process a
> > descriptor opened for write".
>
> But the real permissions tests are performed in notify_change. I think
> all this is consistent with how, for instance, fchmod works. The
> additional tests in fchmod which aren't here (IS_RDONLY and IS_APPEND)
> would also apply to the case where a file name is given. So, either the
> code was inconsistent already are these tests are really not needed.
Yes, it's either that, or you haven't bothered to read what it really
does. ATTR_UID et.al. are checked in inode_change_ok(). So is
ATTR_MTIME_SET (only owner can explicitly set timestamps). ATTR_MTIME
is not and *should* *not* be checked there. Exactly because it's
done as a side effect of many operations with access control of their
own and nothing that could be pushed down into notify_change() path.
Think of e.g. write(2) - by the time you get to notify_change(), you
don't even have a file descriptor. Just the dentry and process writing
to file doesn't have to have *any* permissions on it.
Hell, _try_ it. Build the kernel with your patch and without it.
Call utimes() with NULL second argument on a file you have no write
access to. See if the timestamps change.
next prev parent reply other threads:[~2007-07-08 18:20 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
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 [this message]
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=20070708181954.GH21668@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markus@trippelsdorf.de \
--cc=torvalds@linux-foundation.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