diff options
author | Jesper Juhl <jj@chaosbits.net> | 2010-12-24 21:28:56 +0100 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-12-29 15:06:54 +0100 |
commit | 96aebafa63418f447ddc823e40da341cc40553dd (patch) | |
tree | 1e92e6de97eb77c20807557b98d08822c34b58d4 /fs | |
parent | 731ece41fb1047816303295a0cdfed90a528137e (diff) | |
download | linux-96aebafa63418f447ddc823e40da341cc40553dd.tar.bz2 |
gen_init_cpio: Avoid race between call to stat() and call to open()
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>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions