Linux-RDMA Archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Wenchao Hao <haowenchao2@huawei.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/restrack: Fix potential invalid address access
Date: Sun, 10 Mar 2024 11:24:54 +0200	[thread overview]
Message-ID: <20240310092454.GA12921@unreal> (raw)
In-Reply-To: <c84561e1-0fc5-4381-961f-a246b577938f@huawei.com>

On Thu, Mar 07, 2024 at 10:17:59PM +0800, Wenchao Hao wrote:
> On 2024/3/7 17:13, Leon Romanovsky wrote:
> > On Fri, Mar 01, 2024 at 05:55:15PM +0800, Wenchao Hao wrote:
> > > struct rdma_restrack_entry's kern_name was set to KBUILD_MODNAME
> > > in ib_create_cq(), while if the module exited but forgot del this
> > > rdma_restrack_entry, it would cause a invalid address access in
> > > rdma_restrack_clean() when print the owner of this rdma_restrack_entry.
> > > 
> > > Fix this issue by using kstrdup() to set rdma_restrack_entry's
> > > kern_name.
> > 
> > I don't like kstrdup() and would like to avoid it, this rdma_restrack_clean()
> > is purely for debugging and for a long time all upstream ULPs are "clean"
> > from these not-released bugs.
> > 
> > So my suggestion is to delete that part of code and it will be good enough.
> > 
> 
> It's OK for me. When found this issue, my first plan is to remove the code, but
> I do not know why these code is added, so decide to using kstrdup() to work around
> it.

This code helped us to find one forgotten PD release in one of the ULPs. But it is not needed anymore.

> 
> Then what to do next? Do I need to post another patch or you would fix it by yourself?

Please send new patch, thanks.

      reply	other threads:[~2024-03-10  9:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  9:55 [PATCH] RDMA/restrack: Fix potential invalid address access Wenchao Hao
2024-03-03 12:57 ` Leon Romanovsky
2024-03-04  3:21   ` Wenchao Hao
2024-03-04  7:35     ` Leon Romanovsky
2024-03-04 13:33       ` Wenchao Hao
2024-03-07  9:13 ` Leon Romanovsky
2024-03-07 14:17   ` Wenchao Hao
2024-03-10  9:24     ` Leon Romanovsky [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=20240310092454.GA12921@unreal \
    --to=leon@kernel.org \
    --cc=haowenchao2@huawei.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).