]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 13:01:47 +0000 (14:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 13:01:47 +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
selftests-use-optional-usercflags-and-userldflags.patch

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

diff --git a/queue-4.14/arm-ux500-do-not-directly-dereference-__iomem.patch b/queue-4.14/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.14/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch b/queue-4.14/ktest.pl-minconfig-unset-configs-instead-of-just-removing-them.patch
new file mode 100644 (file)
index 0000000..894ac50
--- /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
+@@ -3797,9 +3797,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.14/media-stv0288-use-explicitly-signed-char.patch b/queue-4.14/media-stv0288-use-explicitly-signed-char.patch
new file mode 100644 (file)
index 0000000..f1d7a30
--- /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
+@@ -458,9 +458,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.14/selftests-use-optional-usercflags-and-userldflags.patch b/queue-4.14/selftests-use-optional-usercflags-and-userldflags.patch
new file mode 100644 (file)
index 0000000..b6a658a
--- /dev/null
@@ -0,0 +1,45 @@
+From de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= <mic@digikod.net>
+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 <mic@digikod.net>
+
+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 <skhan@linuxfoundation.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Mickaël Salaün <mic@digikod.net>
+Link: https://lore.kernel.org/r/20220909103901.1503436-1-mic@digikod.net
+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/lib.mk |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/tools/testing/selftests/lib.mk
++++ b/tools/testing/selftests/lib.mk
+@@ -103,6 +103,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.
+ #
index 4fe5c2e239f069a4e717980f850b6cefaf566654..9e63338deaf6948b37144a1ae9c59e27f96ed356 100644 (file)
@@ -270,3 +270,7 @@ md-fix-a-crash-in-mempool_free.patch
 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
+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
+selftests-use-optional-usercflags-and-userldflags.patch