[linux] 01/02: vfs: avoid creation of inode number 0 in get_next_ino (Closes: #876762)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Sep 29 22:51:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch jessie
in repository linux.

commit d311adb356db3edfb7d2b73b0d7f394e61618904
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Wed Sep 27 14:13:19 2017 +0200

    vfs: avoid creation of inode number 0 in get_next_ino (Closes: #876762)
---
 debian/changelog                                   |  1 +
 ...reation-of-inode-number-0-in-get_next_ino.patch | 42 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 55ac046..ab9faf6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -581,6 +581,7 @@ linux (3.16.48-1) UNRELEASED; urgency=medium
     - f2fs: Don't clear SGID when inheriting ACLs
     - ext4: preserve i_mode if __ext4_set_acl() fails
     - ext4: Don't clear SGID when inheriting ACLs
+  * vfs: avoid creation of inode number 0 in get_next_ino (Closes: #876762)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Sun, 06 Aug 2017 22:03:56 +0100
 
diff --git a/debian/patches/bugfix/all/vfs-avoid-creation-of-inode-number-0-in-get_next_ino.patch b/debian/patches/bugfix/all/vfs-avoid-creation-of-inode-number-0-in-get_next_ino.patch
new file mode 100644
index 0000000..b953ad1
--- /dev/null
+++ b/debian/patches/bugfix/all/vfs-avoid-creation-of-inode-number-0-in-get_next_ino.patch
@@ -0,0 +1,42 @@
+From: Carlos Maiolino <cmaiolino at redhat.com>
+Date: Thu, 25 Jun 2015 12:25:58 -0300
+Subject: vfs: avoid creation of inode number 0 in get_next_ino
+Origin: https://git.kernel.org/linus/2adc376c551943a07170cbe70f43e6d6065f8906
+Bug-Debian: https://bugs.debian.org/876762
+
+currently, get_next_ino() is able to create inodes with inode number = 0.
+This have a bad impact in the filesystems relying in this function to generate
+inode numbers.
+
+While there is no problem at all in having inodes with number 0, userspace tools
+which handle file management tasks can have problems handling these files, like
+for example, the impossiblity of users to delete these files, since glibc will
+ignore them. So, I believe the best way is kernel to avoid creating them.
+
+This problem has been raised previously, but the old thread didn't have any
+other update for a year+, and I've seen too many users hitting the same issue
+regarding the impossibility to delete files while using filesystems relying on
+this function. So, I'm starting the thread again, with the same patch
+that I believe is enough to address this problem.
+
+Signed-off-by: Carlos Maiolino <cmaiolino at redhat.com>
+Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
+---
+ fs/inode.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/fs/inode.c
++++ b/fs/inode.c
+@@ -849,7 +849,11 @@ unsigned int get_next_ino(void)
+ 	}
+ #endif
+ 
+-	*p = ++res;
++	res++;
++	/* get_next_ino should not provide a 0 inode number */
++	if (unlikely(!res))
++		res++;
++	*p = res;
+ 	put_cpu_var(last_ino);
+ 	return res;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index eab75e0..14667b6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -256,6 +256,7 @@ bugfix/all/xfs-don-t-clear-sgid-when-inheriting-acls.patch
 bugfix/all/f2fs-don-t-clear-sgid-when-inheriting-acls.patch
 bugfix/all/ext4-preserve-i_mode-if-__ext4_set_acl-fails.patch
 bugfix/all/ext4-don-t-clear-sgid-when-inheriting-acls.patch
+bugfix/all/vfs-avoid-creation-of-inode-number-0-in-get_next_ino.patch
 
 # memfd_create() & kdbus backport
 features/all/kdbus/mm-allow-drivers-to-prevent-new-writable-mappings.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list