From: Cesar Eduardo Barros <cesarb@nitnet.com.br>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: linux-kernel@vger.kernel.org, Alexander Viro <viro@math.psu.edu>
Subject: Re: [PATCH] O_NOATIME support
Date: Mon, 14 Jun 2004 19:40:06 -0300 [thread overview]
Message-ID: <20040614224006.GD1961@flower.home.cesarb.net> (raw)
In-Reply-To: <orpt81sv1g.fsf@free.redhat.lsd.ic.unicamp.br>
On Mon, Jun 14, 2004 at 06:12:59PM -0300, Alexandre Oliva wrote:
> On Jun 11, 2004, Cesar Eduardo Barros <cesarb@nitnet.com.br> wrote:
>
> > int O_NOATIME Macro
> > If this bit is set, read will not update the access time of the file.
> > See File Times. This is used by programs that do backups, so that
> > backing a file up does not count as reading it. Only the owner of the
> > file or the superuser may use this bit.
>
> IMHO it's a bad idea to enable the owner of the file to avoid changing
> the atime of their files. I've heard more than once about the atime
> bit being used to as proof that a user had actually seen the contents
> of a file although s/he claimed s/he hadn't. If it was root-only,
> atime could still be used for the same purpose, and would enable
> backups with tools that accessed the filesystem through the FS layer,
> as opposed to though the block layer, to keep such proof unchanged.
I'm not the one who invented O_NOATIME; it's the GNU people, and so I
wanted to avoid diverging from their description (the text you quoted
above is from the glibc manual).
The semantics of O_NOATIME are the same as using utimes or variants, and
utimes has the same security restriction (only the file owner or the
superuser). The only thing O_NOATIME gains is the absence of a race
condition where another program can read the file without it being noted
in the atime.
I believe the Unix philosophy is that a user can do anything with the
files he owns, with the exception that root can do anything with any
file. This is why various functions (chown, chmod, etc) check if
current->fsuid equals inode->i_uid or CAP_FOWNER is set.
If you want to use the atime as proof of wrongdoing, you probably want a
root-only O_NOATIME to avoid checksummers and backup daemons creating a
race condition due to their restoring of the old atime; however, I fail
to see how can reading a file you own would be wrongdoing. If the file
isn't yours, you can't use O_NOATIME (you get -EPERM). So, a user
ignoring atime updates on his own files is no big deal.
And finally, nothing prevents a user from running his own backup
programs/checksummers/storage managers, which would benefit from
O_NOATIME.
The atime was never intended as an auditing feature (if it were, utimes
and related functions would be root only).
--
Cesar Eduardo Barros
cesarb@nitnet.com.br
cesarb@dcc.ufrj.br
next prev parent reply other threads:[~2004-06-14 22:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-12 1:11 Cesar Eduardo Barros
2004-06-12 16:44 ` Bernd Eckenfels
2004-06-12 18:09 ` Chris Wedgwood
2004-06-12 18:22 ` Bernd Eckenfels
2004-06-14 9:55 ` Christoph Hellwig
2004-06-14 13:46 ` Cesar Eduardo Barros
2004-06-14 14:03 ` Christoph Hellwig
2004-06-14 19:25 ` Cesar Eduardo Barros
2004-06-14 16:57 ` David Lang
2004-06-14 19:34 ` Cesar Eduardo Barros
2004-06-14 15:38 ` Paul Jackson
2004-06-14 21:12 ` Alexandre Oliva
2004-06-14 21:58 ` Valdis.Kletnieks
2004-06-14 22:09 ` Matthias Schniedermeyer
2004-06-15 19:02 ` Alexandre Oliva
2004-06-16 1:49 ` Horst von Brand
2004-06-14 22:40 ` Cesar Eduardo Barros [this message]
2004-06-14 23:14 ` Bernd Eckenfels
2004-06-15 19:01 ` Alexandre Oliva
2004-06-15 19:32 ` Matthias Schniedermeyer
2004-06-15 22:03 ` Paul Jackson
2004-06-16 6:21 ` Matthias Schniedermeyer
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=20040614224006.GD1961@flower.home.cesarb.net \
--to=cesarb@nitnet.com.br \
--cc=aoliva@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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®