From: "yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>
To: "aglo@umich.edu" <aglo@umich.edu>
Cc: "yangx.jy@fujitsu.com" <yangx.jy@fujitsu.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"rpearsonhpe@gmail.com" <rpearsonhpe@gmail.com>,
"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"leon@kernel.org" <leon@kernel.org>
Subject: Re: [PATCH] RDMA/rxe: Zero out index member of struct rxe_queue
Date: Fri, 20 Aug 2021 10:48:46 +0000 [thread overview]
Message-ID: <611F888D.1050608@fujitsu.com> (raw)
In-Reply-To: <20210820111509.172500-1-yangx.jy@fujitsu.com>
Hi Olga Kornievskaia,
Could you check if this patch can fix your issues?
https://www.spinics.net/lists/linux-rdma/msg104358.html
https://www.spinics.net/lists/linux-rdma/msg104359.html
https://www.spinics.net/lists/linux-rdma/msg104360.html
By the way, this patch can fix my panic.
Best Regards,
Xiao Yang
On 2021/8/20 19:15, Xiao Yang wrote:
> 1) New index member of struct rxe_queue is introduced but not zeroed
> so the initial value of index may be random.
> 2) Current index is not masked off to index_mask.
> In such case, producer_addr() and consumer_addr() will get an invalid
> address by the random index and then accessing the invalid address
> triggers the following panic:
> "BUG: unable to handle page fault for address: ffff9ae2c07a1414"
>
> Fix the issue by using kzalloc() to zero out index member.
>
> Fixes: 5bcf5a59c41e ("RDMA/rxe: Protext kernel index from user space")
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
> drivers/infiniband/sw/rxe/rxe_queue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c
> index 85b812586ed4..72d95398e604 100644
> --- a/drivers/infiniband/sw/rxe/rxe_queue.c
> +++ b/drivers/infiniband/sw/rxe/rxe_queue.c
> @@ -63,7 +63,7 @@ struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe, int *num_elem,
> if (*num_elem < 0)
> goto err1;
>
> - q = kmalloc(sizeof(*q), GFP_KERNEL);
> + q = kzalloc(sizeof(*q), GFP_KERNEL);
> if (!q)
> goto err1;
>
next prev parent reply other threads:[~2021-08-20 10:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-20 11:15 [PATCH] RDMA/rxe: Zero out index member of struct rxe_queue Xiao Yang
2021-08-20 10:48 ` yangx.jy [this message]
2021-08-20 18:44 ` Bob Pearson
2021-08-21 13:00 ` yangx.jy
2021-08-24 18:04 ` Bob Pearson
2021-08-20 19:10 ` Jason Gunthorpe
2021-08-21 7:21 ` Zhu Yanjun
2021-08-23 4:37 ` yangx.jy
2021-08-23 5:42 ` Zhu Yanjun
2021-08-23 6:18 ` yangx.jy
2021-08-23 6:48 ` Zhu Yanjun
2021-09-01 5:42 ` yangx.jy
2021-09-01 6:03 ` Zhu Yanjun
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=611F888D.1050608@fujitsu.com \
--to=yangx.jy@fujitsu.com \
--cc=aglo@umich.edu \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=rpearsonhpe@gmail.com \
--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 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.