Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>, Aditya Pakki <pakki001@umn.edu>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net/rds: Avoid potential use after free in rds_send_remove_from_sock
Date: Wed, 21 Apr 2021 16:19:03 +0200
Message-ID: <CAJKOXPcyJ43m-n=ACGGgRZkWd8KDD5pNkBSY1mSOebH9BvHROA@mail.gmail.com> (raw)
In-Reply-To: <YH6azwtJXIyebCnc@unreal>

On Tue, 20 Apr 2021 at 11:13, Leon Romanovsky <leon@kernel.org> wrote:
>
> On Tue, Apr 20, 2021 at 12:09:06PM +0300, Leon Romanovsky wrote:
> > On Tue, Apr 06, 2021 at 07:09:12PM -0500, Aditya Pakki wrote:
> > > In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource
> > > is freed and later under spinlock, causing potential use-after-free.
> > > Set the free pointer to NULL to avoid undefined behavior.
> > >
> > > Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> > > ---
> > >  net/rds/message.c | 1 +
> > >  net/rds/send.c    | 2 +-
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > Dave, Jakub
> >
> > Please revert this patch, given responses from Eric and Al together
> > with this response from Greg here https://lore.kernel.org/lkml/YH5/i7OvsjSmqADv@kroah.com
>
> https://lore.kernel.org/lkml/YH5%2Fi7OvsjSmqADv@kroah.com/
>
> >
> > BTW, I looked on the rds code too and agree with Eric, this patch
> > is a total garbage.

When reverting, consider giving credits to Kees/Coverity as he pointed
out after testing linux-next that this is bogus:
https://lore.kernel.org/linux-next/202104081640.1A09A99900@keescook/


Best regards,
Krzysztof

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  0:09 Aditya Pakki
2021-04-07 18:26 ` Santosh Shilimkar
2021-04-07 21:10 ` patchwork-bot+netdevbpf
2021-04-09 10:26 ` Eric Dumazet
2021-04-19 22:12 ` Al Viro
2021-04-20  9:09 ` Leon Romanovsky
2021-04-20  9:11   ` Leon Romanovsky
2021-04-21 14:19     ` Krzysztof Kozlowski [this message]
2021-04-21 15:36       ` 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='CAJKOXPcyJ43m-n=ACGGgRZkWd8KDD5pNkBSY1mSOebH9BvHROA@mail.gmail.com' \
    --to=krzk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.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

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git