From 172827599cfe85e9df117b794ce5b935303fa96e Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Tue, 22 Dec 2015 13:01:51 +0100 Subject: kernel-fs_pin: CVE-2015-4178 Fixes list corruption of m_list or s_list if unused References: http://seclists.org/oss-sec/2015/q2/640 https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-4178 Upstream patch: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/ patch/?id=11bf6b1ea65f1580477827831d05711e5b87ac7b Signed-off-by: Sona Sarmadi Signed-off-by: Huimin She --- .../fs_pin-CVE-2015-4178.patch | 47 ++++++++++++++++++++++ recipes-kernel/linux/linux-hierofalcon_3.19.bb | 1 + 2 files changed, 48 insertions(+) create mode 100644 recipes-kernel/linux/linux-hierofalcon-3.19/fs_pin-CVE-2015-4178.patch diff --git a/recipes-kernel/linux/linux-hierofalcon-3.19/fs_pin-CVE-2015-4178.patch b/recipes-kernel/linux/linux-hierofalcon-3.19/fs_pin-CVE-2015-4178.patch new file mode 100644 index 0000000..34b6d0b --- /dev/null +++ b/recipes-kernel/linux/linux-hierofalcon-3.19/fs_pin-CVE-2015-4178.patch @@ -0,0 +1,47 @@ +From 11bf6b1ea65f1580477827831d05711e5b87ac7b Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Thu, 2 Apr 2015 16:35:48 -0500 +Subject: fs_pin: Allow for the possibility that m_list or s_list go unused. + +[ Upstream commit 820f9f147dcce2602eefd9b575bbbd9ea14f0953 ] + +This is needed to support lazily umounting locked mounts. Because the +entire unmounted subtree needs to stay together until there are no +users with references to any part of the subtree. + +To support this guarantee that the fs_pin m_list and s_list nodes +are initialized by initializing them in init_fs_pin allowing +for the possibility that pin_insert_group does not touch them. + +Further use hlist_del_init in pin_remove so that there is +a hlist_unhashed test before the list we attempt to update +the previous list item. + +Fixes CVE-2015-4178. +Upstream-Status: Backport + +Signed-off-by: "Eric W. Biederman" +Signed-off-by: Sasha Levin +Signed-off-by: Sona Sarmadi +--- + fs/fs_pin.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/fs_pin.c b/fs/fs_pin.c +index 9368236..569bbd1 100644 +--- a/fs/fs_pin.c ++++ b/fs/fs_pin.c +@@ -20,8 +20,8 @@ void pin_put(struct fs_pin *p) + void pin_remove(struct fs_pin *pin) + { + spin_lock(&pin_lock); +- hlist_del(&pin->m_list); +- hlist_del(&pin->s_list); ++ hlist_del_init(&pin->m_list); ++ hlist_del_init(&pin->s_list); + spin_unlock(&pin_lock); + } + +-- +cgit v0.11.2 + diff --git a/recipes-kernel/linux/linux-hierofalcon_3.19.bb b/recipes-kernel/linux/linux-hierofalcon_3.19.bb index 7d0e9d2..ea80e94 100644 --- a/recipes-kernel/linux/linux-hierofalcon_3.19.bb +++ b/recipes-kernel/linux/linux-hierofalcon_3.19.bb @@ -21,6 +21,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.19;branch="standard/qemuarm6 file://RDS-CVE-2015-7990-a-complete-fix-of-CVE-2015-6937.patch \ file://fs-CVE-2015-3339.patch \ file://mnt-CVE-2015-4177.patch \ + file://fs_pin-CVE-2015-4178.patch \ " S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf