Searched +hist:96 +hist:aebafa (Results 1 - 1 of 1) sorted by relevance

/linux-master/usr/
H A Dgen_init_cpio.cdiff 96aebafa Fri Dec 24 13:28:56 MST 2010 Jesper Juhl <jj@chaosbits.net> 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>
diff 96aebafa Fri Dec 24 13:28:56 MST 2010 Jesper Juhl <jj@chaosbits.net> 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>

Completed in 824 milliseconds