- initramfs-cpio-unpacking-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     initramfs: CPIO unpacking fix

has been removed from the -mm tree.  Its filename is

     initramfs-cpio-unpacking-fix.patch

This patch was dropped because an updated version was merged

------------------------------------------------------
Subject: initramfs: CPIO unpacking fix
From: "H. Peter Anvin" <hpa@xxxxxxxxx>


Unlink files, symlinks, FIFOs, devices etc. (except directories) before
writing them when extracting CPIOs.  This stops weird behaviour like:
  1) writing through symlinks created in earlier CPIOs. eg foo->bar in
     the first CPIO.  Having foo as a non-link in a subsequent CPIO,
     results in bar being written and foo remaining as a symlink.
  2) if the first version of file foo is larger than foo in a
     subsequent CPIO, we end up with a mix of the two.  ie. neither
     the first or second version of /foo.
  3) special files like devices, fifo etc. can't be overwritten in
     subsequent CPIOS.

With this, the kernel will more closely replicate
   for i in *.cpio; do cpio --extract --unconditional < $i ; done

This is a change but it's regarded as fixing broken functionality.

Signed-off-by: Michael Neuling <mikey@xxxxxxxxxxx>
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 init/initramfs.c |    3 +++
 1 files changed, 3 insertions(+)

diff -puN init/initramfs.c~initramfs-cpio-unpacking-fix init/initramfs.c
--- devel/init/initramfs.c~initramfs-cpio-unpacking-fix	2006-05-11 15:18:54.000000000 -0700
+++ devel-akpm/init/initramfs.c	2006-05-11 15:18:54.000000000 -0700
@@ -252,6 +252,7 @@ static int __init do_name(void)
 	if (dry_run)
 		return 0;
 	if (S_ISREG(mode)) {
+		sys_unlink(collected);
 		if (maybe_link() >= 0) {
 			wfd = sys_open(collected, O_WRONLY|O_CREAT, mode);
 			if (wfd >= 0) {
@@ -266,6 +267,7 @@ static int __init do_name(void)
 		sys_chmod(collected, mode);
 	} else if (S_ISBLK(mode) || S_ISCHR(mode) ||
 		   S_ISFIFO(mode) || S_ISSOCK(mode)) {
+		sys_unlink(collected);
 		if (maybe_link() == 0) {
 			sys_mknod(collected, mode, rdev);
 			sys_chown(collected, uid, gid);
@@ -294,6 +296,7 @@ static int __init do_copy(void)
 static int __init do_symlink(void)
 {
 	collected[N_ALIGN(name_len) + body_len] = '\0';
+	sys_unlink(collected);
 	sys_symlink(collected + N_ALIGN(name_len), collected);
 	sys_lchown(collected, uid, gid);
 	state = SkipIt;
_

Patches currently in -mm which might be from hpa@xxxxxxxxx are

origin.patch
git-klibc.patch
git-hdrcleanup-vs-git-klibc-on-ia64.patch
git-hdrcleanup-vs-git-klibc-on-ia64-2.patch
initramfs-overwrite-fix.patch
initramfs-cpio-unpacking-fix.patch
drivers-md-raid6algosc-fix-a-null-dereference.patch
make-procfs-obligatory-except-under-config_embedded.patch
make-sysctl-obligatory-except-under-config_embedded.patch
initramfs-docs-update.patch
md-merge-raid5-and-raid6-code.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux