wok rev 17426
linux: hardlink on fifos, sockets, char & block devices and symlinks in initramfs (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Dec 05 09:00:59 2014 +0100 (2014-12-05) |
parents | 1257fa601efc |
children | be5709551b21 |
files | linux/receipt linux/stuff/linux-hardlinks.u |
line diff
1.1 --- a/linux/receipt Fri Dec 05 00:27:22 2014 +0100 1.2 +++ b/linux/receipt Fri Dec 05 09:00:59 2014 +0100 1.3 @@ -224,6 +224,7 @@ 1.4 $PACKAGE-subroot.u 1.5 $PACKAGE-CVE-2013-2929.u 1.6 $PACKAGE-romfs.u 1.7 +$PACKAGE-hardlinks.u 1.8 aufs3-base.patch 1.9 aufs3-standalone.patch 1.10 aufs3-loopback.patch
2.1 --- a/linux/stuff/linux-hardlinks.u Fri Dec 05 00:27:22 2014 +0100 2.2 +++ b/linux/stuff/linux-hardlinks.u Fri Dec 05 09:00:59 2014 +0100 2.3 @@ -197,7 +197,7 @@ 2.4 kfree(vcollected); 2.5 eat(body_len); 2.6 state = SkipIt; 2.7 -@@ -353,13 +385,15 @@ 2.8 +@@ -353,13 +385,18 @@ 2.9 2.10 static int __init do_symlink(void) 2.11 { 2.12 @@ -206,9 +206,12 @@ 2.13 - sys_symlink(collected + N_ALIGN(name_len), collected); 2.14 - sys_lchown(collected, uid, gid); 2.15 - do_utime(collected, mtime); 2.16 ++ char c = victim[body_len]; 2.17 ++ 2.18 + victim[body_len] = '\0'; 2.19 + clean_path(vcollected, 0); 2.20 + sys_symlink(victim, vcollected); 2.21 ++ victim[body_len] = c; 2.22 + sys_lchown(vcollected, uid, gid); 2.23 + do_utime(vcollected, mtime); 2.24 + make_links(vcollected); 2.25 @@ -219,7 +222,7 @@ 2.26 return 0; 2.27 } 2.28 2.29 -@@ -466,10 +500,9 @@ 2.30 +@@ -466,10 +503,9 @@ 2.31 int early_free_initrd = (buf == (char *) initrd_start); 2.32 2.33 header_buf = kmalloc(110, GFP_KERNEL); 2.34 @@ -231,7 +234,7 @@ 2.35 panic("can't allocate buffers"); 2.36 2.37 state = Start; 2.38 -@@ -524,7 +557,6 @@ 2.39 +@@ -524,7 +560,6 @@ 2.40 } 2.41 dir_utime(); 2.42 kfree(name_buf);