[SRU][Jammy][PATCH 1/1] UBUNTU: SAUCE: dmaengine: idxd: set is_visible member of idxd_wq_attribute_group

Jacob Martin jacob.martin at canonical.com
Tue Jun 11 18:59:01 UTC 2024


BugLink: https://bugs.launchpad.net/bugs/2069081

The backport of commit b0325aefd398 ("dmaengine: idxd: add WQ operation
cap restriction support") for K5.15 omitted a line setting the
is_visible callback of idxd_wq_attribute_group to the
idxd_wq_attr_visible function introduced in the same commit.

This results in the op_config attribute being accessible from userspace
when the underlying wq->opcap_bmap pointer used to service reads from it
is uninitialized, leading to a NULL pointer dereference when the
op_config attribute is read. Resolve this by setting the is_visible
callback as the upstream commit does.

Signed-off-by: Jacob Martin <jacob.martin at canonical.com>
---
 drivers/dma/idxd/sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 0908746ce586..636f349b6e2d 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -1114,6 +1114,7 @@ static umode_t idxd_wq_attr_visible(struct kobject *kobj,
 
 static const struct attribute_group idxd_wq_attribute_group = {
 	.attrs = idxd_wq_attributes,
+	.is_visible = idxd_wq_attr_visible,
 };
 
 static const struct attribute_group *idxd_wq_attribute_groups[] = {
-- 
2.43.0




More information about the kernel-team mailing list