Skip to content

[ciqcbr7_9] RDMA/mlx4: Fix mis-use of RCU in mlx4_srq_event()#1414

Open
ciq-kernel-automation[bot] wants to merge 1 commit into
ciqcbr7_9from
{rnicolescu}_ciqcbr7_9
Open

[ciqcbr7_9] RDMA/mlx4: Fix mis-use of RCU in mlx4_srq_event()#1414
ciq-kernel-automation[bot] wants to merge 1 commit into
ciqcbr7_9from
{rnicolescu}_ciqcbr7_9

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

RDMA/mlx4: Fix mis-use of RCU in mlx4_srq_event()

jira VULN-187920
cve CVE-2026-46181
commit-author Jason Gunthorpe <jgg@nvidia.com>
commit c9341307ea16b9395c2e4c9c94d8499d91fe31d0
upstream-diff |
        refcount_set_release() does not exist.
        Instead of backporting the wrapper, atomic_set_release() was used
        directly on the underlying aromic_t.

Test Results

✅ Build Stage

  • Status: Passed (x86_64)

  • Build Time: 13m 14s

  • Total Time: 14m 21s

  • View build logs

✅ Boot Verification


🤖 This PR was automatically generated by GitHub Actions
Run ID: 28932729679

jira VULN-187920
cve CVE-2026-46181
commit-author Jason Gunthorpe <jgg@nvidia.com>
commit c934130
upstream-diff |
        refcount_set_release() does not exist.
        Instead of backporting the wrapper, atomic_set_release() was used
        directly on the underlying aromic_t.

Sashiko points out the radix_tree itself is RCU safe, but nothing ever
frees the mlx4_srq struct with RCU, and it isn't even accessed within the
RCU critical section. It also will crash if an event is delivered before
the srq object is finished initializing.

Use the spinlock since it isn't easy to make RCU work, use
refcount_inc_not_zero() to protect against partially initialized objects,
and order the refcount_set() to be after the srq is fully initialized.

	Cc: stable@vger.kernel.org
Fixes: 30353bf ("net/mlx4_core: Use RCU to perform radix tree lookup for SRQ")
Link: https://sashiko.dev/#/patchset/0-v2-1c49eeb88c48%2B91-rdma_udata_rep_jgg%40nvidia.com?part=5
Link: https://patch.msgid.link/r/12-v1-41f3135e5565+9d2-rdma_ai_fixes1_jgg@nvidia.com
	Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
(cherry picked from commit c934130)
	Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28934969157

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 97a8b9c223b1 (RDMA/mlx4: Fix mis-use of RCU in mlx4_srq_event()) → upstream c9341307ea16
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/drivers/net/ethernet/mellanox/mlx4/srq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/srq.c
@@ -206,7 +206,7 @@
 		goto err_radix;
 
 	init_completion(&srq->free);
-	atomic_set_release(&srq->refcount.refs, 1);
+	refcount_set_release(&srq->refcount, 1);
 
 	return 0;

This is an automated interdiff check for backported commits.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28934969157

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@bmastbergen bmastbergen requested a review from a team July 8, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

1 participant