Skip to contentSkip to conversation

Patch "IB/core: Avoid a potential OOPs for an unused optional parameter" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 18, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

IB/core: Avoid a potential OOPs for an unused optional parameter

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ib-core-avoid-a-potential-oops-for-an-unused-optional-parameter.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2ff124d597c2df8696169ce0006fc974c49a4569 Mon Sep 17 00:00:00 2001

From: "Michael J. Ruhl" <[email protected]>
Date: Thu, 1 Feb 2018 12:31:06 -0800
Subject: IB/core: Avoid a potential OOPs for an unused optional parameter

From: Michael J. Ruhl <[email protected]>

commit 2ff124d597c2df8696169ce0006fc974c49a4569 upstream.

The ev_file is an optional parameter for CQ creation. If the parameter is not passed, the ev_file pointer will be NULL. Using that pointer to set the cq_context will result in an OOPs.

Verify that ev_file is not NULL before using.

Cc <[email protected]> # 4.14.x
Fixes 9ee79fce3642 ("IB/core: Add completion queue (cq) object actions")
---
 drivers/infiniband/core/uverbs_std_types.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/uverbs_std_types.c +1 -1
@@ -315,7 +315,7 @@ static int uverbs_create_cq_handler(stru
 	cq->uobject       = &obj->uobject;
 	cq->comp_handler  = ib_uverbs_comp_handler;
 	cq->event_handler = ib_uverbs_cq_event_handler;
-	cq->cq_context    = &ev_file->ev_queue;
+	cq->cq_context    = ev_file ? &ev_file->ev_queue : NULL;
 	obj->uobject.object = cq;
 	obj->uobject.user_handle = user_handle;
 	atomic_set(&cq->usecnt, 0);

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/ib-core-avoid-a-potential-oops-for-an-unused-optional-parameter.patch queue-4.14/ib-qib-fix-comparison-error-with-qperf-compare-swap-test.patch