[PATCH] initramfs: fix CPIO hardlink check
authorMark Huang <[email protected]>
Mon, 15 May 2006 16:44:03 +0000 (09:44 -0700)
committerLinus Torvalds <[email protected]>
Mon, 15 May 2006 18:20:55 +0000 (11:20 -0700)
commit6a050da45b5d855b48b057446847ff1542977b52
treef455f444ddd5be62740cd430c595c6d6a13fb4db
parent698d070746770aaaec78ab4ffa3ab1f1d5c6abe8
[PATCH] initramfs: fix CPIO hardlink check

Copy the filenames of hardlinks when inserting them into the hash, since
the "name" pointer may point to scratch space (name_buf).  Not doing so
results in corruption if the scratch space is later overwritten: the wrong
file may be hardlinked, or, if the scratch space contains garbage, the link
will fail and a 0-byte file will be created instead.

Signed-off-by: Mark Huang <[email protected]>
Acked-by: Al Viro <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
init/initramfs.c