Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-08-20 14:08:53 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-08-20 14:12:24 +0200
commitf2d253678e643e749c25560bf538b229e0e2560d (patch)
tree4dc2b00b499d60e52f557f4fa863d6a7db665927
parent8cdb4f1074491a407f6416aabcdd6c44a0d38dc1 (diff)
powerpc/fadump: use kstrtoint to handle sysfs store
(bsc#1146376). - Refresh patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch.
-rw-r--r--patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch10
-rw-r--r--patches.arch/powerpc-fadump-use-kstrtoint-to-handle-sysfs-store.patch77
-rw-r--r--series.conf1
3 files changed, 83 insertions, 5 deletions
diff --git a/patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch b/patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch
index 2a99a71cb8..093078a2e2 100644
--- a/patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch
+++ b/patches.arch/powerpc-fadump-re-register-firmware-assisted-dump-if.patch
@@ -1,4 +1,4 @@
-From f5aa3c72fe11280467d94e8d420b009b7acb074c Mon Sep 17 00:00:00 2001
+From 0823c68b054bca9dc321adea829af5cf36afb30b Mon Sep 17 00:00:00 2001
From: Hari Bathini <hbathini@linux.ibm.com>
Date: Fri, 14 Sep 2018 19:36:02 +0530
Subject: [PATCH] powerpc/fadump: re-register firmware-assisted dump if already
@@ -29,12 +29,12 @@ Acked-by: Michal Suchanek <msuchanek@suse.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
-index fa4de264b747..0894ac5519b2 100644
+index a711d22339ea..761b28b1427d 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
-@@ -1435,8 +1435,8 @@ static ssize_t fadump_register_store(struct kobject *kobj,
+@@ -1444,8 +1444,8 @@ static ssize_t fadump_register_store(struct kobject *kobj,
break;
- case '1':
+ case 1:
if (fw_dump.dump_registered == 1) {
- ret = -EEXIST;
- goto unlock_out;
@@ -44,5 +44,5 @@ index fa4de264b747..0894ac5519b2 100644
/* Register Firmware-assisted dump */
ret = register_fadump();
--
-2.13.7
+2.22.0
diff --git a/patches.arch/powerpc-fadump-use-kstrtoint-to-handle-sysfs-store.patch b/patches.arch/powerpc-fadump-use-kstrtoint-to-handle-sysfs-store.patch
new file mode 100644
index 0000000000..57487f9273
--- /dev/null
+++ b/patches.arch/powerpc-fadump-use-kstrtoint-to-handle-sysfs-store.patch
@@ -0,0 +1,77 @@
+From dcdc46794b7bb76733d9792cca2f45871d66881f Mon Sep 17 00:00:00 2001
+From: Michal Suchanek <msuchanek@suse.de>
+Date: Mon, 26 Jun 2017 16:06:01 +0200
+Subject: [PATCH] powerpc/fadump: use kstrtoint to handle sysfs store
+
+References: bsc#1146376
+Patch-mainline: v4.15-rc1
+Git-commit: dcdc46794b7bb76733d9792cca2f45871d66881f
+
+Currently sysfs store handlers in fadump use if buf[0] == 'char'.
+
+This means input "100foo" is interpreted as '1' and "01" as '0'.
+
+Change to kstrtoint so leading zeroes and the like is handled in
+expected way.
+
+Signed-off-by: Michal Suchanek <msuchanek@suse.de>
+Acked-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
+Signed-off-by: Michal Suchanek <a class="moz-txt-link-rfc2396E" href="mailto:msuchanek@suse.de">&lt;msuchanek@suse.de&gt;</a></pre>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+---
+ arch/powerpc/kernel/fadump.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
+index e1431800bfb9..04ea5c04fd24 100644
+--- a/arch/powerpc/kernel/fadump.c
++++ b/arch/powerpc/kernel/fadump.c
+@@ -1270,10 +1270,15 @@ static ssize_t fadump_release_memory_store(struct kobject *kobj,
+ struct kobj_attribute *attr,
+ const char *buf, size_t count)
+ {
++ int input = -1;
++
+ if (!fw_dump.dump_active)
+ return -EPERM;
+
+- if (buf[0] == '1') {
++ if (kstrtoint(buf, 0, &input))
++ return -EINVAL;
++
++ if (input == 1) {
+ /*
+ * Take away the '/proc/vmcore'. We are releasing the dump
+ * memory, hence it will not be valid anymore.
+@@ -1307,21 +1312,25 @@ static ssize_t fadump_register_store(struct kobject *kobj,
+ const char *buf, size_t count)
+ {
+ int ret = 0;
++ int input = -1;
+
+ if (!fw_dump.fadump_enabled || fdm_active)
+ return -EPERM;
+
++ if (kstrtoint(buf, 0, &input))
++ return -EINVAL;
++
+ mutex_lock(&fadump_mutex);
+
+- switch (buf[0]) {
+- case '0':
++ switch (input) {
++ case 0:
+ if (fw_dump.dump_registered == 0) {
+ goto unlock_out;
+ }
+ /* Un-register Firmware-assisted dump */
+ fadump_unregister_dump(&fdm);
+ break;
+- case '1':
++ case 1:
+ if (fw_dump.dump_registered == 1) {
+ ret = -EEXIST;
+ goto unlock_out;
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 7cac40ebf7..49d19d3a24 100644
--- a/series.conf
+++ b/series.conf
@@ -10163,6 +10163,7 @@
patches.arch/powerpc-powernv-idle-Round-up-latency-and-residency-.patch
patches.arch/powerpc-powernv-npu-Use-flush_all_mm-instead-of-flus.patch
patches.arch/powerpc-powernv-npu-Don-t-explicitly-flush-nmmu-tlb.patch
+ patches.arch/powerpc-fadump-use-kstrtoint-to-handle-sysfs-store.patch
patches.arch/powerpc-signal-Properly-handle-return-value-from-upr.patch
patches.arch/powerpc-Fix-DABR-match-on-hash-based-systems.patch
patches.arch/powerpc-64s-hash-Fix-512T-hint-detection-to-use-128T.patch