From: Andrew Morton <akpm@osdl.org>
To: Simon Derr <Simon.Derr@bull.net>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()
Date: Wed, 1 Sep 2004 16:34:36 -0700 [thread overview]
Message-ID: <20040901163436.263802bc.akpm@osdl.org> (raw)
In-Reply-To: <Pine.A41.4.53.0409010924250.122970@isabelle.frec.bull.fr>
Simon Derr <Simon.Derr@bull.net> wrote:
>
> I think there is a possibility for two threads from a single process to
> race in sysfs_read_file() if they call read() on the same file at the same
> time.
I think there is, too.
I also wonder what happens if the first read of a sysfs file is not at
offset zero (eg: pread()):
static ssize_t
sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct sysfs_buffer * buffer = file->private_data;
ssize_t retval = 0;
if (!*ppos) {
if ((retval = fill_read_buffer(file->f_dentry,buffer)))
we seem to not allocate the buffer at all?
next prev parent reply other threads:[~2004-09-01 23:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-01 8:17 Simon Derr
2004-09-01 23:34 ` Andrew Morton [this message]
2004-09-02 9:14 ` Simon Derr
2004-09-02 22:57 ` Andrew Morton
2004-09-03 9:06 ` Simon Derr
2004-09-03 9:39 ` Simon Derr
2004-09-03 11:57 ` Simon Derr
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=20040901163436.263802bc.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=Simon.Derr@bull.net \
--cc=greg@kroah.com \
--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
all inboxes | Powered by JetHome®