From: Jeff Garzik <jgarzik@pobox.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] gen_init_cpio: Avoid race between call to stat() and call to open()
Date: Fri, 24 Dec 2010 17:33:48 -0500 [thread overview]
Message-ID: <4D151FCC.4060202@pobox.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1012242125170.28973@swampdragon.chaosbits.net>
On 12/24/2010 03:28 PM, Jesper Juhl wrote:
> Hi,
>
> In usr/gen_init_cpio.c::cpio_mkfile() a call to stat() is made based on
> pathname, subsequently the file is open()'ed and then the value of the
> initial stat() call is used to allocate a buffer. This is not safe since
> the file may change between the call to stat() and the call to open().
> Safer to just open() the file and then do fstat() using the filedescriptor
> returned by open.
>
>
> Signed-off-by: Jesper Juhl<jj@chaosbits.net>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
next prev parent reply other threads:[~2010-12-24 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-24 20:28 [PATCH] gen_init_cpio: Avoid race between call to stat() and call to open() Jesper Juhl
2010-12-24 20:31 ` Jesper Juhl
2010-12-24 22:33 ` Jeff Garzik [this message]
2010-12-29 13:25 ` Michal Marek
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=4D151FCC.4060202@pobox.com \
--to=jgarzik@pobox.com \
--cc=akpm@linux-foundation.org \
--cc=jj@chaosbits.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.