From: Pedro Fonseca <pfonseca@mpi-sws.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca
Subject: Re: Data races in ext4
Date: Fri, 11 Apr 2014 15:08:00 +0200 [thread overview]
Message-ID: <5347E930.1040601@mpi-sws.org> (raw)
In-Reply-To: <20140410220937.GC31614@thunk.org>
>> Regarding the generic_fillattr() function, apart from the inconsistency
>> between i_blocks/i_size, it looks like it can also cause wrong values to be
>> returned because several of those fields are 64 bits.
> Well, it's actually a 32-bit seconds and 32-bit nanoseconds field. So
> we could theoretically get a torn value, but if the ns field is from a
> previous update, the worst that could happen under those circumstances
> is that two quick successive stat() commands could potentially result
> in end up with an apparent "time moving backwards" in the nanoseconds
> field. If someone was constantly calling utimes(2) to modify the
> mtime/atime at high rate, that might cause a more serious wrong value,
> but that's an argument you should take up with the generic VFS folks
> as to whether it's important enough that they would want to care about
> it.
Note that the races in stat() also involve the "inode->i_blocks" field,
which is also 64-bits. So, as far as I understand, this field too can
get wrapped, although it should only affect very large files. (On the
other hand, the field inode->i_size seems to be protected.)
I'll follow your suggestion and let the VFS developers know about this.
> P.S. What did you use to generate these reports? Is it something
> that can be easily replicated by others?
We're currently developing an experimental tool to test the kernel for
concurrency bugs. It's not yet publicly available, but we hope it will
become available at some point in the future.
Thanks,
Pedro
prev parent reply other threads:[~2014-04-11 13:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-08 20:58 Data races in ext4 Pedro Fonseca
2014-04-09 21:33 ` Theodore Ts'o
2014-04-10 15:40 ` Pedro Fonseca
2014-04-10 22:09 ` Theodore Ts'o
2014-04-11 13:08 ` Pedro Fonseca [this message]
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=5347E930.1040601@mpi-sws.org \
--to=pfonseca@mpi-sws.org \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.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;
as well as URLs for NNTP newsgroup(s).