public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: yanjun.zhu@linux.dev, jgg@ziepe.ca, leon@kernel.org,
	linux-rdma@vger.kernel.org, zyjzyj2000@gmail.com
Cc: syzbot+ab99dc4c6e961eed8b8e@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/3] RDMA/rxe: Fix "kernel NULL pointer dereference" error
Date: Mon, 22 Aug 2022 14:00:18 -0500	[thread overview]
Message-ID: <6aaad445-0c9c-ad35-4941-7d3a6653cab6@gmail.com> (raw)
In-Reply-To: <20220822011615.805603-2-yanjun.zhu@linux.dev>

On 8/21/22 20:16, yanjun.zhu@linux.dev wrote:
> From: Zhu Yanjun <yanjun.zhu@linux.dev>
> 
> When rxe_queue_init in the function rxe_qp_init_req fails,
> both qp->req.task.func and qp->req.task.arg are not initialized.
> 
> Because of creation of qp fails, the function rxe_create_qp will
> call rxe_qp_do_cleanup to handle allocated resource.
> 
> Before calling __rxe_do_task, both qp->req.task.func and
> qp->req.task.arg should be checked.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Reported-by: syzbot+ab99dc4c6e961eed8b8e@syzkaller.appspotmail.com
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> ---
>  drivers/infiniband/sw/rxe/rxe_qp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
> index 516bf9b95e48..f10b461b9963 100644
> --- a/drivers/infiniband/sw/rxe/rxe_qp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_qp.c
> @@ -797,7 +797,9 @@ static void rxe_qp_do_cleanup(struct work_struct *work)
>  	rxe_cleanup_task(&qp->comp.task);
>  
>  	/* flush out any receive wr's or pending requests */
> -	__rxe_do_task(&qp->req.task);
> +	if (qp->req.task.func && qp->req.task.arg)
func would be enough since they get set together. But, this is still fine since not performance critical.
> +		__rxe_do_task(&qp->req.task);
> +
>  	if (qp->sq.queue) {
>  		__rxe_do_task(&qp->comp.task);
>  		__rxe_do_task(&qp->req.task);

Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com>

  reply	other threads:[~2022-08-22 19:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  1:16 [PATCH 0/3] Fixes for syzbot problem yanjun.zhu
2022-08-22  1:16 ` [PATCH 1/3] RDMA/rxe: Fix "kernel NULL pointer dereference" error yanjun.zhu
2022-08-22 19:00   ` Bob Pearson [this message]
2022-08-23  5:43     ` lizhijian
2022-08-22  1:16 ` [PATCH 2/3] RDMA/rxe: Fix the error caused by qp->sk yanjun.zhu
2022-08-22 19:01   ` Bob Pearson
2022-08-23  5:53     ` lizhijian
2022-08-22  1:16 ` [PATCH 3/3] RDMA/rxe: Remove the unused variable obj yanjun.zhu
2022-08-22 19:06   ` Bob Pearson
2022-08-23  5:54     ` lizhijian
2022-08-29 14:59 ` [PATCH 0/3] Fixes for syzbot problem Yanjun Zhu
2022-08-31  6:54 ` Leon Romanovsky

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=6aaad445-0c9c-ad35-4941-7d3a6653cab6@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=syzbot+ab99dc4c6e961eed8b8e@syzkaller.appspotmail.com \
    --cc=yanjun.zhu@linux.dev \
    --cc=zyjzyj2000@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox