Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-01-16 07:07:36 +0100
committerKernel Build Daemon <kbuild@suse.de>2019-01-16 07:07:36 +0100
commit18b4af18ae1787d78ac287966cf3ae92b665b996 (patch)
tree283e86954abadc8167147c1790476c251529c79a
parent1997eb54fc6c6c383d348cd261bd27df6a1f56f9 (diff)
parent51d2bb6b29d69156237debda83812afe4ded37fa (diff)
Merge branch 'SLE15' into SLE15-AZURE
-rw-r--r--patches.fixes/kdb-use-memmove-instead-of-overlapping-memcpy.patch47
-rw-r--r--patches.fixes/tools-lib-lockdep-Rename-trywlock-into-trywrlock.patch66
-rw-r--r--patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch53
-rw-r--r--series.conf4
4 files changed, 170 insertions, 0 deletions
diff --git a/patches.fixes/kdb-use-memmove-instead-of-overlapping-memcpy.patch b/patches.fixes/kdb-use-memmove-instead-of-overlapping-memcpy.patch
new file mode 100644
index 0000000000..80aed5e071
--- /dev/null
+++ b/patches.fixes/kdb-use-memmove-instead-of-overlapping-memcpy.patch
@@ -0,0 +1,47 @@
+From 2cf2f0d5b91fd1b06a6ae260462fc7945ea84add Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Fri, 2 Feb 2018 15:59:40 +0100
+Subject: [PATCH] kdb: use memmove instead of overlapping memcpy
+Git-commit: 2cf2f0d5b91fd1b06a6ae260462fc7945ea84add
+Patch-mainline: v4.17-rc1
+References: bsc#1120954
+
+gcc discovered that the memcpy() arguments in kdbnearsym() overlap, so
+we should really use memmove(), which is defined to handle that correctly:
+
+In function 'memcpy',
+ inlined from 'kdbnearsym' at /git/arm-soc/kernel/debug/kdb/kdb_support.c:132:4:
+/git/arm-soc/include/linux/string.h:353:9: error: '__builtin_memcpy' accessing 792 bytes at offsets 0 and 8 overlaps 784 bytes at offset 8 [-Werror=restrict]
+ return __builtin_memcpy(p, q, size);
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Acked-by: Petr Mladek <pmladek@suse.com>
+
+---
+ kernel/debug/kdb/kdb_support.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c
+index d35cc2d3a4cc..990b3cc526c8 100644
+--- a/kernel/debug/kdb/kdb_support.c
++++ b/kernel/debug/kdb/kdb_support.c
+@@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab)
+ }
+ if (i >= ARRAY_SIZE(kdb_name_table)) {
+ debug_kfree(kdb_name_table[0]);
+- memcpy(kdb_name_table, kdb_name_table+1,
++ memmove(kdb_name_table, kdb_name_table+1,
+ sizeof(kdb_name_table[0]) *
+ (ARRAY_SIZE(kdb_name_table)-1));
+ } else {
+ debug_kfree(knt1);
+ knt1 = kdb_name_table[i];
+- memcpy(kdb_name_table+i, kdb_name_table+i+1,
++ memmove(kdb_name_table+i, kdb_name_table+i+1,
+ sizeof(kdb_name_table[0]) *
+ (ARRAY_SIZE(kdb_name_table)-i-1));
+ }
+--
+2.13.7
+
diff --git a/patches.fixes/tools-lib-lockdep-Rename-trywlock-into-trywrlock.patch b/patches.fixes/tools-lib-lockdep-Rename-trywlock-into-trywrlock.patch
new file mode 100644
index 0000000000..27ee980353
--- /dev/null
+++ b/patches.fixes/tools-lib-lockdep-Rename-trywlock-into-trywrlock.patch
@@ -0,0 +1,66 @@
+From 7f3c7952d111ac93573fb86f4d5aeff527a07fcc Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Thu, 6 Dec 2018 17:11:29 -0800
+Subject: [PATCH] tools/lib/lockdep: Rename "trywlock" into "trywrlock"
+Git-commit: 7f3c7952d111ac93573fb86f4d5aeff527a07fcc
+Patch-mainline: v5.0-rc1
+References: bsc#1121973
+
+This patch avoids that the following compiler warning is reported while
+compiling the lockdep unit tests:
+
+Include/liblockdep/rwlock.h: In function 'liblockdep_pthread_rwlock_trywlock':
+include/liblockdep/rwlock.h:66:9: warning: implicit declaration of function 'pthread_rwlock_trywlock'; did you mean 'pthread_rwlock_trywrlock'? [-Wimplicit-function-declaration]
+ return pthread_rwlock_trywlock(&lock->rwlock) == 0 ? 1 : 0;
+ ^~~~~~~~~~~~~~~~~~~~~~~
+ pthread_rwlock_trywrlock
+
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Johannes Berg <johannes@sipsolutions.net>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Sasha Levin <sasha.levin@oracle.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Waiman Long <longman@redhat.com>
+Cc: johannes.berg@intel.com
+Cc: tj@kernel.org
+Fixes: 5a52c9b480e0 ("liblockdep: Add public headers for pthread_rwlock_t implementation")
+Link: https://lkml.kernel.org/r/20181207011148.251812-6-bvanassche@acm.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Acked-by: Petr Mladek <pmladek@suse.com>
+
+---
+ tools/lib/lockdep/include/liblockdep/rwlock.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/lib/lockdep/include/liblockdep/rwlock.h b/tools/lib/lockdep/include/liblockdep/rwlock.h
+index a96c3bf0fef1..365762e3a1ea 100644
+--- a/tools/lib/lockdep/include/liblockdep/rwlock.h
++++ b/tools/lib/lockdep/include/liblockdep/rwlock.h
+@@ -60,10 +60,10 @@ static inline int liblockdep_pthread_rwlock_tryrdlock(liblockdep_pthread_rwlock_
+ return pthread_rwlock_tryrdlock(&lock->rwlock) == 0 ? 1 : 0;
+ }
+
+-static inline int liblockdep_pthread_rwlock_trywlock(liblockdep_pthread_rwlock_t *lock)
++static inline int liblockdep_pthread_rwlock_trywrlock(liblockdep_pthread_rwlock_t *lock)
+ {
+ lock_acquire(&lock->dep_map, 0, 1, 0, 1, NULL, (unsigned long)_RET_IP_);
+- return pthread_rwlock_trywlock(&lock->rwlock) == 0 ? 1 : 0;
++ return pthread_rwlock_trywrlock(&lock->rwlock) == 0 ? 1 : 0;
+ }
+
+ static inline int liblockdep_rwlock_destroy(liblockdep_pthread_rwlock_t *lock)
+@@ -79,7 +79,7 @@ static inline int liblockdep_rwlock_destroy(liblockdep_pthread_rwlock_t *lock)
+ #define pthread_rwlock_unlock liblockdep_pthread_rwlock_unlock
+ #define pthread_rwlock_wrlock liblockdep_pthread_rwlock_wrlock
+ #define pthread_rwlock_tryrdlock liblockdep_pthread_rwlock_tryrdlock
+-#define pthread_rwlock_trywlock liblockdep_pthread_rwlock_trywlock
++#define pthread_rwlock_trywrlock liblockdep_pthread_rwlock_trywrlock
+ #define pthread_rwlock_destroy liblockdep_rwlock_destroy
+
+ #endif
+--
+2.13.7
+
diff --git a/patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch b/patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch
new file mode 100644
index 0000000000..2d5366d23d
--- /dev/null
+++ b/patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch
@@ -0,0 +1,53 @@
+From 9a6b7c0ff64945366c05338873e2456b990948e9 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Thu, 6 Dec 2018 17:06:08 +0100
+Subject: [PATCH] vfs: Avoid softlockups in drop_pagecache_sb()
+Patch-mainline: Submitted, Jan 14 2019
+References: bsc#1118505
+
+When superblock has lots of inodes without any pagecache (like is the
+case for /proc), drop_pagecache_sb() will iterate through all of them
+without dropping sb->s_inode_list_lock which can lead to softlockups
+(one of our customers hit this).
+
+Fix the problem by going to the slow path and doing cond_resched() in
+case the process needs rescheduling.
+
+Acked-by: Michal Hocko <mhocko@suse.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Acked-by: Jan Kara <jack@suse.cz>
+
+---
+ fs/drop_caches.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/fs/drop_caches.c b/fs/drop_caches.c
+index 82377017130f..d31b6c72b476 100644
+--- a/fs/drop_caches.c
++++ b/fs/drop_caches.c
+@@ -21,8 +21,13 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
+ spin_lock(&sb->s_inode_list_lock);
+ list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+ spin_lock(&inode->i_lock);
++ /*
++ * We must skip inodes in unusual state. We may also skip
++ * inodes without pages but we deliberately won't in case
++ * we need to reschedule to avoid softlockups.
++ */
+ if ((inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) ||
+- (inode->i_mapping->nrpages == 0)) {
++ (inode->i_mapping->nrpages == 0 && !need_resched())) {
+ spin_unlock(&inode->i_lock);
+ continue;
+ }
+@@ -30,6 +35,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
+ spin_unlock(&inode->i_lock);
+ spin_unlock(&sb->s_inode_list_lock);
+
++ cond_resched();
+ invalidate_mapping_pages(inode->i_mapping, 0, -1);
+ iput(toput_inode);
+ toput_inode = inode;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 05610df279..86a5b31db2 100644
--- a/series.conf
+++ b/series.conf
@@ -15361,6 +15361,7 @@
patches.drivers/iommu-amd-take-into-account-that-alloc_dev_data-may-return-null
patches.drivers/iommu-vt-d-fix-a-potential-memory-leak
patches.drivers/0016-ACPI-IORT-Add-msi-address-regions-reservation-helper.patch
+ patches.fixes/kdb-use-memmove-instead-of-overlapping-memcpy.patch
patches.drivers/mmc-jz4740-Fix-race-condition-in-IRQ-mask-update
patches.fixes/xen-xenbus_dev_frontend-fix-XS_TRANSACTION_END-handling.patch
patches.arch/x86-xen-delay-get_cpu_cap-until-stack-canary-is-established
@@ -19724,6 +19725,7 @@
patches.drivers/device-property-fix-fwnode_graph_get_next_endpoint-d.patch
patches.drivers/platform-msi-Free-descriptors-in-platform_msi_domain.patch
patches.fixes/0001-x86-speculation-l1tf-Drop-the-swap-storage-limit-res.patch
+ patches.fixes/tools-lib-lockdep-Rename-trywlock-into-trywrlock.patch
patches.arch/powerpc-pkeys-Fix-handling-of-pkey-state-across-fork.patch
patches.drivers/can-flexcan-flexcan_irq-fix-indention.patch
patches.drivers/wlcore-Fix-the-return-value-in-case-of-error-in-wlco.patch
@@ -19970,6 +19972,8 @@
patches.kabi/0001-hwpoison-memory_hotplug-allow-hwpoisoned-pages-to-be-kabi.patch
+ patches.fixes/vfs-Avoid-softlockups-in-drop_pagecache_sb.patch
+
########################################################
# misc small fixes
########################################################