linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: Sagi Grimberg <sagi@grimberg.me>, Christoph Hellwig <hch@lst.de>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Keith Busch <kbusch@kernel.org>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	Hannes Reinecke <hare@suse.de>,
	Yanjun Zhang <zhangyanjun@cestc.cn>
Subject: Re: [PATCH v3] nvme-tcp: fix a possible UAF when failing to allocate an io queue
Date: Wed, 22 Mar 2023 09:15:39 +0100	[thread overview]
Message-ID: <20230322081539.GA22139@lst.de> (raw)
In-Reply-To: <915f65a2-226c-ae20-0575-e20120e72a72@nvidia.com>

On Tue, Mar 21, 2023 at 05:12:57AM +0000, Chaitanya Kulkarni wrote:
> > +#ifdef CONFIG_NET_RX_BUSY_POLL
> > +	queue->sock->sk->sk_ll_usec = 1;
> > +#endif
> > +	write_unlock_bh(&queue->sock->sk->sk_callback_lock);
> > +}
> > +
> 
> since its is not in the fast path, is there a particular reason not
> to use following ?
> 
> if (IS_ENABLED(CONFIG_NET_RX_BUSY_POLL)
> 	queue->sock->sk->sk_ll_usec = 1;

That won't compile, as the sk_ll_usec is not defined without
CONFIG_NET_RX_BUSY_POLL.

Note that this has nothing to do with a fast path - for cases where
IS_ENABLED works there is no performance benefit to use an ifdef
given that IS_ENABLED is ѕpecifically designed to lead to compiler
dead code elimination.


  reply	other threads:[~2023-03-22  8:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 13:33 [PATCH v3] nvme-tcp: fix a possible UAF when failing to allocate an io queue Sagi Grimberg
2023-03-21  5:12 ` Chaitanya Kulkarni
2023-03-22  8:15   ` Christoph Hellwig [this message]
2023-03-22  8:18     ` Sagi Grimberg
2023-03-22  8:20 ` Christoph Hellwig
2023-03-22  8:24   ` Sagi Grimberg
2023-03-22  8:27     ` Christoph Hellwig
2023-03-22 13:06       ` Sagi Grimberg
  -- strict thread matches above, loose matches on Subject: below --
2023-03-29  6:23 zhangyanjun
2023-03-30  2:27 ` Christoph Hellwig
2023-03-30  2:14 zhangyanjun

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=20230322081539.GA22139@lst.de \
    --to=hch@lst.de \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=chaitanyak@nvidia.com \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=zhangyanjun@cestc.cn \
    /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 NNTP newsgroup(s).