From: Jason Gunthorpe <jgg@ziepe.ca>
To: Bernard Metzler <bmt@zurich.ibm.com>
Cc: dledford@redhat.com, kamalheib1@gmail.com, krishna2@chelsio.com,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH for-rc] RDMA/iwcm: Fix iwcm work deallocation
Date: Wed, 4 Mar 2020 14:35:51 -0400 [thread overview]
Message-ID: <20200304183551.GA7859@ziepe.ca> (raw)
In-Reply-To: <20200302181614.17042-1-bmt@zurich.ibm.com>
On Mon, Mar 02, 2020 at 07:16:14PM +0100, Bernard Metzler wrote:
> The dealloc_work_entries() function must update the
> work_free_list pointer while freeing its entries, since
> potentially called again on same list. A second iteration
> of the work list caused system crash. This happens, if
> work allocation fails during cma_iw_listen() and
> free_cm_id() tries to free the list again during cleanup.
>
> Reported-by: syzbot+cb0c054eabfba4342146@syzkaller.appspotmail.com
> Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
> drivers/infiniband/core/iwcm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to for-rc, please include Fixes lines in patches like this, I
added one
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
> index ade71823370f..da8adadf4755 100644
> --- a/drivers/infiniband/core/iwcm.c
> +++ b/drivers/infiniband/core/iwcm.c
> @@ -159,8 +159,10 @@ static void dealloc_work_entries(struct iwcm_id_private *cm_id_priv)
> {
> struct list_head *e, *tmp;
>
> - list_for_each_safe(e, tmp, &cm_id_priv->work_free_list)
> + list_for_each_safe(e, tmp, &cm_id_priv->work_free_list) {
> + list_del(e);
> kfree(list_entry(e, struct iwcm_work, free_list));
It would be nice if someone were to fix the use of the list macros in
this file to use the _entry_ versions
Jason
prev parent reply other threads:[~2020-03-04 18:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 18:16 Bernard Metzler
2020-03-04 18:35 ` Jason Gunthorpe [this message]
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=20200304183551.GA7859@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=bmt@zurich.ibm.com \
--cc=dledford@redhat.com \
--cc=kamalheib1@gmail.com \
--cc=krishna2@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®