From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Xiangyu Chen <xiangyu.chen@eng.windriver.com>,
Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.1 1/2] fpga: bridge: add owner module and take its refcount
Date: Mon, 25 Nov 2024 10:20:59 -0500 [thread overview]
Message-ID: <20241125100821-c497bd65ad3e3730@stable.kernel.org> (raw)
In-Reply-To: <20241125053816.1914594-2-xiangyu.chen@eng.windriver.com>
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 1da11f822042eb6ef4b6064dc048f157a7852529
WARNING: Author mismatch between patch and upstream commit:
Backport author: Xiangyu Chen <xiangyu.chen@eng.windriver.com>
Commit author: Marco Pagani <marpagan@redhat.com>
Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.11.y | Present (exact SHA1)
6.6.y | Present (different SHA1: d7c4081c54a1)
6.1.y | Not found
Note: The patch differs from the upstream commit:
---
--- - 2024-11-25 10:03:24.580903183 -0500
+++ /tmp/tmp.dgudhG3mc3 2024-11-25 10:03:24.569117471 -0500
@@ -1,3 +1,5 @@
+[ Upstream commit 1da11f822042eb6ef4b6064dc048f157a7852529 ]
+
The current implementation of the fpga bridge assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module's refcount. This approach is problematic since it can
@@ -27,6 +29,8 @@
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240322171839.233864-1-marpagan@redhat.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
Documentation/driver-api/fpga/fpga-bridge.rst | 7 ++-
drivers/fpga/fpga-bridge.c | 57 ++++++++++---------
@@ -34,7 +38,7 @@
3 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/Documentation/driver-api/fpga/fpga-bridge.rst b/Documentation/driver-api/fpga/fpga-bridge.rst
-index 6042085340953..833f68fb07008 100644
+index 604208534095..833f68fb0700 100644
--- a/Documentation/driver-api/fpga/fpga-bridge.rst
+++ b/Documentation/driver-api/fpga/fpga-bridge.rst
@@ -6,9 +6,12 @@ API to implement a new FPGA bridge
@@ -61,7 +65,7 @@
.. kernel-doc:: drivers/fpga/fpga-bridge.c
:functions: fpga_bridge_unregister
diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
-index 79c473b3c7c3d..8ef395b49bf8a 100644
+index 833ce13ff6f8..698d6cbf782a 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -55,33 +55,26 @@ int fpga_bridge_disable(struct fpga_bridge *bridge)
@@ -106,7 +110,7 @@
}
/**
-@@ -98,13 +91,18 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
+@@ -97,13 +90,18 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
struct fpga_image_info *info)
{
@@ -114,9 +118,9 @@
+ struct fpga_bridge *bridge;
+ struct device *bridge_dev;
-- dev = class_find_device_by_of_node(&fpga_bridge_class, np);
+- dev = class_find_device_by_of_node(fpga_bridge_class, np);
- if (!dev)
-+ bridge_dev = class_find_device_by_of_node(&fpga_bridge_class, np);
++ bridge_dev = class_find_device_by_of_node(fpga_bridge_class, np);
+ if (!bridge_dev)
return ERR_PTR(-ENODEV);
@@ -129,15 +133,15 @@
}
EXPORT_SYMBOL_GPL(of_fpga_bridge_get);
-@@ -125,6 +123,7 @@ static int fpga_bridge_dev_match(struct device *dev, const void *data)
+@@ -124,6 +122,7 @@ static int fpga_bridge_dev_match(struct device *dev, const void *data)
struct fpga_bridge *fpga_bridge_get(struct device *dev,
struct fpga_image_info *info)
{
+ struct fpga_bridge *bridge;
struct device *bridge_dev;
- bridge_dev = class_find_device(&fpga_bridge_class, NULL, dev,
-@@ -132,7 +131,11 @@ struct fpga_bridge *fpga_bridge_get(struct device *dev,
+ bridge_dev = class_find_device(fpga_bridge_class, NULL, dev,
+@@ -131,7 +130,11 @@ struct fpga_bridge *fpga_bridge_get(struct device *dev,
if (!bridge_dev)
return ERR_PTR(-ENODEV);
@@ -150,7 +154,7 @@
}
EXPORT_SYMBOL_GPL(fpga_bridge_get);
-@@ -146,7 +149,7 @@ void fpga_bridge_put(struct fpga_bridge *bridge)
+@@ -145,7 +148,7 @@ void fpga_bridge_put(struct fpga_bridge *bridge)
dev_dbg(&bridge->dev, "put\n");
bridge->info = NULL;
@@ -159,7 +163,7 @@
mutex_unlock(&bridge->mutex);
put_device(&bridge->dev);
}
-@@ -316,18 +319,19 @@ static struct attribute *fpga_bridge_attrs[] = {
+@@ -312,18 +315,19 @@ static struct attribute *fpga_bridge_attrs[] = {
ATTRIBUTE_GROUPS(fpga_bridge);
/**
@@ -183,7 +187,7 @@
{
struct fpga_bridge *bridge;
int id, ret;
-@@ -357,6 +361,7 @@ fpga_bridge_register(struct device *parent, const char *name,
+@@ -353,6 +357,7 @@ fpga_bridge_register(struct device *parent, const char *name,
bridge->name = name;
bridge->br_ops = br_ops;
@@ -191,7 +195,7 @@
bridge->priv = priv;
bridge->dev.groups = br_ops->groups;
-@@ -386,7 +391,7 @@ fpga_bridge_register(struct device *parent, const char *name,
+@@ -382,7 +387,7 @@ fpga_bridge_register(struct device *parent, const char *name,
return ERR_PTR(ret);
}
@@ -201,7 +205,7 @@
/**
* fpga_bridge_unregister - unregister an FPGA bridge
diff --git a/include/linux/fpga/fpga-bridge.h b/include/linux/fpga/fpga-bridge.h
-index 223da48a6d18b..94c4edd047e54 100644
+index 223da48a6d18..94c4edd047e5 100644
--- a/include/linux/fpga/fpga-bridge.h
+++ b/include/linux/fpga/fpga-bridge.h
@@ -45,6 +45,7 @@ struct fpga_bridge_info {
@@ -236,3 +240,6 @@
void fpga_bridge_unregister(struct fpga_bridge *br);
#endif /* _LINUX_FPGA_BRIDGE_H */
+--
+2.43.0
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y | Success | Success |
next prev parent reply other threads:[~2024-11-25 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 5:38 [PATCH 6.1 0/2] Backport to fix CVE-2024-37021 and CVE-2024-36479 Xiangyu Chen
2024-11-25 5:38 ` [PATCH 6.1 1/2] fpga: bridge: add owner module and take its refcount Xiangyu Chen
2024-11-25 15:20 ` Sasha Levin [this message]
2024-11-25 5:38 ` [PATCH 6.1 2/2] fpga: manager: " Xiangyu Chen
2024-11-25 15:20 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241125100821-c497bd65ad3e3730@stable.kernel.org \
--to=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xiangyu.chen@eng.windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.