From: Greg Kroah-Hartman Date: Fri, 8 Nov 2019 17:37:57 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.4.200~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e5f0a69da3a069193a9b8cd934e7efab063e645;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alarmtimer-change-remaining-enotsupp-to-eopnotsupp.patch fs-dcache-move-security_d_instantiate-behind-attaching-dentry-to-inode.patch --- diff --git a/queue-4.4/alarmtimer-change-remaining-enotsupp-to-eopnotsupp.patch b/queue-4.4/alarmtimer-change-remaining-enotsupp-to-eopnotsupp.patch new file mode 100644 index 00000000000..13b7b3dc184 --- /dev/null +++ b/queue-4.4/alarmtimer-change-remaining-enotsupp-to-eopnotsupp.patch @@ -0,0 +1,45 @@ +From pvorel@suse.cz Fri Nov 8 18:34:30 2019 +From: Petr Vorel +Date: Fri, 8 Nov 2019 16:51:16 +0100 +Subject: alarmtimer: Change remaining ENOTSUPP to EOPNOTSUPP +To: stable@vger.kernel.org +Cc: Petr Vorel , Thadeu Lima de Souza Cascardo +Message-ID: <20191108155116.12896-1-pvorel@suse.cz> + +From: Petr Vorel + +Fix backport of commit f18ddc13af981ce3c7b7f26925f099e7c6929aba upstream. + +Update backport to change ENOTSUPP to EOPNOTSUPP in +alarm_timer_{del,set}(), which were removed in +f2c45807d3992fe0f173f34af9c347d907c31686 in v4.13-rc1. + +Fixes: c22df8ea7c5831d6fdca2f6f136f0d32d7064ff9 + +Signed-off-by: Petr Vorel +Acked-by: Thadeu Lima de Souza Cascardo +Signed-off-by: Greg Kroah-Hartman +--- + kernel/time/alarmtimer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -573,7 +573,7 @@ static void alarm_timer_get(struct k_iti + static int alarm_timer_del(struct k_itimer *timr) + { + if (!rtcdev) +- return -ENOTSUPP; ++ return -EOPNOTSUPP; + + if (alarm_try_to_cancel(&timr->it.alarm.alarmtimer) < 0) + return TIMER_RETRY; +@@ -597,7 +597,7 @@ static int alarm_timer_set(struct k_itim + ktime_t exp; + + if (!rtcdev) +- return -ENOTSUPP; ++ return -EOPNOTSUPP; + + if (flags & ~TIMER_ABSTIME) + return -EINVAL; diff --git a/queue-4.4/fs-dcache-move-security_d_instantiate-behind-attaching-dentry-to-inode.patch b/queue-4.4/fs-dcache-move-security_d_instantiate-behind-attaching-dentry-to-inode.patch new file mode 100644 index 00000000000..b196fb72cd9 --- /dev/null +++ b/queue-4.4/fs-dcache-move-security_d_instantiate-behind-attaching-dentry-to-inode.patch @@ -0,0 +1,63 @@ +From yi.zhang@huawei.com Fri Nov 8 18:36:12 2019 +From: "zhangyi (F)" +Date: Wed, 6 Nov 2019 17:43:52 +0800 +Subject: fs/dcache: move security_d_instantiate() behind attaching dentry to inode +To: +Cc: , , , +Message-ID: <20191106094352.9665-1-yi.zhang@huawei.com> + +From: "zhangyi (F)" + +During backport 1e2e547a93a "do d_instantiate/unlock_new_inode +combinations safely", there was a error instantiating sequence of +attaching dentry to inode and calling security_d_instantiate(). + +Before commit ce23e640133 "->getxattr(): pass dentry and inode as +separate arguments" and b96809173e9 "security_d_instantiate(): move to +the point prior to attaching dentry to inode", security_d_instantiate() +should be called beind __d_instantiate(), otherwise it will trigger +below problem when CONFIG_SECURITY_SMACK on ext4 was enabled because +d_inode(dentry) used by ->getxattr() is NULL before __d_instantiate() +instantiate inode. + +[ 31.858026] BUG: unable to handle kernel paging request at ffffffffffffff70 +... +[ 31.882024] Call Trace: +[ 31.882378] [] ext4_xattr_get+0x8c/0x3e0 +[ 31.883195] [] ext4_xattr_security_get+0x24/0x40 +[ 31.884086] [] generic_getxattr+0x5b/0x90 +[ 31.884907] [] smk_fetch+0xb4/0x150 +[ 31.885634] [] smack_d_instantiate+0x1c2/0x550 +[ 31.886508] [] security_d_instantiate+0x3a/0x80 +[ 31.887389] [] d_instantiate_new+0x36/0x130 +[ 31.888223] [] ext4_mkdir+0x4af/0x6a0 +[ 31.888928] [] vfs_mkdir+0x100/0x280 +[ 31.889536] [] SyS_mkdir+0xb6/0x170 +[ 31.890255] [] ? trace_do_page_fault+0x95/0x2b0 +[ 31.891134] [] entry_SYSCALL_64_fastpath+0x18/0x73 + +Cc: # 3.16, 4.4 +Signed-off-by: zhangyi (F) +Signed-off-by: Greg Kroah-Hartman +--- + fs/dcache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/dcache.c ++++ b/fs/dcache.c +@@ -1903,7 +1903,6 @@ void d_instantiate_new(struct dentry *en + BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); + BUG_ON(!inode); + lockdep_annotate_inode_mutex_key(inode); +- security_d_instantiate(entry, inode); + spin_lock(&inode->i_lock); + __d_instantiate(entry, inode); + WARN_ON(!(inode->i_state & I_NEW)); +@@ -1911,6 +1910,7 @@ void d_instantiate_new(struct dentry *en + smp_mb(); + wake_up_bit(&inode->i_state, __I_NEW); + spin_unlock(&inode->i_lock); ++ security_d_instantiate(entry, inode); + } + EXPORT_SYMBOL(d_instantiate_new); + diff --git a/queue-4.4/series b/queue-4.4/series index 689481bc35d..338da31da92 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -71,3 +71,5 @@ arm-add-proc_vtable-and-proc_table-macros.patch arm-spectre-v2-per-cpu-vtables-to-work-around-big.little-systems.patch arm-ensure-that-processor-vtables-is-not-lost-after-boot.patch arm-fix-the-cockup-in-the-previous-patch.patch +alarmtimer-change-remaining-enotsupp-to-eopnotsupp.patch +fs-dcache-move-security_d_instantiate-behind-attaching-dentry-to-inode.patch