]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 13:01:34 +0000 (14:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 13:01:34 +0000 (14:01 +0100)
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

queue-4.9/arm-ux500-do-not-directly-dereference-__iomem.patch [new file with mode: 0644]
queue-4.9/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch [new file with mode: 0644]
queue-4.9/media-stv0288-use-explicitly-signed-char.patch [new file with mode: 0644]
queue-4.9/series

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 (file)
index 0000000..c47f914
--- /dev/null
@@ -0,0 +1,54 @@
+From 65b0e307a1a9193571db12910f382f84195a3d29 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Tue, 8 Nov 2022 13:37:55 +0100
+Subject: ARM: ux500: do not directly dereference __iomem
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+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 <linus.walleij@linaro.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/all/202210230819.loF90KDh-lkp@intel.com/
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Link: https://lore.kernel.org/r/20221108123755.207438-1-Jason@zx2c4.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..761477e
--- /dev/null
@@ -0,0 +1,45 @@
+From ef784eebb56425eed6e9b16e7d47e5c00dcf9c38 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <rostedt@goodmis.org>
+Date: Fri, 2 Dec 2022 11:59:36 -0500
+Subject: ktest.pl minconfig: Unset configs instead of just removing them
+
+From: Steven Rostedt <rostedt@goodmis.org>
+
+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) <warthog9@eaglescrag.net>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..b8ecb9e
--- /dev/null
@@ -0,0 +1,40 @@
+From 7392134428c92a4cb541bd5c8f4f5c8d2e88364d Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Mon, 24 Oct 2022 17:23:43 +0200
+Subject: media: stv0288: use explicitly signed char
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+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 <mchehab@kernel.org>
+Cc: linux-media@vger.kernel.org
+Cc: stable@vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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__);
index ebe8529b04c11ea17d564aa2df04f4fb641dc50a..dbdd3ec74bfd116b92d6e77174accad0832e88a9 100644 (file)
@@ -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