From: Greg Kroah-Hartman Date: Wed, 4 Jan 2023 13:03:49 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v6.1.4~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2388b72ab58b8566a5bb4ded35144654b79d4b1e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: arm-ux500-do-not-directly-dereference-__iomem.patch ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch media-stv0288-use-explicitly-signed-char.patch selftests-use-optional-usercflags-and-userldflags.patch soc-qcom-select-remap_mmio-for-llcc-driver.patch --- diff --git a/queue-4.19/arm-ux500-do-not-directly-dereference-__iomem.patch b/queue-4.19/arm-ux500-do-not-directly-dereference-__iomem.patch new file mode 100644 index 00000000000..c47f914bd0d --- /dev/null +++ b/queue-4.19/arm-ux500-do-not-directly-dereference-__iomem.patch @@ -0,0 +1,54 @@ +From 65b0e307a1a9193571db12910f382f84195a3d29 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Tue, 8 Nov 2022 13:37:55 +0100 +Subject: ARM: ux500: do not directly dereference __iomem + +From: Jason A. Donenfeld + +commit 65b0e307a1a9193571db12910f382f84195a3d29 upstream. + +Sparse reports that calling add_device_randomness() on `uid` is a +violation of address spaces. And indeed the next usage uses readl() +properly, but that was left out when passing it toadd_device_ +randomness(). So instead copy the whole thing to the stack first. + +Fixes: 4040d10a3d44 ("ARM: ux500: add DB serial number to entropy pool") +Cc: Linus Walleij +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/all/202210230819.loF90KDh-lkp@intel.com/ +Reported-by: kernel test robot +Signed-off-by: Jason A. Donenfeld +Link: https://lore.kernel.org/r/20221108123755.207438-1-Jason@zx2c4.com +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/ux500/ux500-soc-id.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/drivers/soc/ux500/ux500-soc-id.c ++++ b/drivers/soc/ux500/ux500-soc-id.c +@@ -159,20 +159,18 @@ static ssize_t ux500_get_process(struct + static const char *db8500_read_soc_id(struct device_node *backupram) + { + void __iomem *base; +- void __iomem *uid; + const char *retstr; ++ u32 uid[5]; + + base = of_iomap(backupram, 0); + if (!base) + return NULL; +- uid = base + 0x1fc0; ++ memcpy_fromio(uid, base + 0x1fc0, sizeof(uid)); + + /* Throw these device-specific numbers into the entropy pool */ +- add_device_randomness(uid, 0x14); ++ add_device_randomness(uid, sizeof(uid)); + retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", +- readl((u32 *)uid+0), +- readl((u32 *)uid+1), readl((u32 *)uid+2), +- readl((u32 *)uid+3), readl((u32 *)uid+4)); ++ uid[0], uid[1], uid[2], uid[3], uid[4]); + iounmap(base); + return retstr; + } diff --git a/queue-4.19/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch b/queue-4.19/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch new file mode 100644 index 00000000000..80a1a38b21e --- /dev/null +++ b/queue-4.19/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch @@ -0,0 +1,45 @@ +From ef784eebb56425eed6e9b16e7d47e5c00dcf9c38 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Fri, 2 Dec 2022 11:59:36 -0500 +Subject: ktest.pl minconfig: Unset configs instead of just removing them + +From: Steven Rostedt + +commit ef784eebb56425eed6e9b16e7d47e5c00dcf9c38 upstream. + +After a full run of a make_min_config test, I noticed there were a lot of +CONFIGs still enabled that really should not be. Looking at them, I +noticed they were all defined as "default y". The issue is that the test +simple removes the config and re-runs make oldconfig, which enables it +again because it is set to default 'y'. Instead, explicitly disable the +config with writing "# CONFIG_FOO is not set" to the file to keep it from +being set again. + +With this change, one of my box's minconfigs went from 768 configs set, +down to 521 configs set. + +Link: https://lkml.kernel.org/r/20221202115936.016fce23@gandalf.local.home + +Cc: stable@vger.kernel.org +Fixes: 0a05c769a9de5 ("ktest: Added config_bisect test type") +Reviewed-by: John 'Warthog9' Hawley (VMware) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/ktest/ktest.pl | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -3706,9 +3706,10 @@ sub test_this_config { + # .config to make sure it is missing the config that + # we had before + my %configs = %min_configs; +- delete $configs{$config}; ++ $configs{$config} = "# $config is not set"; + make_new_config ((values %configs), (values %keep_configs)); + make_oldconfig; ++ delete $configs{$config}; + undef %configs; + assign_configs \%configs, $output_config; + diff --git a/queue-4.19/media-stv0288-use-explicitly-signed-char.patch b/queue-4.19/media-stv0288-use-explicitly-signed-char.patch new file mode 100644 index 00000000000..b8ecb9eb071 --- /dev/null +++ b/queue-4.19/media-stv0288-use-explicitly-signed-char.patch @@ -0,0 +1,40 @@ +From 7392134428c92a4cb541bd5c8f4f5c8d2e88364d Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 24 Oct 2022 17:23:43 +0200 +Subject: media: stv0288: use explicitly signed char + +From: Jason A. Donenfeld + +commit 7392134428c92a4cb541bd5c8f4f5c8d2e88364d upstream. + +With char becoming unsigned by default, and with `char` alone being +ambiguous and based on architecture, signed chars need to be marked +explicitly as such. Use `s8` and `u8` types here, since that's what +surrounding code does. This fixes: + +drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: assigning (-9) to unsigned variable 'tm' +drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: we never enter this loop + +Cc: Mauro Carvalho Chehab +Cc: linux-media@vger.kernel.org +Cc: stable@vger.kernel.org +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/dvb-frontends/stv0288.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/media/dvb-frontends/stv0288.c ++++ b/drivers/media/dvb-frontends/stv0288.c +@@ -452,9 +452,8 @@ static int stv0288_set_frontend(struct d + struct stv0288_state *state = fe->demodulator_priv; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; + +- char tm; +- unsigned char tda[3]; +- u8 reg, time_out = 0; ++ u8 tda[3], reg, time_out = 0; ++ s8 tm; + + dprintk("%s : FE_SET_FRONTEND\n", __func__); + diff --git a/queue-4.19/selftests-use-optional-usercflags-and-userldflags.patch b/queue-4.19/selftests-use-optional-usercflags-and-userldflags.patch new file mode 100644 index 00000000000..c4fc0d3b852 --- /dev/null +++ b/queue-4.19/selftests-use-optional-usercflags-and-userldflags.patch @@ -0,0 +1,45 @@ +From de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= +Date: Fri, 9 Sep 2022 12:39:01 +0200 +Subject: selftests: Use optional USERCFLAGS and USERLDFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mickaël Salaün + +commit de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 upstream. + +This change enables to extend CFLAGS and LDFLAGS from command line, e.g. +to extend compiler checks: make USERCFLAGS=-Werror USERLDFLAGS=-static + +USERCFLAGS and USERLDFLAGS are documented in +Documentation/kbuild/makefiles.rst and Documentation/kbuild/kbuild.rst + +This should be backported (down to 5.10) to improve previous kernel +versions testing as well. + +Cc: Shuah Khan +Cc: stable@vger.kernel.org +Signed-off-by: Mickaël Salaün +Link: https://lore.kernel.org/r/20220909103901.1503436-1-mic@digikod.net +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/lib.mk | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/tools/testing/selftests/lib.mk ++++ b/tools/testing/selftests/lib.mk +@@ -144,6 +144,11 @@ endef + clean: + $(CLEAN) + ++# Enables to extend CFLAGS and LDFLAGS from command line, e.g. ++# make USERCFLAGS=-Werror USERLDFLAGS=-static ++CFLAGS += $(USERCFLAGS) ++LDFLAGS += $(USERLDFLAGS) ++ + # When make O= with kselftest target from main level + # the following aren't defined. + # diff --git a/queue-4.19/series b/queue-4.19/series index 2d65b5c6af0..a451ea9038c 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -375,3 +375,8 @@ mmc-vub300-fix-warning-do-not-call-blocking-ops-when-task_running.patch tpm-tpm_crb-add-the-missed-acpi_put_table-to-fix-memory-leak.patch tpm-tpm_tis-add-the-missed-acpi_put_table-to-fix-memory-leak.patch sunrpc-don-t-leak-netobj-memory-when-gss_read_proxy_verf-fails.patch +media-stv0288-use-explicitly-signed-char.patch +soc-qcom-select-remap_mmio-for-llcc-driver.patch +ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch +arm-ux500-do-not-directly-dereference-__iomem.patch +selftests-use-optional-usercflags-and-userldflags.patch diff --git a/queue-4.19/soc-qcom-select-remap_mmio-for-llcc-driver.patch b/queue-4.19/soc-qcom-select-remap_mmio-for-llcc-driver.patch new file mode 100644 index 00000000000..487ffefb1ec --- /dev/null +++ b/queue-4.19/soc-qcom-select-remap_mmio-for-llcc-driver.patch @@ -0,0 +1,38 @@ +From 5d2fe2d7b616b8baa18348ead857b504fc2de336 Mon Sep 17 00:00:00 2001 +From: Manivannan Sadhasivam +Date: Tue, 29 Nov 2022 12:41:59 +0530 +Subject: soc: qcom: Select REMAP_MMIO for LLCC driver + +From: Manivannan Sadhasivam + +commit 5d2fe2d7b616b8baa18348ead857b504fc2de336 upstream. + +LLCC driver uses REGMAP_MMIO for accessing the hardware registers. So +select the dependency in Kconfig. Without this, there will be errors +while building the driver with COMPILE_TEST only: + +ERROR: modpost: "__devm_regmap_init_mmio_clk" [drivers/soc/qcom/llcc-qcom.ko] undefined! +make[1]: *** [scripts/Makefile.modpost:126: Module.symvers] Error 1 +make: *** [Makefile:1944: modpost] Error 2 + +Cc: # 4.19 +Fixes: a3134fb09e0b ("drivers: soc: Add LLCC driver") +Reported-by: Borislav Petkov +Signed-off-by: Manivannan Sadhasivam +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20221129071201.30024-2-manivannan.sadhasivam@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/qcom/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/soc/qcom/Kconfig ++++ b/drivers/soc/qcom/Kconfig +@@ -16,6 +16,7 @@ config QCOM_COMMAND_DB + config QCOM_GENI_SE + tristate "QCOM GENI Serial Engine Driver" + depends on ARCH_QCOM || COMPILE_TEST ++ select REGMAP_MMIO + help + This driver is used to manage Generic Interface (GENI) firmware based + Qualcomm Technologies, Inc. Universal Peripheral (QUP) Wrapper. This