Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2019-09-17 09:12:35 +0200
committerJean Delvare <jdelvare@suse.de>2019-10-03 10:20:57 +0200
commit8b5e3938213dadc6541cb0ca9e70ee91e40d8c9c (patch)
treed8e392d1c615eefe26530244f1ef18f9513e4cca
parent8fe9fe9b2624436c6d2ce26ab99deaa306922dc4 (diff)
nvmem: Use the same permissions for eeprom as for nvmem
(git-fixes).
-rw-r--r--patches.suse/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch50
-rw-r--r--series.conf1
2 files changed, 51 insertions, 0 deletions
diff --git a/patches.suse/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch b/patches.suse/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch
new file mode 100644
index 0000000000..17bcffdafc
--- /dev/null
+++ b/patches.suse/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch
@@ -0,0 +1,50 @@
+From: Jean Delvare <jdelvare@suse.de>
+Date: Sun, 28 Jul 2019 18:42:55 +0200
+Subject: [PATCH] nvmem: Use the same permissions for eeprom as for nvmem
+Git-commit: e70d8b287301eb6d7c7761c6171c56af62110ea3
+Patch-mainline: v5.3
+References: git-fixes
+
+The compatibility "eeprom" attribute is currently root-only no
+matter what the configuration says. The "nvmem" attribute does
+respect the setting of the root_only configuration bit, so do the
+same for "eeprom".
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: b6c217ab9be6 ("nvmem: Add backwards compatibility support for older EEPROM drivers.")
+Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Link: https://lore.kernel.org/r/20190728184255.563332e6@endymion
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+
+---
+ drivers/nvmem/core.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -401,10 +401,17 @@ static int nvmem_setup_compat(struct nvm
+ if (!config->base_dev)
+ return -EINVAL;
+
+- if (nvmem->read_only)
+- nvmem->eeprom = bin_attr_ro_root_nvmem;
+- else
+- nvmem->eeprom = bin_attr_rw_root_nvmem;
++ if (nvmem->read_only) {
++ if (config->root_only)
++ nvmem->eeprom = bin_attr_ro_root_nvmem;
++ else
++ nvmem->eeprom = bin_attr_ro_nvmem;
++ } else {
++ if (config->root_only)
++ nvmem->eeprom = bin_attr_rw_root_nvmem;
++ else
++ nvmem->eeprom = bin_attr_rw_nvmem;
++ }
+ nvmem->eeprom.attr.name = "eeprom";
+ nvmem->eeprom.size = nvmem->size;
+ #ifdef CONFIG_DEBUG_LOCK_ALLOC
diff --git a/series.conf b/series.conf
index fc07586165..1561b82a94 100644
--- a/series.conf
+++ b/series.conf
@@ -24338,6 +24338,7 @@
patches.suse/usb-iowarrior-fix-deadlock-on-disconnect.patch
patches.suse/iio-adc-max9611-Fix-misuse-of-GENMASK-macro.patch
patches.suse/driver_core-Fix_use-after-free_and_double_free_on_glue.patch
+ patches.suse/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch
patches.suse/mm-hmm-fix-bad-subpage-pointer-in-try_to_unmap_one.patch
patches.suse/mm-memcontrol-c-fix-use-after-free-in-mem_cgroup_iter.patch
patches.suse/iommu-dma-handle-sg-length-overflow-better