Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2018-07-10 07:16:45 +0200
committerKernel Build Daemon <kbuild@suse.de>2018-07-10 07:16:45 +0200
commit56a6d78224cf999e27575f5709ea7c6367ede40a (patch)
tree34ce8520f9608c825c441a3b56480b82f70e8e71
parentd52349c9db8379f7a68cf417ef5608b05e6a6c1b (diff)
parent4e3472d744051ed3c8b44ab6c38e0f6398ba6807 (diff)
Merge branch 'SLE12-SP3' into openSUSE-42.3
-rw-r--r--patches.fixes/alarmtimer-Prevent-overflow-for-relative-nanosleep.patch51
-rw-r--r--patches.kernel.org/4.4.131-037-ARM-amba-Don-t-read-past-the-end-of-sysfs-dri.patch2
-rw-r--r--patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch108
-rw-r--r--patches.suse/0001-dm-fix-printk-rate-limiting-code.patch86
-rw-r--r--patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch62
-rw-r--r--patches.suse/0001-mtd-cmdlinepart-Update-comment-for-introduction-of-O.patch41
-rw-r--r--patches.suse/0001-mtd-partitions-add-helper-for-deleting-partition.patch125
-rw-r--r--patches.suse/0001-mtd-partitions-remove-sysfs-files-when-deleting-all-.patch52
-rw-r--r--series.conf8
9 files changed, 534 insertions, 1 deletions
diff --git a/patches.fixes/alarmtimer-Prevent-overflow-for-relative-nanosleep.patch b/patches.fixes/alarmtimer-Prevent-overflow-for-relative-nanosleep.patch
new file mode 100644
index 0000000000..2ae1e45c85
--- /dev/null
+++ b/patches.fixes/alarmtimer-Prevent-overflow-for-relative-nanosleep.patch
@@ -0,0 +1,51 @@
+From 5f936e19cc0ef97dbe3a56e9498922ad5ba1edef Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Mon, 2 Jul 2018 09:34:29 +0200
+Subject: [PATCH] alarmtimer: Prevent overflow for relative nanosleep
+Git-commit: 5f936e19cc0ef97dbe3a56e9498922ad5ba1edef
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
+Patch-mainline: Queued in subsystem maintainer repo
+References: CVE-2018-13053 bsc#1099924
+
+Air Icy reported:
+
+ UBSAN: Undefined behaviour in kernel/time/alarmtimer.c:811:7
+ signed integer overflow:
+ 1529859276030040771 + 9223372036854775807 cannot be represented in type 'long long int'
+ Call Trace:
+ alarm_timer_nsleep+0x44c/0x510 kernel/time/alarmtimer.c:811
+ __do_sys_clock_nanosleep kernel/time/posix-timers.c:1235 [inline]
+ __se_sys_clock_nanosleep kernel/time/posix-timers.c:1213 [inline]
+ __x64_sys_clock_nanosleep+0x326/0x4e0 kernel/time/posix-timers.c:1213
+ do_syscall_64+0xb8/0x3a0 arch/x86/entry/common.c:290
+
+alarm_timer_nsleep() uses ktime_add() to add the current time and the
+relative expiry value. ktime_add() has no sanity checks so the addition
+can overflow when the relative timeout is large enough.
+
+Use ktime_add_safe() which has the necessary sanity checks in place and
+limits the result to the valid range.
+
+Fixes: 9a7adcf5c6de ("timers: Posix interface for alarm-timers")
+Reported-by: Team OWL337 <icytxw@gmail.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: John Stultz <john.stultz@linaro.org>
+Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1807020926360.1595@nanos.tec.linutronix.de
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ kernel/time/alarmtimer.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/time/alarmtimer.c
++++ b/kernel/time/alarmtimer.c
+@@ -773,7 +773,8 @@ static int alarm_timer_nsleep(const cloc
+ /* Convert (if necessary) to absolute time */
+ if (flags != TIMER_ABSTIME) {
+ ktime_t now = alarm_bases[type].gettime();
+- exp = ktime_add(now, exp);
++
++ exp = ktime_add_safe(now, exp);
+ }
+
+ if (alarmtimer_do_nsleep(&alarm, exp))
diff --git a/patches.kernel.org/4.4.131-037-ARM-amba-Don-t-read-past-the-end-of-sysfs-dri.patch b/patches.kernel.org/4.4.131-037-ARM-amba-Don-t-read-past-the-end-of-sysfs-dri.patch
index b8aaef6278..a81ad7034a 100644
--- a/patches.kernel.org/4.4.131-037-ARM-amba-Don-t-read-past-the-end-of-sysfs-dri.patch
+++ b/patches.kernel.org/4.4.131-037-ARM-amba-Don-t-read-past-the-end-of-sysfs-dri.patch
@@ -2,7 +2,7 @@ From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Tue, 10 Apr 2018 15:21:45 +0200
Subject: [PATCH] ARM: amba: Don't read past the end of sysfs "driver_override"
buffer
-References: bnc#1012382
+References: bnc#1012382, bsc#1100491, CVE-2018-9385
Patch-mainline: 4.4.131
Git-commit: d2ffed5185df9d8d9ccd150e4340e3b6f96a8381
diff --git a/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch b/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
new file mode 100644
index 0000000000..8e5b6b75eb
--- /dev/null
+++ b/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
@@ -0,0 +1,108 @@
+From d2c3c8dcb5987b8352e82089c79a41b6e17e28d2 Mon Sep 17 00:00:00 2001
+From: Joe Perches <joe@perches.com>
+Date: Thu, 20 Apr 2017 10:46:07 -0700
+Subject: [PATCH] dm: convert DM printk macros to pr_<level> macros
+Git-commit: d2c3c8dcb5987b8352e82089c79a41b6e17e28d2
+Patch-mainline: v4.13-rc1
+References: bsc#1099918
+
+Using pr_<level> is the more common logging style.
+
+Standardize style and use new macro DM_FMT.
+Use no_printk in DMDEBUG macros when CONFIG_DM_DEBUG is not #defined.
+
+Signed-off-by: Joe Perches <joe@perches.com>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ include/linux/device-mapper.h | 71 ++++++++++++++++-------------------
+ 1 file changed, 32 insertions(+), 39 deletions(-)
+
+diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
+index 456da5017b32..19bc7fdfd6da 100644
+--- a/include/linux/device-mapper.h
++++ b/include/linux/device-mapper.h
+@@ -543,48 +543,41 @@ extern struct ratelimit_state dm_ratelimit_state;
+ #define dm_ratelimit() 0
+ #endif
+
+-#define DMCRIT(f, arg...) \
+- printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+-
+-#define DMERR(f, arg...) \
+- printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+-#define DMERR_LIMIT(f, arg...) \
+- do { \
+- if (dm_ratelimit()) \
+- printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \
+- f "\n", ## arg); \
+- } while (0)
+-
+-#define DMWARN(f, arg...) \
+- printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+-#define DMWARN_LIMIT(f, arg...) \
+- do { \
+- if (dm_ratelimit()) \
+- printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \
+- f "\n", ## arg); \
+- } while (0)
+-
+-#define DMINFO(f, arg...) \
+- printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+-#define DMINFO_LIMIT(f, arg...) \
+- do { \
+- if (dm_ratelimit()) \
+- printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
+- "\n", ## arg); \
+- } while (0)
++#define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n"
++
++#define DMCRIT(fmt, ...) pr_crit(DM_FMT(fmt), ##__VA_ARGS__)
++
++#define DMERR(fmt, ...) pr_err(DM_FMT(fmt), ##__VA_ARGS__)
++#define DMERR_LIMIT(fmt, ...) \
++do { \
++ if (dm_ratelimit()) \
++ DMERR(fmt, ##__VA_ARGS__); \
++} while (0)
++
++#define DMWARN(fmt, ...) pr_warn(DM_FMT(fmt), ##__VA_ARGS__)
++#define DMWARN_LIMIT(fmt, ...) \
++do { \
++ if (dm_ratelimit()) \
++ DMWARN(fmt, ##__VA_ARGS__); \
++} while (0)
++
++#define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
++#define DMINFO_LIMIT(fmt, ...) \
++do { \
++ if (dm_ratelimit()) \
++ DMINFO(fmt, ##__VA_ARGS__); \
++} while (0)
+
+ #ifdef CONFIG_DM_DEBUG
+-# define DMDEBUG(f, arg...) \
+- printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
+-# define DMDEBUG_LIMIT(f, arg...) \
+- do { \
+- if (dm_ratelimit()) \
+- printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \
+- "\n", ## arg); \
+- } while (0)
++#define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
++#define DMDEBUG_LIMIT(fmt, ...) \
++do { \
++ if (dm_ratelimit()) \
++ DMDEBUG(fmt, ##__VA_ARGS__); \
++} while (0)
+ #else
+-# define DMDEBUG(f, arg...) do {} while (0)
+-# define DMDEBUG_LIMIT(f, arg...) do {} while (0)
++#define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
++#define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
+ #endif
+
+ #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
+--
+2.17.1
+
diff --git a/patches.suse/0001-dm-fix-printk-rate-limiting-code.patch b/patches.suse/0001-dm-fix-printk-rate-limiting-code.patch
new file mode 100644
index 0000000000..b5b9c21327
--- /dev/null
+++ b/patches.suse/0001-dm-fix-printk-rate-limiting-code.patch
@@ -0,0 +1,86 @@
+From 604407890ecf624c2fb41013c82b22aade59b455 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bart.vanassche@wdc.com>
+Date: Wed, 9 Aug 2017 11:32:11 -0700
+Subject: [PATCH] dm: fix printk() rate limiting code
+Git-commit: 604407890ecf624c2fb41013c82b22aade59b455
+Patch-mainline: v4.13
+References: bsc#1099918
+
+Using the same rate limiting state for different kinds of messages
+is wrong because this can cause a high frequency message to suppress
+a report of a low frequency message. Hence use a unique rate limiting
+state per message type.
+
+(Coly Li: keep dm_ratelimit_state to avoid KABI break)
+
+Fixes: 71a16736a15e ("dm: use local printk ratelimit")
+Cc: stable@vger.kernel.org
+Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+
+---
+ include/linux/device-mapper.h | 41 ++++++++++++-----------------------------
+ 1 file changed, 12 insertions(+), 29 deletions(-)
+
+--- a/include/linux/device-mapper.h
++++ b/include/linux/device-mapper.h
+@@ -549,46 +549,29 @@ void *dm_vcalloc(unsigned long nmemb, un
+ *---------------------------------------------------------------*/
+ #define DM_NAME "device-mapper"
+
+-#ifdef CONFIG_PRINTK
+-extern struct ratelimit_state dm_ratelimit_state;
+-
+-#define dm_ratelimit() __ratelimit(&dm_ratelimit_state)
+-#else
+-#define dm_ratelimit() 0
+-#endif
++#define DM_RATELIMIT(pr_func, fmt, ...) \
++do { \
++ static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, \
++ DEFAULT_RATELIMIT_BURST); \
++ \
++ if (__ratelimit(&rs)) \
++ pr_func(DM_FMT(fmt), ##__VA_ARGS__); \
++} while (0)
+
+ #define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n"
+
+ #define DMCRIT(fmt, ...) pr_crit(DM_FMT(fmt), ##__VA_ARGS__)
+
+ #define DMERR(fmt, ...) pr_err(DM_FMT(fmt), ##__VA_ARGS__)
+-#define DMERR_LIMIT(fmt, ...) \
+-do { \
+- if (dm_ratelimit()) \
+- DMERR(fmt, ##__VA_ARGS__); \
+-} while (0)
+-
++#define DMERR_LIMIT(fmt, ...) DM_RATELIMIT(pr_err, fmt, ##__VA_ARGS__)
+ #define DMWARN(fmt, ...) pr_warn(DM_FMT(fmt), ##__VA_ARGS__)
+-#define DMWARN_LIMIT(fmt, ...) \
+-do { \
+- if (dm_ratelimit()) \
+- DMWARN(fmt, ##__VA_ARGS__); \
+-} while (0)
+-
++#define DMWARN_LIMIT(fmt, ...) DM_RATELIMIT(pr_warn, fmt, ##__VA_ARGS__)
+ #define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
+-#define DMINFO_LIMIT(fmt, ...) \
+-do { \
+- if (dm_ratelimit()) \
+- DMINFO(fmt, ##__VA_ARGS__); \
+-} while (0)
++#define DMINFO_LIMIT(fmt, ...) DM_RATELIMIT(pr_info, fmt, ##__VA_ARGS__)
+
+ #ifdef CONFIG_DM_DEBUG
+ #define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
+-#define DMDEBUG_LIMIT(fmt, ...) \
+-do { \
+- if (dm_ratelimit()) \
+- DMDEBUG(fmt, ##__VA_ARGS__); \
+-} while (0)
++#define DMDEBUG_LIMIT(fmt, ...) DM_RATELIMIT(pr_debug, fmt, ##__VA_ARGS__)
+ #else
+ #define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
+ #define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
diff --git a/patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch b/patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch
new file mode 100644
index 0000000000..b1917746a8
--- /dev/null
+++ b/patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch
@@ -0,0 +1,62 @@
+From 7a2148dfda8001c983f0effd9afd8a7fa58e99c4 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Wed, 25 Apr 2018 11:04:21 -0400
+Subject: [PATCH] media: smiapp: fix timeout checking in smiapp_read_nvm
+Git-commit: 7a2148dfda8001c983f0effd9afd8a7fa58e99c4
+Patch-mainline: v4.18-rc1
+References: bsc#1099918
+
+The current code decrements the timeout counter i and the end of
+each loop i is incremented, so the check for timeout will always
+be false and hence the timeout mechanism is just a dead code path.
+Potentially, if the RD_READY bit is not set, we could end up in
+an infinite loop.
+
+Fix this so the timeout starts from 1000 and decrements to zero,
+if at the end of the loop i is zero we have a timeout condition.
+
+Detected by CoverityScan, CID#1324008 ("Logically dead code")
+
+Fixes: ccfc97bdb5ae ("[media] smiapp: Add driver")
+
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Coly Li <colyli@suse.de>
+
+---
+ drivers/media/i2c/smiapp/smiapp-core.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
+index 3b7ace395ee6..e1f8208581aa 100644
+--- a/drivers/media/i2c/smiapp/smiapp-core.c
++++ b/drivers/media/i2c/smiapp/smiapp-core.c
+@@ -1001,7 +1001,7 @@ static int smiapp_read_nvm(struct smiapp_sensor *sensor,
+ if (rval)
+ goto out;
+
+- for (i = 0; i < 1000; i++) {
++ for (i = 1000; i > 0; i--) {
+ rval = smiapp_read(
+ sensor,
+ SMIAPP_REG_U8_DATA_TRANSFER_IF_1_STATUS, &s);
+@@ -1012,11 +1012,10 @@ static int smiapp_read_nvm(struct smiapp_sensor *sensor,
+ if (s & SMIAPP_DATA_TRANSFER_IF_1_STATUS_RD_READY)
+ break;
+
+- if (--i == 0) {
+- rval = -ETIMEDOUT;
+- goto out;
+- }
+-
++ }
++ if (!i) {
++ rval = -ETIMEDOUT;
++ goto out;
+ }
+
+ for (i = 0; i < SMIAPP_NVM_PAGE_SIZE; i++) {
+--
+2.17.1
+
diff --git a/patches.suse/0001-mtd-cmdlinepart-Update-comment-for-introduction-of-O.patch b/patches.suse/0001-mtd-cmdlinepart-Update-comment-for-introduction-of-O.patch
new file mode 100644
index 0000000000..4ddbe5a09c
--- /dev/null
+++ b/patches.suse/0001-mtd-cmdlinepart-Update-comment-for-introduction-of-O.patch
@@ -0,0 +1,41 @@
+From 34c819073c8b8b652ced18e53bd2b0332dbe29cf Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue, 22 May 2018 17:07:53 +0200
+Subject: [PATCH] mtd: cmdlinepart: Update comment for introduction of
+ OFFSET_CONTINUOUS
+Git-commit: 34c819073c8b8b652ced18e53bd2b0332dbe29cf
+Patch-mainline: v4.18-rc1
+References: bsc#1099918
+
+The comment about offset zero was not updated when changing behavior:
+ - Automatic offset calculation is indicated by OFFSET_CONTINUOUS,
+ - Zero really means offset zero.
+
+Fixes: b175d03dd2072836 ("[PATCH] mtd cmdlinepart: allow zero offset value")
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+
+---
+ drivers/mtd/cmdlinepart.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
+index fbd5affc0acf..3ea44cff9b75 100644
+--- a/drivers/mtd/cmdlinepart.c
++++ b/drivers/mtd/cmdlinepart.c
+@@ -190,7 +190,10 @@ static struct mtd_partition * newpart(char *s,
+ extra_mem = (unsigned char *)(parts + *num_parts);
+ }
+
+- /* enter this partition (offset will be calculated later if it is zero at this point) */
++ /*
++ * enter this partition (offset will be calculated later if it is
++ * OFFSET_CONTINUOUS at this point)
++ */
+ parts[this_part].size = size;
+ parts[this_part].offset = offset;
+ parts[this_part].mask_flags = mask_flags;
+--
+2.17.1
+
diff --git a/patches.suse/0001-mtd-partitions-add-helper-for-deleting-partition.patch b/patches.suse/0001-mtd-partitions-add-helper-for-deleting-partition.patch
new file mode 100644
index 0000000000..0f13561617
--- /dev/null
+++ b/patches.suse/0001-mtd-partitions-add-helper-for-deleting-partition.patch
@@ -0,0 +1,125 @@
+From 08263a9ae664b24fa777d20b365601534842b236 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 21 Jun 2017 08:26:42 +0200
+Subject: [PATCH] mtd: partitions: add helper for deleting partition
+Git-commit: 08263a9ae664b24fa777d20b365601534842b236
+Patch-mainline: v4.13-rc1
+References: bsc#1099918
+
+There are two similar functions handling deletion. One handles single
+partition and another the whole MTD flash device. They share (duplicate)
+some code so it makes sense to add a small helper for that part.
+
+Function del_mtd_partitions has been moved a bit to keep all deleting
+stuff together.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/mtd/mtdpart.c | 75 +++++++++++++++++++++++++------------------
+ 1 file changed, 43 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
+index 7ececd3d7799..bcec72148d0b 100644
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -363,32 +363,6 @@ static inline void free_partition(struct mtd_part *p)
+ kfree(p);
+ }
+
+-/*
+- * This function unregisters and destroy all slave MTD objects which are
+- * attached to the given master MTD object.
+- */
+-
+-int del_mtd_partitions(struct mtd_info *master)
+-{
+- struct mtd_part *slave, *next;
+- int ret, err = 0;
+-
+- mutex_lock(&mtd_partitions_mutex);
+- list_for_each_entry_safe(slave, next, &mtd_partitions, list)
+- if (slave->master == master) {
+- ret = del_mtd_device(&slave->mtd);
+- if (ret < 0) {
+- err = ret;
+- continue;
+- }
+- list_del(&slave->list);
+- free_partition(slave);
+- }
+- mutex_unlock(&mtd_partitions_mutex);
+-
+- return err;
+-}
+-
+ static struct mtd_part *allocate_partition(struct mtd_info *master,
+ const struct mtd_partition *part, int partno,
+ uint64_t cur_offset)
+@@ -675,6 +649,48 @@ int mtd_add_partition(struct mtd_info *master, const char *name,
+ }
+ EXPORT_SYMBOL_GPL(mtd_add_partition);
+
++/**
++ * __mtd_del_partition - delete MTD partition
++ *
++ * @priv: internal MTD struct for partition to be deleted
++ *
++ * This function must be called with the partitions mutex locked.
++ */
++static int __mtd_del_partition(struct mtd_part *priv)
++{
++ int err;
++
++ err = del_mtd_device(&priv->mtd);
++ if (err)
++ return err;
++
++ list_del(&priv->list);
++ free_partition(priv);
++
++ return 0;
++}
++
++/*
++ * This function unregisters and destroy all slave MTD objects which are
++ * attached to the given master MTD object.
++ */
++int del_mtd_partitions(struct mtd_info *master)
++{
++ struct mtd_part *slave, *next;
++ int ret, err = 0;
++
++ mutex_lock(&mtd_partitions_mutex);
++ list_for_each_entry_safe(slave, next, &mtd_partitions, list)
++ if (slave->master == master) {
++ ret = __mtd_del_partition(slave);
++ if (ret < 0)
++ err = ret;
++ }
++ mutex_unlock(&mtd_partitions_mutex);
++
++ return err;
++}
++
+ int mtd_del_partition(struct mtd_info *master, int partno)
+ {
+ struct mtd_part *slave, *next;
+@@ -686,12 +702,7 @@ int mtd_del_partition(struct mtd_info *master, int partno)
+ (slave->mtd.index == partno)) {
+ sysfs_remove_files(&slave->mtd.dev.kobj,
+ mtd_partition_attrs);
+- ret = del_mtd_device(&slave->mtd);
+- if (ret < 0)
+- break;
+-
+- list_del(&slave->list);
+- free_partition(slave);
++ ret = __mtd_del_partition(slave);
+ break;
+ }
+ mutex_unlock(&mtd_partitions_mutex);
+--
+2.17.1
+
diff --git a/patches.suse/0001-mtd-partitions-remove-sysfs-files-when-deleting-all-.patch b/patches.suse/0001-mtd-partitions-remove-sysfs-files-when-deleting-all-.patch
new file mode 100644
index 0000000000..81db727f6d
--- /dev/null
+++ b/patches.suse/0001-mtd-partitions-remove-sysfs-files-when-deleting-all-.patch
@@ -0,0 +1,52 @@
+From c5ceaba74083daf619bdb34d4871e297a177eebf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 21 Jun 2017 08:26:43 +0200
+Subject: [PATCH] mtd: partitions: remove sysfs files when deleting all
+ master's partitions
+Git-commit: c5ceaba74083daf619bdb34d4871e297a177eebf
+Patch-mainline: v4.13-rc1
+References: bsc#1099918
+
+When support for sysfs "offset" file was added it missed to update the
+del_mtd_partitions function. It deletes partitions just like
+mtd_del_partition does so both should also take care of removing sysfs
+files.
+
+This change moves sysfs_remove_files call to the shared function to fix
+this issue.
+
+Fixes: a62c24d755291 ("mtd: part: Add sysfs variable for offset of partition")
+Cc: Dan Ehrenberg <dehrenberg@chromium.org>
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+
+---
+ drivers/mtd/mtdpart.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
+index bcec72148d0b..9434050accc7 100644
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -660,6 +660,8 @@ static int __mtd_del_partition(struct mtd_part *priv)
+ {
+ int err;
+
++ sysfs_remove_files(&priv->mtd.dev.kobj, mtd_partition_attrs);
++
+ err = del_mtd_device(&priv->mtd);
+ if (err)
+ return err;
+@@ -700,8 +702,6 @@ int mtd_del_partition(struct mtd_info *master, int partno)
+ list_for_each_entry_safe(slave, next, &mtd_partitions, list)
+ if ((slave->master == master) &&
+ (slave->mtd.index == partno)) {
+- sysfs_remove_files(&slave->mtd.dev.kobj,
+- mtd_partition_attrs);
+ ret = __mtd_del_partition(slave);
+ break;
+ }
+--
+2.17.1
+
diff --git a/series.conf b/series.conf
index 45856751f5..becb04524e 100644
--- a/series.conf
+++ b/series.conf
@@ -3944,6 +3944,8 @@
patches.suse/0001-softirq-Let-ksoftirqd-do-its-job.patch
patches.suse/0001-tick-broadcast-Reduce-lock-cacheline-contention.patch
+ patches.fixes/alarmtimer-Prevent-overflow-for-relative-nanosleep.patch
+
########################################################
# futex
########################################################
@@ -15909,12 +15911,15 @@
patches.fixes/0001-net-mlx5-Fix-driver-load-error-flow-when-firmware-is.patch
patches.drivers/net-mlx5-Cancel-delayed-recovery-work-when-unloading.patch
patches.drivers/net-mlx5e-Fix-TX-carrier-errors-report-in-get-stats-.patch
+ patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
patches.drivers/hns-0005-net-hns-Fix-a-skb-used-after-free-bug.patch
patches.drivers/net-mlx5e-Initialize-CEE-s-getpermhwaddr-address-buf.patch
patches.drivers/bnxt_en-Fix-race-conditions-in-.ndo_get_stats64.patch
patches.drivers/bnxt_en-Fix-bug-in-ethtool-L.patch
patches.drivers/bnxt_en-Fix-SRIOV-on-big-endian-architecture.patch
patches.fixes/net-hns-Bugfix-for-Tx-timeout-handling-in-hns-driver.patch
+ patches.suse/0001-mtd-partitions-add-helper-for-deleting-partition.patch
+ patches.suse/0001-mtd-partitions-remove-sysfs-files-when-deleting-all-.patch
patches.drivers/mlx5-Avoid-that-mlx5_ib_sg_to_klms-overflows-the-klm.patch
patches.drivers/IB-core-Add-ordered-workqueue-for-RoCE-GID-managemen.patch
patches.drivers/xgene-sp3-0024-xgene-Don-t-fail-probe-if-there-is-no-clk-resource-f.patch
@@ -15946,6 +15951,7 @@
patches.drivers/xgene-sp3-0025-xgene-Always-get-clk-source-but-ignore-if-it-s-missi.patch
patches.drivers/net-mlx4_core-Enable-4K-UAR-if-SRIOV-module-paramete.patch
patches.drivers/IB-mlx5-Fix-Raw-Packet-QP-event-handler-assignment.patch
+ patches.suse/0001-dm-fix-printk-rate-limiting-code.patch
patches.suse/esp-Fix-memleaks-on-error-paths.patch
patches.drivers/bnxt_en-Free-MSIX-vectors-when-unregistering-the-dev.patch
patches.drivers/bnxt_en-Do-not-setup-MAC-address-in-bnxt_hwrm_func_q.patch
@@ -16210,6 +16216,8 @@
patches.drivers/ibmvnic-Introduce-hard-reset-recovery.patch
patches.fixes/ipv6-omit-traffic-class-when-calculating-flow-hash.patch
patches.fixes/e1000e-Ignore-TSYNCRXCTL-when-getting-I219-clock-att.patch
+ patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch
+ patches.suse/0001-mtd-cmdlinepart-Update-comment-for-introduction-of-O.patch
patches.drivers/scsi-ipr-new-IOASC-update.patch
# mkp/scsi queue