]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2025 10:40:59 +0000 (11:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2025 10:40:59 +0000 (11:40 +0100)
added patches:
drm-adv7511-drop-dsi-single-lane-support.patch
net-sctp-prevent-autoclose-integer-overflow-in-sctp_association_init.patch
pinctrl-mcp23s08-fix-sleeping-in-atomic-context-due-to-regmap-locking.patch
rdma-uverbs-prevent-integer-overflow-issue.patch
sky2-add-device-id-11ab-4373-for-marvell-88e8075.patch

queue-5.4/drm-adv7511-drop-dsi-single-lane-support.patch [new file with mode: 0644]
queue-5.4/net-sctp-prevent-autoclose-integer-overflow-in-sctp_association_init.patch [new file with mode: 0644]
queue-5.4/pinctrl-mcp23s08-fix-sleeping-in-atomic-context-due-to-regmap-locking.patch [new file with mode: 0644]
queue-5.4/rdma-uverbs-prevent-integer-overflow-issue.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/sky2-add-device-id-11ab-4373-for-marvell-88e8075.patch [new file with mode: 0644]

diff --git a/queue-5.4/drm-adv7511-drop-dsi-single-lane-support.patch b/queue-5.4/drm-adv7511-drop-dsi-single-lane-support.patch
new file mode 100644 (file)
index 0000000..34c5659
--- /dev/null
@@ -0,0 +1,39 @@
+From 79d67c499c3f886202a40c5cb27e747e4fa4d738 Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das.jz@bp.renesas.com>
+Date: Tue, 19 Nov 2024 19:20:31 +0000
+Subject: drm: adv7511: Drop dsi single lane support
+
+From: Biju Das <biju.das.jz@bp.renesas.com>
+
+commit 79d67c499c3f886202a40c5cb27e747e4fa4d738 upstream.
+
+As per [1] and [2], ADV7535/7533 supports only 2-, 3-, or 4-lane. Drop
+unsupported 1-lane.
+
+[1] https://www.analog.com/media/en/technical-documentation/data-sheets/ADV7535.pdf
+[2] https://www.analog.com/media/en/technical-documentation/data-sheets/ADV7533.pdf
+
+Fixes: 1e4d58cd7f88 ("drm/bridge: adv7533: Create a MIPI DSI device")
+Reported-by: Hien Huynh <hien.huynh.px@renesas.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Reviewed-by: Adam Ford <aford173@gmail.com>
+Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20241119192040.152657-4-biju.das.jz@bp.renesas.com
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/adv7511/adv7533.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/bridge/adv7511/adv7533.c
++++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c
+@@ -193,7 +193,7 @@ int adv7533_parse_dt(struct device_node
+       of_property_read_u32(np, "adi,dsi-lanes", &num_lanes);
+-      if (num_lanes < 1 || num_lanes > 4)
++      if (num_lanes < 2 || num_lanes > 4)
+               return -EINVAL;
+       adv->num_dsi_lanes = num_lanes;
diff --git a/queue-5.4/net-sctp-prevent-autoclose-integer-overflow-in-sctp_association_init.patch b/queue-5.4/net-sctp-prevent-autoclose-integer-overflow-in-sctp_association_init.patch
new file mode 100644 (file)
index 0000000..16821c1
--- /dev/null
@@ -0,0 +1,36 @@
+From 4e86729d1ff329815a6e8a920cb554a1d4cb5b8d Mon Sep 17 00:00:00 2001
+From: Nikolay Kuratov <kniv@yandex-team.ru>
+Date: Thu, 19 Dec 2024 19:21:14 +0300
+Subject: net/sctp: Prevent autoclose integer overflow in sctp_association_init()
+
+From: Nikolay Kuratov <kniv@yandex-team.ru>
+
+commit 4e86729d1ff329815a6e8a920cb554a1d4cb5b8d upstream.
+
+While by default max_autoclose equals to INT_MAX / HZ, one may set
+net.sctp.max_autoclose to UINT_MAX. There is code in
+sctp_association_init() that can consequently trigger overflow.
+
+Cc: stable@vger.kernel.org
+Fixes: 9f70f46bd4c7 ("sctp: properly latch and use autoclose value from sock to association")
+Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
+Acked-by: Xin Long <lucien.xin@gmail.com>
+Link: https://patch.msgid.link/20241219162114.2863827-1-kniv@yandex-team.ru
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sctp/associola.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/sctp/associola.c
++++ b/net/sctp/associola.c
+@@ -132,7 +132,8 @@ static struct sctp_association *sctp_ass
+               = 5 * asoc->rto_max;
+       asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay;
+-      asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = sp->autoclose * HZ;
++      asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] =
++              (unsigned long)sp->autoclose * HZ;
+       /* Initializes the timers */
+       for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i)
diff --git a/queue-5.4/pinctrl-mcp23s08-fix-sleeping-in-atomic-context-due-to-regmap-locking.patch b/queue-5.4/pinctrl-mcp23s08-fix-sleeping-in-atomic-context-due-to-regmap-locking.patch
new file mode 100644 (file)
index 0000000..5565d8b
--- /dev/null
@@ -0,0 +1,111 @@
+From a37eecb705f33726f1fb7cd2a67e514a15dfe693 Mon Sep 17 00:00:00 2001
+From: Evgenii Shatokhin <e.shatokhin@yadro.com>
+Date: Mon, 9 Dec 2024 10:46:59 +0300
+Subject: pinctrl: mcp23s08: Fix sleeping in atomic context due to regmap locking
+
+From: Evgenii Shatokhin <e.shatokhin@yadro.com>
+
+commit a37eecb705f33726f1fb7cd2a67e514a15dfe693 upstream.
+
+If a device uses MCP23xxx IO expander to receive IRQs, the following
+bug can happen:
+
+  BUG: sleeping function called from invalid context
+    at kernel/locking/mutex.c:283
+  in_atomic(): 1, irqs_disabled(): 1, non_block: 0, ...
+  preempt_count: 1, expected: 0
+  ...
+  Call Trace:
+  ...
+  __might_resched+0x104/0x10e
+  __might_sleep+0x3e/0x62
+  mutex_lock+0x20/0x4c
+  regmap_lock_mutex+0x10/0x18
+  regmap_update_bits_base+0x2c/0x66
+  mcp23s08_irq_set_type+0x1ae/0x1d6
+  __irq_set_trigger+0x56/0x172
+  __setup_irq+0x1e6/0x646
+  request_threaded_irq+0xb6/0x160
+  ...
+
+We observed the problem while experimenting with a touchscreen driver which
+used MCP23017 IO expander (I2C).
+
+The regmap in the pinctrl-mcp23s08 driver uses a mutex for protection from
+concurrent accesses, which is the default for regmaps without .fast_io,
+.disable_locking, etc.
+
+mcp23s08_irq_set_type() calls regmap_update_bits_base(), and the latter
+locks the mutex.
+
+However, __setup_irq() locks desc->lock spinlock before calling these
+functions. As a result, the system tries to lock the mutex whole holding
+the spinlock.
+
+It seems, the internal regmap locks are not needed in this driver at all.
+mcp->lock seems to protect the regmap from concurrent accesses already,
+except, probably, in mcp_pinconf_get/set.
+
+mcp23s08_irq_set_type() and mcp23s08_irq_mask/unmask() are called under
+chip_bus_lock(), which calls mcp23s08_irq_bus_lock(). The latter takes
+mcp->lock and enables regmap caching, so that the potentially slow I2C
+accesses are deferred until chip_bus_unlock().
+
+The accesses to the regmap from mcp23s08_probe_one() do not need additional
+locking.
+
+In all remaining places where the regmap is accessed, except
+mcp_pinconf_get/set(), the driver already takes mcp->lock.
+
+This patch adds locking in mcp_pinconf_get/set() and disables internal
+locking in the regmap config. Among other things, it fixes the sleeping
+in atomic context described above.
+
+Fixes: 8f38910ba4f6 ("pinctrl: mcp23s08: switch to regmap caching")
+Cc: stable@vger.kernel.org
+Signed-off-by: Evgenii Shatokhin <e.shatokhin@yadro.com>
+Link: https://lore.kernel.org/20241209074659.1442898-1-e.shatokhin@yadro.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pinctrl/pinctrl-mcp23s08.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/pinctrl/pinctrl-mcp23s08.c
++++ b/drivers/pinctrl/pinctrl-mcp23s08.c
+@@ -120,6 +120,7 @@ static const struct regmap_config mcp23x
+       .num_reg_defaults = ARRAY_SIZE(mcp23x08_defaults),
+       .cache_type = REGCACHE_FLAT,
+       .max_register = MCP_OLAT,
++      .disable_locking = true, /* mcp->lock protects the regmap */
+ };
+ static const struct reg_default mcp23x17_defaults[] = {
+@@ -165,6 +166,7 @@ static const struct regmap_config mcp23x
+       .num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults),
+       .cache_type = REGCACHE_FLAT,
+       .val_format_endian = REGMAP_ENDIAN_LITTLE,
++      .disable_locking = true, /* mcp->lock protects the regmap */
+ };
+ static int mcp_read(struct mcp23s08 *mcp, unsigned int reg, unsigned int *val)
+@@ -261,7 +263,9 @@ static int mcp_pinconf_get(struct pinctr
+       switch (param) {
+       case PIN_CONFIG_BIAS_PULL_UP:
++              mutex_lock(&mcp->lock);
+               ret = mcp_read(mcp, MCP_GPPU, &data);
++              mutex_unlock(&mcp->lock);
+               if (ret < 0)
+                       return ret;
+               status = (data & BIT(pin)) ? 1 : 0;
+@@ -290,7 +294,9 @@ static int mcp_pinconf_set(struct pinctr
+               switch (param) {
+               case PIN_CONFIG_BIAS_PULL_UP:
++                      mutex_lock(&mcp->lock);
+                       ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
++                      mutex_unlock(&mcp->lock);
+                       break;
+               default:
+                       dev_dbg(mcp->dev, "Invalid config param %04x\n", param);
diff --git a/queue-5.4/rdma-uverbs-prevent-integer-overflow-issue.patch b/queue-5.4/rdma-uverbs-prevent-integer-overflow-issue.patch
new file mode 100644 (file)
index 0000000..481e524
--- /dev/null
@@ -0,0 +1,74 @@
+From d0257e089d1bbd35c69b6c97ff73e3690ab149a9 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Sat, 30 Nov 2024 13:06:41 +0300
+Subject: RDMA/uverbs: Prevent integer overflow issue
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit d0257e089d1bbd35c69b6c97ff73e3690ab149a9 upstream.
+
+In the expression "cmd.wqe_size * cmd.wr_count", both variables are u32
+values that come from the user so the multiplication can lead to integer
+wrapping.  Then we pass the result to uverbs_request_next_ptr() which also
+could potentially wrap.  The "cmd.sge_count * sizeof(struct ib_uverbs_sge)"
+multiplication can also overflow on 32bit systems although it's fine on
+64bit systems.
+
+This patch does two things.  First, I've re-arranged the condition in
+uverbs_request_next_ptr() so that the use controlled variable "len" is on
+one side of the comparison by itself without any math.  Then I've modified
+all the callers to use size_mul() for the multiplications.
+
+Fixes: 67cdb40ca444 ("[IB] uverbs: Implement more commands")
+Cc: stable@vger.kernel.org
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Link: https://patch.msgid.link/b8765ab3-c2da-4611-aae0-ddd6ba173d23@stanley.mountain
+Signed-off-by: Leon Romanovsky <leon@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/infiniband/core/uverbs_cmd.c |   16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/infiniband/core/uverbs_cmd.c
++++ b/drivers/infiniband/core/uverbs_cmd.c
+@@ -161,7 +161,7 @@ static const void __user *uverbs_request
+ {
+       const void __user *res = iter->cur;
+-      if (iter->cur + len > iter->end)
++      if (len > iter->end - iter->cur)
+               return (void __force __user *)ERR_PTR(-ENOSPC);
+       iter->cur += len;
+       return res;
+@@ -2024,11 +2024,13 @@ static int ib_uverbs_post_send(struct uv
+       ret = uverbs_request_start(attrs, &iter, &cmd, sizeof(cmd));
+       if (ret)
+               return ret;
+-      wqes = uverbs_request_next_ptr(&iter, cmd.wqe_size * cmd.wr_count);
++      wqes = uverbs_request_next_ptr(&iter, size_mul(cmd.wqe_size,
++                                                     cmd.wr_count));
+       if (IS_ERR(wqes))
+               return PTR_ERR(wqes);
+-      sgls = uverbs_request_next_ptr(
+-              &iter, cmd.sge_count * sizeof(struct ib_uverbs_sge));
++      sgls = uverbs_request_next_ptr(&iter,
++                                     size_mul(cmd.sge_count,
++                                              sizeof(struct ib_uverbs_sge)));
+       if (IS_ERR(sgls))
+               return PTR_ERR(sgls);
+       ret = uverbs_request_finish(&iter);
+@@ -2213,11 +2215,11 @@ ib_uverbs_unmarshall_recv(struct uverbs_
+       if (wqe_size < sizeof (struct ib_uverbs_recv_wr))
+               return ERR_PTR(-EINVAL);
+-      wqes = uverbs_request_next_ptr(iter, wqe_size * wr_count);
++      wqes = uverbs_request_next_ptr(iter, size_mul(wqe_size, wr_count));
+       if (IS_ERR(wqes))
+               return ERR_CAST(wqes);
+-      sgls = uverbs_request_next_ptr(
+-              iter, sge_count * sizeof(struct ib_uverbs_sge));
++      sgls = uverbs_request_next_ptr(iter, size_mul(sge_count,
++                                                    sizeof(struct ib_uverbs_sge)));
+       if (IS_ERR(sgls))
+               return ERR_CAST(sgls);
+       ret = uverbs_request_finish(iter);
index 6635ebb4e58363c366b2f946810427d557aa7db2..3d93287ed56a6bac512327045f2573512623dda3 100644 (file)
@@ -85,3 +85,8 @@ irqchip-gic-correct-declaration-of-percpu_base-point.patch
 arc-build-try-to-guess-gcc-variant-of-cross-compiler.patch
 modpost-fix-input-module_device_table-built-for-64-b.patch
 modpost-fix-the-missed-iteration-for-the-max-bit-in-.patch
+rdma-uverbs-prevent-integer-overflow-issue.patch
+pinctrl-mcp23s08-fix-sleeping-in-atomic-context-due-to-regmap-locking.patch
+sky2-add-device-id-11ab-4373-for-marvell-88e8075.patch
+net-sctp-prevent-autoclose-integer-overflow-in-sctp_association_init.patch
+drm-adv7511-drop-dsi-single-lane-support.patch
diff --git a/queue-5.4/sky2-add-device-id-11ab-4373-for-marvell-88e8075.patch b/queue-5.4/sky2-add-device-id-11ab-4373-for-marvell-88e8075.patch
new file mode 100644 (file)
index 0000000..1d8ece7
--- /dev/null
@@ -0,0 +1,31 @@
+From 03c8d0af2e409e15c16130b185e12b5efba0a6b9 Mon Sep 17 00:00:00 2001
+From: Pascal Hambourg <pascal@plouf.fr.eu.org>
+Date: Mon, 23 Dec 2024 17:44:01 +0100
+Subject: sky2: Add device ID 11ab:4373 for Marvell 88E8075
+
+From: Pascal Hambourg <pascal@plouf.fr.eu.org>
+
+commit 03c8d0af2e409e15c16130b185e12b5efba0a6b9 upstream.
+
+A Marvell 88E8075 ethernet controller has this device ID instead of
+11ab:4370 and works fine with the sky2 driver.
+
+Signed-off-by: Pascal Hambourg <pascal@plouf.fr.eu.org>
+Cc: stable@vger.kernel.org
+Link: https://patch.msgid.link/10165a62-99fb-4be6-8c64-84afd6234085@plouf.fr.eu.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/marvell/sky2.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/marvell/sky2.c
++++ b/drivers/net/ethernet/marvell/sky2.c
+@@ -130,6 +130,7 @@ static const struct pci_device_id sky2_i
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */
++      { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4373) }, /* 88E8075 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4380) }, /* 88E8057 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4381) }, /* 88E8059 */
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4382) }, /* 88E8079 */