]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Sun, 30 Jun 2024 02:22:23 +0000 (22:22 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 30 Jun 2024 02:22:23 +0000 (22:22 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
14 files changed:
queue-5.10/alsa-emux-improve-patch-ioctl-data-validation.patch [new file with mode: 0644]
queue-5.10/bpf-add-a-check-for-struct-bpf_fib_lookup-size.patch [new file with mode: 0644]
queue-5.10/drm-panel-ilitek-ili9881c-fix-warning-with-gpio-cont.patch [new file with mode: 0644]
queue-5.10/drm-panel-simple-add-missing-display-timing-flags-fo.patch [new file with mode: 0644]
queue-5.10/drm-radeon-radeon_display-decrease-the-size-of-alloc.patch [new file with mode: 0644]
queue-5.10/gpio-davinci-validate-the-obtained-number-of-irqs.patch [new file with mode: 0644]
queue-5.10/gpiolib-cdev-disallow-reconfiguration-without-direct.patch [new file with mode: 0644]
queue-5.10/media-dvbdev-initialize-sbuf.patch [new file with mode: 0644]
queue-5.10/mtd-partitions-redboot-added-conversion-of-operands-.patch [new file with mode: 0644]
queue-5.10/net-dpaa2-avoid-explicit-cpumask-var-allocation-on-s.patch [new file with mode: 0644]
queue-5.10/net-iucv-avoid-explicit-cpumask-var-allocation-on-st.patch [new file with mode: 0644]
queue-5.10/nvme-fixup-comment-for-nvme-rdma-provider-type.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch [new file with mode: 0644]

diff --git a/queue-5.10/alsa-emux-improve-patch-ioctl-data-validation.patch b/queue-5.10/alsa-emux-improve-patch-ioctl-data-validation.patch
new file mode 100644 (file)
index 0000000..5296c38
--- /dev/null
@@ -0,0 +1,81 @@
+From 9bc8ccb8c5ce573cfd0438eb4b2ded35661e6d19 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 6 Apr 2024 08:48:20 +0200
+Subject: ALSA: emux: improve patch ioctl data validation
+
+From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
+
+[ Upstream commit 89b32ccb12ae67e630c6453d778ec30a592a212f ]
+
+In load_data(), make the validation of and skipping over the main info
+block match that in load_guspatch().
+
+In load_guspatch(), add checking that the specified patch length matches
+the actually supplied data, like load_data() already did.
+
+Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
+Message-ID: <20240406064830.1029573-8-oswald.buddenhagen@gmx.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/synth/emux/soundfont.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
+index 9ebc711afa6b5..18b2d84926563 100644
+--- a/sound/synth/emux/soundfont.c
++++ b/sound/synth/emux/soundfont.c
+@@ -697,7 +697,6 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
+       struct snd_soundfont *sf;
+       struct soundfont_sample_info sample_info;
+       struct snd_sf_sample *sp;
+-      long off;
+       /* patch must be opened */
+       if ((sf = sflist->currsf) == NULL)
+@@ -706,12 +705,16 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
+       if (is_special_type(sf->type))
+               return -EINVAL;
++      if (count < (long)sizeof(sample_info)) {
++              return -EINVAL;
++      }
+       if (copy_from_user(&sample_info, data, sizeof(sample_info)))
+               return -EFAULT;
++      data += sizeof(sample_info);
++      count -= sizeof(sample_info);
+-      off = sizeof(sample_info);
+-
+-      if (sample_info.size != (count-off)/2)
++      // SoundFont uses S16LE samples.
++      if (sample_info.size * 2 != count)
+               return -EINVAL;
+       /* Check for dup */
+@@ -738,7 +741,7 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
+               int  rc;
+               rc = sflist->callback.sample_new
+                       (sflist->callback.private_data, sp, sflist->memhdr,
+-                       data + off, count - off);
++                       data, count);
+               if (rc < 0) {
+                       sf_sample_delete(sflist, sf, sp);
+                       return rc;
+@@ -951,10 +954,12 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
+       }
+       if (copy_from_user(&patch, data, sizeof(patch)))
+               return -EFAULT;
+-      
+       count -= sizeof(patch);
+       data += sizeof(patch);
++      if ((patch.len << (patch.mode & WAVE_16_BITS ? 1 : 0)) != count)
++              return -EINVAL;
++
+       sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL);
+       if (sf == NULL)
+               return -ENOMEM;
+-- 
+2.43.0
+
diff --git a/queue-5.10/bpf-add-a-check-for-struct-bpf_fib_lookup-size.patch b/queue-5.10/bpf-add-a-check-for-struct-bpf_fib_lookup-size.patch
new file mode 100644 (file)
index 0000000..223ecab
--- /dev/null
@@ -0,0 +1,39 @@
+From 65bdbe217623857089728a30bd50c2706d95e444 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 26 Mar 2024 10:17:42 +0000
+Subject: bpf: Add a check for struct bpf_fib_lookup size
+
+From: Anton Protopopov <aspsk@isovalent.com>
+
+[ Upstream commit 59b418c7063d30e0a3e1f592d47df096db83185c ]
+
+The struct bpf_fib_lookup should not grow outside of its 64 bytes.
+Add a static assert to validate this.
+
+Suggested-by: David Ahern <dsahern@kernel.org>
+Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Link: https://lore.kernel.org/bpf/20240326101742.17421-4-aspsk@isovalent.com
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/core/filter.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/net/core/filter.c b/net/core/filter.c
+index 49e4d1535cc82..a3101cdfd47b9 100644
+--- a/net/core/filter.c
++++ b/net/core/filter.c
+@@ -78,6 +78,9 @@
+ #include <linux/btf_ids.h>
+ #include <net/tls.h>
++/* Keep the struct bpf_fib_lookup small so that it fits into a cacheline */
++static_assert(sizeof(struct bpf_fib_lookup) == 64, "struct bpf_fib_lookup size check");
++
+ static const struct bpf_func_proto *
+ bpf_sk_base_func_proto(enum bpf_func_id func_id);
+-- 
+2.43.0
+
diff --git a/queue-5.10/drm-panel-ilitek-ili9881c-fix-warning-with-gpio-cont.patch b/queue-5.10/drm-panel-ilitek-ili9881c-fix-warning-with-gpio-cont.patch
new file mode 100644 (file)
index 0000000..4a3f878
--- /dev/null
@@ -0,0 +1,54 @@
+From ee8e3a5d8c384ab71b5d2f3ec50e09cabe0dfc6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 17 Mar 2024 17:48:39 +0200
+Subject: drm/panel: ilitek-ili9881c: Fix warning with GPIO controllers that
+ sleep
+
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+
+[ Upstream commit ee7860cd8b5763017f8dc785c2851fecb7a0c565 ]
+
+The ilitek-ili9881c controls the reset GPIO using the non-sleeping
+gpiod_set_value() function. This complains loudly when the GPIO
+controller needs to sleep. As the caller can sleep, use
+gpiod_set_value_cansleep() to fix the issue.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
+Link: https://lore.kernel.org/r/20240317154839.21260-1-laurent.pinchart@ideasonboard.com
+Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240317154839.21260-1-laurent.pinchart@ideasonboard.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+index 534dd7414d428..917cb322bab1a 100644
+--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
++++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+@@ -506,10 +506,10 @@ static int ili9881c_prepare(struct drm_panel *panel)
+       msleep(5);
+       /* And reset it */
+-      gpiod_set_value(ctx->reset, 1);
++      gpiod_set_value_cansleep(ctx->reset, 1);
+       msleep(20);
+-      gpiod_set_value(ctx->reset, 0);
++      gpiod_set_value_cansleep(ctx->reset, 0);
+       msleep(20);
+       for (i = 0; i < ctx->desc->init_length; i++) {
+@@ -564,7 +564,7 @@ static int ili9881c_unprepare(struct drm_panel *panel)
+       mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
+       regulator_disable(ctx->power);
+-      gpiod_set_value(ctx->reset, 1);
++      gpiod_set_value_cansleep(ctx->reset, 1);
+       return 0;
+ }
+-- 
+2.43.0
+
diff --git a/queue-5.10/drm-panel-simple-add-missing-display-timing-flags-fo.patch b/queue-5.10/drm-panel-simple-add-missing-display-timing-flags-fo.patch
new file mode 100644 (file)
index 0000000..04831ba
--- /dev/null
@@ -0,0 +1,40 @@
+From e36f72c7aa38757671e6c210bef9dadc93311f22 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 24 Jun 2024 09:56:12 +0800
+Subject: drm/panel: simple: Add missing display timing flags for KOE
+ TX26D202VM0BWA
+
+From: Liu Ying <victor.liu@nxp.com>
+
+[ Upstream commit 37ce99b77762256ec9fda58d58fd613230151456 ]
+
+KOE TX26D202VM0BWA panel spec indicates the DE signal is active high in
+timing chart, so add DISPLAY_FLAGS_DE_HIGH flag in display timing flags.
+This aligns display_timing with panel_desc.
+
+Fixes: 8a07052440c2 ("drm/panel: simple: Add support for KOE TX26D202VM0BWA panel")
+Signed-off-by: Liu Ying <victor.liu@nxp.com>
+Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
+Link: https://lore.kernel.org/r/20240624015612.341983-1-victor.liu@nxp.com
+Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240624015612.341983-1-victor.liu@nxp.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/panel/panel-simple.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
+index 7797aad592a19..07b59021008ea 100644
+--- a/drivers/gpu/drm/panel/panel-simple.c
++++ b/drivers/gpu/drm/panel/panel-simple.c
+@@ -2438,6 +2438,7 @@ static const struct display_timing koe_tx26d202vm0bwa_timing = {
+       .vfront_porch = { 3, 5, 10 },
+       .vback_porch = { 2, 5, 10 },
+       .vsync_len = { 5, 5, 5 },
++      .flags = DISPLAY_FLAGS_DE_HIGH,
+ };
+ static const struct panel_desc koe_tx26d202vm0bwa = {
+-- 
+2.43.0
+
diff --git a/queue-5.10/drm-radeon-radeon_display-decrease-the-size-of-alloc.patch b/queue-5.10/drm-radeon-radeon_display-decrease-the-size-of-alloc.patch
new file mode 100644 (file)
index 0000000..1bcdd5a
--- /dev/null
@@ -0,0 +1,79 @@
+From a2a39d99f662e76aa387229cca857983f0c65793 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 30 Mar 2024 17:34:47 +0100
+Subject: drm/radeon/radeon_display: Decrease the size of allocated memory
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Erick Archer <erick.archer@outlook.com>
+
+[ Upstream commit ae6a233092747e9652eb793d92f79d0820e01c6a ]
+
+This is an effort to get rid of all multiplications from allocation
+functions in order to prevent integer overflows [1] [2].
+
+In this case, the memory allocated to store RADEONFB_CONN_LIMIT pointers
+to "drm_connector" structures can be avoided. This is because this
+memory area is never accessed.
+
+Also, in the kzalloc function, it is preferred to use sizeof(*pointer)
+instead of sizeof(type) due to the type of the variable can change and
+one needs not change the former (unlike the latter).
+
+At the same time take advantage to remove the "#if 0" block, the code
+where the removed memory area was accessed, and the RADEONFB_CONN_LIMIT
+constant due to now is never used.
+
+Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1]
+Link: https://github.com/KSPP/linux/issues/160 [2]
+Acked-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Erick Archer <erick.archer@outlook.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/radeon/radeon.h         | 1 -
+ drivers/gpu/drm/radeon/radeon_display.c | 8 +-------
+ 2 files changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
+index a813c00f109b5..26fd45ea14cd4 100644
+--- a/drivers/gpu/drm/radeon/radeon.h
++++ b/drivers/gpu/drm/radeon/radeon.h
+@@ -132,7 +132,6 @@ extern int radeon_cik_support;
+ /* RADEON_IB_POOL_SIZE must be a power of 2 */
+ #define RADEON_IB_POOL_SIZE                   16
+ #define RADEON_DEBUGFS_MAX_COMPONENTS         32
+-#define RADEONFB_CONN_LIMIT                   4
+ #define RADEON_BIOS_NUM_SCRATCH                       8
+ /* internal ring indices */
+diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
+index 07d23a1e62a07..8643eebe9e243 100644
+--- a/drivers/gpu/drm/radeon/radeon_display.c
++++ b/drivers/gpu/drm/radeon/radeon_display.c
+@@ -685,7 +685,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
+       struct radeon_device *rdev = dev->dev_private;
+       struct radeon_crtc *radeon_crtc;
+-      radeon_crtc = kzalloc(sizeof(struct radeon_crtc) + (RADEONFB_CONN_LIMIT * sizeof(struct drm_connector *)), GFP_KERNEL);
++      radeon_crtc = kzalloc(sizeof(*radeon_crtc), GFP_KERNEL);
+       if (radeon_crtc == NULL)
+               return;
+@@ -711,12 +711,6 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
+       dev->mode_config.cursor_width = radeon_crtc->max_cursor_width;
+       dev->mode_config.cursor_height = radeon_crtc->max_cursor_height;
+-#if 0
+-      radeon_crtc->mode_set.crtc = &radeon_crtc->base;
+-      radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1);
+-      radeon_crtc->mode_set.num_connectors = 0;
+-#endif
+-
+       if (rdev->is_atom_bios && (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom))
+               radeon_atombios_init_crtc(dev, radeon_crtc);
+       else
+-- 
+2.43.0
+
diff --git a/queue-5.10/gpio-davinci-validate-the-obtained-number-of-irqs.patch b/queue-5.10/gpio-davinci-validate-the-obtained-number-of-irqs.patch
new file mode 100644 (file)
index 0000000..59d5f77
--- /dev/null
@@ -0,0 +1,47 @@
+From 2833b51b63caa6d6aa35e18b5f44bb2572dc69af Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 18 Jun 2024 17:43:44 +0300
+Subject: gpio: davinci: Validate the obtained number of IRQs
+
+From: Aleksandr Mishin <amishin@t-argos.ru>
+
+[ Upstream commit 7aa9b96e9a73e4ec1771492d0527bd5fc5ef9164 ]
+
+Value of pdata->gpio_unbanked is taken from Device Tree. In case of broken
+DT due to any error this value can be any. Without this value validation
+there can be out of chips->irqs array boundaries access in
+davinci_gpio_probe().
+
+Validate the obtained nirq value so that it won't exceed the maximum
+number of IRQs per bank.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: eb3744a2dd01 ("gpio: davinci: Do not assume continuous IRQ numbering")
+Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
+Link: https://lore.kernel.org/r/20240618144344.16943-1-amishin@t-argos.ru
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-davinci.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
+index 80597e90de9c6..33623bcfc886c 100644
+--- a/drivers/gpio/gpio-davinci.c
++++ b/drivers/gpio/gpio-davinci.c
+@@ -227,6 +227,11 @@ static int davinci_gpio_probe(struct platform_device *pdev)
+       else
+               nirq = DIV_ROUND_UP(ngpio, 16);
++      if (nirq > MAX_INT_PER_BANK) {
++              dev_err(dev, "Too many IRQs!\n");
++              return -EINVAL;
++      }
++
+       chips = devm_kzalloc(dev, sizeof(*chips), GFP_KERNEL);
+       if (!chips)
+               return -ENOMEM;
+-- 
+2.43.0
+
diff --git a/queue-5.10/gpiolib-cdev-disallow-reconfiguration-without-direct.patch b/queue-5.10/gpiolib-cdev-disallow-reconfiguration-without-direct.patch
new file mode 100644 (file)
index 0000000..ea65947
--- /dev/null
@@ -0,0 +1,88 @@
+From 5e8ca733183a8e9e340701ee59e06a7a7c042233 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 26 Jun 2024 13:29:22 +0800
+Subject: gpiolib: cdev: Disallow reconfiguration without direction (uAPI v1)
+
+From: Kent Gibson <warthog618@gmail.com>
+
+[ Upstream commit 9919cce62f68e6ab68dc2a975b5dc670f8ca7d40 ]
+
+linehandle_set_config() behaves badly when direction is not set.
+The configuration validation is borrowed from linehandle_create(), where,
+to verify the intent of the user, the direction must be set to in order
+to effect a change to the electrical configuration of a line. But, when
+applied to reconfiguration, that validation does not allow for the unset
+direction case, making it possible to clear flags set previously without
+specifying the line direction.
+
+Adding to the inconsistency, those changes are not immediately applied by
+linehandle_set_config(), but will take effect when the line value is next
+get or set.
+
+For example, by requesting a configuration with no flags set, an output
+line with GPIOHANDLE_REQUEST_ACTIVE_LOW and GPIOHANDLE_REQUEST_OPEN_DRAIN
+requested could have those flags cleared, inverting the sense of the line
+and changing the line drive to push-pull on the next line value set.
+
+Ensure the intent of the user by disallowing configurations which do not
+have direction set, returning an error to userspace to indicate that the
+configuration is invalid.
+
+And, for clarity, use lflags, a local copy of gcnf.flags, throughout when
+dealing with the requested flags, rather than a mixture of both.
+
+Fixes: e588bb1eae31 ("gpio: add new SET_CONFIG ioctl() to gpio chardev")
+Signed-off-by: Kent Gibson <warthog618@gmail.com>
+Link: https://lore.kernel.org/r/20240626052925.174272-2-warthog618@gmail.com
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpiolib-cdev.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
+index 40d0196d8bdcc..95861916deffb 100644
+--- a/drivers/gpio/gpiolib-cdev.c
++++ b/drivers/gpio/gpiolib-cdev.c
+@@ -83,6 +83,10 @@ struct linehandle_state {
+       GPIOHANDLE_REQUEST_OPEN_DRAIN | \
+       GPIOHANDLE_REQUEST_OPEN_SOURCE)
++#define GPIOHANDLE_REQUEST_DIRECTION_FLAGS \
++      (GPIOHANDLE_REQUEST_INPUT | \
++       GPIOHANDLE_REQUEST_OUTPUT)
++
+ static int linehandle_validate_flags(u32 flags)
+ {
+       /* Return an error if an unknown flag is set */
+@@ -163,21 +167,21 @@ static long linehandle_set_config(struct linehandle_state *lh,
+       if (ret)
+               return ret;
++      /* Lines must be reconfigured explicitly as input or output. */
++      if (!(lflags & GPIOHANDLE_REQUEST_DIRECTION_FLAGS))
++              return -EINVAL;
++
+       for (i = 0; i < lh->num_descs; i++) {
+               desc = lh->descs[i];
+-              linehandle_flags_to_desc_flags(gcnf.flags, &desc->flags);
++              linehandle_flags_to_desc_flags(lflags, &desc->flags);
+-              /*
+-               * Lines have to be requested explicitly for input
+-               * or output, else the line will be treated "as is".
+-               */
+               if (lflags & GPIOHANDLE_REQUEST_OUTPUT) {
+                       int val = !!gcnf.default_values[i];
+                       ret = gpiod_direction_output(desc, val);
+                       if (ret)
+                               return ret;
+-              } else if (lflags & GPIOHANDLE_REQUEST_INPUT) {
++              } else {
+                       ret = gpiod_direction_input(desc);
+                       if (ret)
+                               return ret;
+-- 
+2.43.0
+
diff --git a/queue-5.10/media-dvbdev-initialize-sbuf.patch b/queue-5.10/media-dvbdev-initialize-sbuf.patch
new file mode 100644 (file)
index 0000000..c2f4b7a
--- /dev/null
@@ -0,0 +1,42 @@
+From 1eedd167e92d0fc1e6b5a8d8c63f3fd2d41f20ce Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Mar 2024 14:50:25 +0000
+Subject: media: dvbdev: Initialize sbuf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ricardo Ribalda <ribalda@chromium.org>
+
+[ Upstream commit 17d1316de0d7dc1bdc5d6e3ad4efd30a9bf1a381 ]
+
+Because the size passed to copy_from_user() cannot be known beforehand,
+it needs to be checked during runtime with check_object_size. That makes
+gcc believe that the content of sbuf can be used before init.
+
+Fix:
+./include/linux/thread_info.h:215:17: warning: ‘sbuf’ may be used uninitialized [-Wmaybe-uninitialized]
+
+Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/dvb-core/dvbdev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
+index 23a0c209744dc..661588fc64f6a 100644
+--- a/drivers/media/dvb-core/dvbdev.c
++++ b/drivers/media/dvb-core/dvbdev.c
+@@ -974,7 +974,7 @@ int dvb_usercopy(struct file *file,
+                    int (*func)(struct file *file,
+                    unsigned int cmd, void *arg))
+ {
+-      char    sbuf[128];
++      char    sbuf[128] = {};
+       void    *mbuf = NULL;
+       void    *parg = NULL;
+       int     err  = -EINVAL;
+-- 
+2.43.0
+
diff --git a/queue-5.10/mtd-partitions-redboot-added-conversion-of-operands-.patch b/queue-5.10/mtd-partitions-redboot-added-conversion-of-operands-.patch
new file mode 100644 (file)
index 0000000..c55cdb8
--- /dev/null
@@ -0,0 +1,40 @@
+From f35a3c9b6343c1370fc93dfd1f11c40f4780a829 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 15 Mar 2024 12:37:58 +0300
+Subject: mtd: partitions: redboot: Added conversion of operands to a larger
+ type
+
+From: Denis Arefev <arefev@swemel.ru>
+
+[ Upstream commit 1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50 ]
+
+The value of an arithmetic expression directory * master->erasesize is
+subject to overflow due to a failure to cast operands to a larger data
+type before perfroming arithmetic
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Signed-off-by: Denis Arefev <arefev@swemel.ru>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/linux-mtd/20240315093758.20790-1-arefev@swemel.ru
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/mtd/parsers/redboot.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c
+index 4f3bcc59a6385..3351be6514732 100644
+--- a/drivers/mtd/parsers/redboot.c
++++ b/drivers/mtd/parsers/redboot.c
+@@ -102,7 +102,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
+                       offset -= master->erasesize;
+               }
+       } else {
+-              offset = directory * master->erasesize;
++              offset = (unsigned long) directory * master->erasesize;
+               while (mtd_block_isbad(master, offset)) {
+                       offset += master->erasesize;
+                       if (offset == master->size)
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-dpaa2-avoid-explicit-cpumask-var-allocation-on-s.patch b/queue-5.10/net-dpaa2-avoid-explicit-cpumask-var-allocation-on-s.patch
new file mode 100644 (file)
index 0000000..6698d2c
--- /dev/null
@@ -0,0 +1,72 @@
+From aed9e47540f26f5d9aaa57718857509eb23856fd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 31 Mar 2024 13:34:41 +0800
+Subject: net/dpaa2: Avoid explicit cpumask var allocation on stack
+
+From: Dawei Li <dawei.li@shingroup.cn>
+
+[ Upstream commit d33fe1714a44ff540629b149d8fab4ac6967585c ]
+
+For CONFIG_CPUMASK_OFFSTACK=y kernel, explicit allocation of cpumask
+variable on stack is not recommended since it can cause potential stack
+overflow.
+
+Instead, kernel code should always use *cpumask_var API(s) to allocate
+cpumask var in config-neutral way, leaving allocation strategy to
+CONFIG_CPUMASK_OFFSTACK.
+
+Use *cpumask_var API(s) to address it.
+
+Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
+Link: https://lore.kernel.org/r/20240331053441.1276826-3-dawei.li@shingroup.cn
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+index 07ba0438f9655..fa202fea537f8 100644
+--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
++++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+@@ -2383,11 +2383,14 @@ static int dpaa2_eth_xdp_xmit(struct net_device *net_dev, int n,
+ static int update_xps(struct dpaa2_eth_priv *priv)
+ {
+       struct net_device *net_dev = priv->net_dev;
+-      struct cpumask xps_mask;
+-      struct dpaa2_eth_fq *fq;
+       int i, num_queues, netdev_queues;
++      struct dpaa2_eth_fq *fq;
++      cpumask_var_t xps_mask;
+       int err = 0;
++      if (!alloc_cpumask_var(&xps_mask, GFP_KERNEL))
++              return -ENOMEM;
++
+       num_queues = dpaa2_eth_queue_count(priv);
+       netdev_queues = (net_dev->num_tc ? : 1) * num_queues;
+@@ -2397,16 +2400,17 @@ static int update_xps(struct dpaa2_eth_priv *priv)
+       for (i = 0; i < netdev_queues; i++) {
+               fq = &priv->fq[i % num_queues];
+-              cpumask_clear(&xps_mask);
+-              cpumask_set_cpu(fq->target_cpu, &xps_mask);
++              cpumask_clear(xps_mask);
++              cpumask_set_cpu(fq->target_cpu, xps_mask);
+-              err = netif_set_xps_queue(net_dev, &xps_mask, i);
++              err = netif_set_xps_queue(net_dev, xps_mask, i);
+               if (err) {
+                       netdev_warn_once(net_dev, "Error setting XPS queue\n");
+                       break;
+               }
+       }
++      free_cpumask_var(xps_mask);
+       return err;
+ }
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-iucv-avoid-explicit-cpumask-var-allocation-on-st.patch b/queue-5.10/net-iucv-avoid-explicit-cpumask-var-allocation-on-st.patch
new file mode 100644 (file)
index 0000000..3e4c15a
--- /dev/null
@@ -0,0 +1,85 @@
+From 1bb99be79edfd5ae65c187dac62f31b270646dbb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 31 Mar 2024 13:34:40 +0800
+Subject: net/iucv: Avoid explicit cpumask var allocation on stack
+
+From: Dawei Li <dawei.li@shingroup.cn>
+
+[ Upstream commit be4e1304419c99a164b4c0e101c7c2a756b635b9 ]
+
+For CONFIG_CPUMASK_OFFSTACK=y kernel, explicit allocation of cpumask
+variable on stack is not recommended since it can cause potential stack
+overflow.
+
+Instead, kernel code should always use *cpumask_var API(s) to allocate
+cpumask var in config-neutral way, leaving allocation strategy to
+CONFIG_CPUMASK_OFFSTACK.
+
+Use *cpumask_var API(s) to address it.
+
+Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
+Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
+Link: https://lore.kernel.org/r/20240331053441.1276826-2-dawei.li@shingroup.cn
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/iucv/iucv.c | 26 ++++++++++++++++++--------
+ 1 file changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
+index ed0dbdbba4d94..06770b77e5d22 100644
+--- a/net/iucv/iucv.c
++++ b/net/iucv/iucv.c
+@@ -517,7 +517,7 @@ static void iucv_setmask_mp(void)
+  */
+ static void iucv_setmask_up(void)
+ {
+-      cpumask_t cpumask;
++      static cpumask_t cpumask;
+       int cpu;
+       /* Disable all cpu but the first in cpu_irq_cpumask. */
+@@ -625,23 +625,33 @@ static int iucv_cpu_online(unsigned int cpu)
+ static int iucv_cpu_down_prep(unsigned int cpu)
+ {
+-      cpumask_t cpumask;
++      cpumask_var_t cpumask;
++      int ret = 0;
+       if (!iucv_path_table)
+               return 0;
+-      cpumask_copy(&cpumask, &iucv_buffer_cpumask);
+-      cpumask_clear_cpu(cpu, &cpumask);
+-      if (cpumask_empty(&cpumask))
++      if (!alloc_cpumask_var(&cpumask, GFP_KERNEL))
++              return -ENOMEM;
++
++      cpumask_copy(cpumask, &iucv_buffer_cpumask);
++      cpumask_clear_cpu(cpu, cpumask);
++      if (cpumask_empty(cpumask)) {
+               /* Can't offline last IUCV enabled cpu. */
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto __free_cpumask;
++      }
+       iucv_retrieve_cpu(NULL);
+       if (!cpumask_empty(&iucv_irq_cpumask))
+-              return 0;
++              goto __free_cpumask;
++
+       smp_call_function_single(cpumask_first(&iucv_buffer_cpumask),
+                                iucv_allow_cpu, NULL, 1);
+-      return 0;
++
++__free_cpumask:
++      free_cpumask_var(cpumask);
++      return ret;
+ }
+ /**
+-- 
+2.43.0
+
diff --git a/queue-5.10/nvme-fixup-comment-for-nvme-rdma-provider-type.patch b/queue-5.10/nvme-fixup-comment-for-nvme-rdma-provider-type.patch
new file mode 100644 (file)
index 0000000..0013748
--- /dev/null
@@ -0,0 +1,38 @@
+From 36b3291440d6e086e3c500bba4b9bf6e8f88ad53 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 17 Jun 2024 09:27:27 +0200
+Subject: nvme: fixup comment for nvme RDMA Provider Type
+
+From: Hannes Reinecke <hare@suse.de>
+
+[ Upstream commit f80a55fa90fa76d01e3fffaa5d0413e522ab9a00 ]
+
+PRTYPE is the provider type, not the QP service type.
+
+Fixes: eb793e2c9286 ("nvme.h: add NVMe over Fabrics definitions")
+Signed-off-by: Hannes Reinecke <hare@kernel.org>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/nvme.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/linux/nvme.h b/include/linux/nvme.h
+index f454dd1003347..ddf9ae37a2cce 100644
+--- a/include/linux/nvme.h
++++ b/include/linux/nvme.h
+@@ -71,8 +71,8 @@ enum {
+       NVMF_RDMA_QPTYPE_DATAGRAM       = 2, /* Reliable Datagram */
+ };
+-/* RDMA QP Service Type codes for Discovery Log Page entry TSAS
+- * RDMA_QPTYPE field
++/* RDMA Provider Type codes for Discovery Log Page entry TSAS
++ * RDMA_PRTYPE field
+  */
+ enum {
+       NVMF_RDMA_PRTYPE_NOT_SPECIFIED  = 1, /* No Provider Specified */
+-- 
+2.43.0
+
index 4c8b5ad5a6e23a93585f4f56a06657262fc2bd38..3f990f8ba0f6d762b95e7984c0ecb225132e9133 100644 (file)
@@ -279,3 +279,16 @@ sparc-fix-compat-recv-recvfrom-syscalls.patch
 parisc-use-correct-compat-recv-recvfrom-syscalls.patch
 netfilter-nf_tables-fully-validate-nft_data_value-on.patch
 tracing-net_sched-null-pointer-dereference-in-perf_t.patch
+drm-panel-ilitek-ili9881c-fix-warning-with-gpio-cont.patch
+mtd-partitions-redboot-added-conversion-of-operands-.patch
+bpf-add-a-check-for-struct-bpf_fib_lookup-size.patch
+net-iucv-avoid-explicit-cpumask-var-allocation-on-st.patch
+net-dpaa2-avoid-explicit-cpumask-var-allocation-on-s.patch
+alsa-emux-improve-patch-ioctl-data-validation.patch
+media-dvbdev-initialize-sbuf.patch
+soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch
+drm-radeon-radeon_display-decrease-the-size-of-alloc.patch
+nvme-fixup-comment-for-nvme-rdma-provider-type.patch
+drm-panel-simple-add-missing-display-timing-flags-fo.patch
+gpio-davinci-validate-the-obtained-number-of-irqs.patch
+gpiolib-cdev-disallow-reconfiguration-without-direct.patch
diff --git a/queue-5.10/soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch b/queue-5.10/soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch
new file mode 100644 (file)
index 0000000..8ed3c1f
--- /dev/null
@@ -0,0 +1,71 @@
+From 56ad47d79dde62cb87cde943b4206e4132848fd9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Mar 2024 11:55:07 -0500
+Subject: soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer
+ message
+
+From: Andrew Davis <afd@ti.com>
+
+[ Upstream commit ddbf3204f600a4d1f153498f618369fca352ae00 ]
+
+mbox_send_message() sends a u32 bit message, not a pointer to a message.
+We only convert to a pointer type as a generic type. If we want to send
+a dummy message of 0, then simply send 0 (NULL).
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Link: https://lore.kernel.org/r/20240325165507.30323-1-afd@ti.com
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/soc/ti/wkup_m3_ipc.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
+index ef3f95fefab58..6634709e646c4 100644
+--- a/drivers/soc/ti/wkup_m3_ipc.c
++++ b/drivers/soc/ti/wkup_m3_ipc.c
+@@ -14,7 +14,6 @@
+ #include <linux/irq.h>
+ #include <linux/module.h>
+ #include <linux/of.h>
+-#include <linux/omap-mailbox.h>
+ #include <linux/platform_device.h>
+ #include <linux/remoteproc.h>
+ #include <linux/suspend.h>
+@@ -151,7 +150,6 @@ static irqreturn_t wkup_m3_txev_handler(int irq, void *ipc_data)
+ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
+ {
+       struct device *dev = m3_ipc->dev;
+-      mbox_msg_t dummy_msg = 0;
+       int ret;
+       if (!m3_ipc->mbox) {
+@@ -167,7 +165,7 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
+        * the RX callback to avoid multiple interrupts being received
+        * by the CM3.
+        */
+-      ret = mbox_send_message(m3_ipc->mbox, &dummy_msg);
++      ret = mbox_send_message(m3_ipc->mbox, NULL);
+       if (ret < 0) {
+               dev_err(dev, "%s: mbox_send_message() failed: %d\n",
+                       __func__, ret);
+@@ -189,7 +187,6 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
+ static int wkup_m3_ping_noirq(struct wkup_m3_ipc *m3_ipc)
+ {
+       struct device *dev = m3_ipc->dev;
+-      mbox_msg_t dummy_msg = 0;
+       int ret;
+       if (!m3_ipc->mbox) {
+@@ -198,7 +195,7 @@ static int wkup_m3_ping_noirq(struct wkup_m3_ipc *m3_ipc)
+               return -EIO;
+       }
+-      ret = mbox_send_message(m3_ipc->mbox, &dummy_msg);
++      ret = mbox_send_message(m3_ipc->mbox, NULL);
+       if (ret < 0) {
+               dev_err(dev, "%s: mbox_send_message() failed: %d\n",
+                       __func__, ret);
+-- 
+2.43.0
+