From: Greg Kroah-Hartman Date: Tue, 17 Sep 2019 18:19:26 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.14.145~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ac4542686de689ab5bc319f8519b945510073fb;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch --- diff --git a/queue-4.9/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch b/queue-4.9/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch new file mode 100644 index 00000000000..3bba135da4c --- /dev/null +++ b/queue-4.9/nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch @@ -0,0 +1,51 @@ +From e70d8b287301eb6d7c7761c6171c56af62110ea3 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Sun, 28 Jul 2019 18:42:55 +0200 +Subject: nvmem: Use the same permissions for eeprom as for nvmem + +From: Jean Delvare + +commit e70d8b287301eb6d7c7761c6171c56af62110ea3 upstream. + +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 +Fixes: b6c217ab9be6 ("nvmem: Add backwards compatibility support for older EEPROM drivers.") +Reviewed-by: Bartosz Golaszewski +Cc: Andrew Lunn +Cc: Srinivas Kandagatla +Cc: Arnd Bergmann +Link: https://lore.kernel.org/r/20190728184255.563332e6@endymion +Signed-off-by: Greg Kroah-Hartman + +--- + 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/queue-4.9/series b/queue-4.9/series index 208ab30dee3..57cb7f04531 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -30,3 +30,4 @@ crypto-talitos-fix-ecb-algs-ivsize.patch crypto-talitos-do-not-modify-req-cryptlen-on-decryption.patch crypto-talitos-hmac-snoop-no-afeu-mode-requires-sw-icv-checking.patch drm-mediatek-mtk_drm_drv.c-add-of_node_put-before-goto.patch +nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch