From: Greg Kroah-Hartman Date: Wed, 4 Jan 2023 13:01:34 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v6.1.4~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a39a119addb27f3c26c927a9efbcb35f730dfe6;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-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 --- diff --git a/queue-4.9/arm-ux500-do-not-directly-dereference-__iomem.patch b/queue-4.9/arm-ux500-do-not-directly-dereference-__iomem.patch new file mode 100644 index 00000000000..c47f914bd0d --- /dev/null +++ b/queue-4.9/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.9/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch b/queue-4.9/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch new file mode 100644 index 00000000000..761477e335e --- /dev/null +++ b/queue-4.9/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 +@@ -3751,9 +3751,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.9/media-stv0288-use-explicitly-signed-char.patch b/queue-4.9/media-stv0288-use-explicitly-signed-char.patch new file mode 100644 index 00000000000..b8ecb9eb071 --- /dev/null +++ b/queue-4.9/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.9/series b/queue-4.9/series index ebe8529b04c..dbdd3ec74bf 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -223,3 +223,6 @@ alsa-line6-fix-stack-overflow-in-line6_midi_transmit.patch pnode-terminate-at-peers-of-source.patch md-fix-a-crash-in-mempool_free.patch mmc-vub300-fix-warning-do-not-call-blocking-ops-when-task_running.patch +media-stv0288-use-explicitly-signed-char.patch +ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch +arm-ux500-do-not-directly-dereference-__iomem.patch