From: tytso@mit.edu
To: dpw@doc.ic.ac.uk
Cc: linux-kernel@vger.kernel.org
Subject: Re: What protects f_pos?
Date: Sat, 11 Nov 2000 18:54:00 -0500 [thread overview]
Message-ID: <200011112354.eABNs0005918@trampoline.thunk.org> (raw)
In-Reply-To: <y7r8zqzqt71.fsf@sytry.doc.ic.ac.uk> (message from David Wragg on 04 Nov 2000 22:16:18 +0000)
In-Reply-To: <y7r8zqzqt71.fsf@sytry.doc.ic.ac.uk>
From: David Wragg <dpw@doc.ic.ac.uk>
Date: 04 Nov 2000 22:16:18 +0000
Since f_pos of struct file is a loff_t, on 32-bit architectures it
needs a lock to make accesses atomic (or some more sophisticated form
of protection). But looking in 2.4.0-test10, there doesn't seem to be
any such lock.
The llseek op is called with the Big Kernel Lock, but unlike in 2.2,
the read and write ops are called without any locks held, and so
generic_file_{read|write} make unprotected accesses to f_pos (through
their ppos argument).
This looks like it's a bug to me.... although if you have multiple
threads hitting a file descriptor at the same time, you're pretty much
asking for trouble.
- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-11 22:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-04 22:16 What protects f_pos? David Wragg
2000-11-11 23:54 ` tytso [this message]
2000-11-12 1:56 ` David Wragg
2000-11-12 22:27 ` David Schwartz
2000-11-13 15:22 ` David Wragg
2000-11-13 15:44 ` Richard B. Johnson
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=200011112354.eABNs0005918@trampoline.thunk.org \
--to=tytso@mit.edu \
--cc=dpw@doc.ic.ac.uk \
--cc=linux-kernel@vger.kernel.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