]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Wed, 11 Oct 2023 14:22:59 +0000 (10:22 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 11 Oct 2023 14:22:59 +0000 (10:22 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch [new file with mode: 0644]
queue-4.14/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch [new file with mode: 0644]
queue-4.14/series [new file with mode: 0644]

diff --git a/queue-4.14/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch b/queue-4.14/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch
new file mode 100644 (file)
index 0000000..e23e6f4
--- /dev/null
@@ -0,0 +1,51 @@
+From 956d3b5be914be989ba168c30d717fde304d8f3b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 4 Oct 2023 13:16:24 +0200
+Subject: platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent
+ section mismatch warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+[ Upstream commit 5b44abbc39ca15df80d0da4756078c98c831090f ]
+
+As described in the added code comment, a reference to .exit.text is ok
+for drivers registered via module_platform_driver_probe(). Make this
+explicit to prevent a section mismatch warning:
+
+       WARNING: modpost: drivers/platform/x86/hp/hp-wmi: section mismatch in reference: hp_wmi_driver+0x8 (section: .data) -> hp_wmi_bios_remove (section: .exit.text)
+
+Fixes: c165b80cfecc ("hp-wmi: fix handling of platform device")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Link: https://lore.kernel.org/r/20231004111624.2667753-1-u.kleine-koenig@pengutronix.de
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/hp-wmi.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
+index c65b800310f3a..67a9f838dfb9d 100644
+--- a/drivers/platform/x86/hp-wmi.c
++++ b/drivers/platform/x86/hp-wmi.c
+@@ -1001,7 +1001,13 @@ static const struct dev_pm_ops hp_wmi_pm_ops = {
+       .restore  = hp_wmi_resume_handler,
+ };
+-static struct platform_driver hp_wmi_driver = {
++/*
++ * hp_wmi_bios_remove() lives in .exit.text. For drivers registered via
++ * module_platform_driver_probe() this is ok because they cannot get unbound at
++ * runtime. So mark the driver struct with __refdata to prevent modpost
++ * triggering a section mismatch warning.
++ */
++static struct platform_driver hp_wmi_driver __refdata = {
+       .driver = {
+               .name = "hp-wmi",
+               .pm = &hp_wmi_pm_ops,
+-- 
+2.40.1
+
diff --git a/queue-4.14/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch b/queue-4.14/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch
new file mode 100644 (file)
index 0000000..2d03067
--- /dev/null
@@ -0,0 +1,39 @@
+From 6c4b98e26fcc8cff7e2e9d50fc7023398a545498 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Sep 2023 15:40:48 +0300
+Subject: RDMA/cxgb4: Check skb value for failure to allocate
+
+From: Artem Chernyshev <artem.chernyshev@red-soft.ru>
+
+[ Upstream commit 8fb8a82086f5bda6893ea6557c5a458e4549c6d7 ]
+
+get_skb() can fail to allocate skb, so check it.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: 5be78ee924ae ("RDMA/cxgb4: Fix LE hash collision bug for active open connection")
+Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
+Link: https://lore.kernel.org/r/20230905124048.284165-1-artem.chernyshev@red-soft.ru
+Signed-off-by: Leon Romanovsky <leon@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/cxgb4/cm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
+index 357960d48e668..2086844dfade9 100644
+--- a/drivers/infiniband/hw/cxgb4/cm.c
++++ b/drivers/infiniband/hw/cxgb4/cm.c
+@@ -1902,6 +1902,9 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
+       int win;
+       skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
++      if (!skb)
++              return -ENOMEM;
++
+       req = __skb_put_zero(skb, sizeof(*req));
+       req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR));
+       req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
+-- 
+2.40.1
+
diff --git a/queue-4.14/series b/queue-4.14/series
new file mode 100644 (file)
index 0000000..ac8ab4a
--- /dev/null
@@ -0,0 +1,2 @@
+rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch
+platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch