netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org,
	Oleksandr Natalenko <oleksandr@redhat.com>
Subject: Re: [PATCH v2 nf] netfilter: nf_queue: don't assume sk is full socket
Date: Mon, 28 Feb 2022 04:10:38 +0100	[thread overview]
Message-ID: <20220228031038.GB26547@breakpoint.cc> (raw)
In-Reply-To: <8cd10394-ae9c-a727-2b33-dd89516ac5b9@gmail.com>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > +		nf_queue_sock_put(state->sk);
> >   #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
> >   	dev_put(entry->physin);
> 
> 
> OK but it looks like there might be an orthogonal bug.
> 
> The sock_hold() side seems suspect, because there is no guarantee
> 
> that sk_refcnt is not already 0.

Ugh.  Looks like we also need skb_sk_is_prefetched() check and then
take care of skb->sk too if its not owned by skb destructor.

> Not sure how netfilter would react with stats->sk set to NULL ?

Its passed as arg to dst_output() later so I think its fine.

      reply	other threads:[~2022-02-28  3:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 13:02 [PATCH v2 nf] netfilter: nf_queue: don't assume sk is full socket Florian Westphal
2022-02-28  2:46 ` Eric Dumazet
2022-02-28  3:10   ` Florian Westphal [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=20220228031038.GB26547@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=oleksandr@redhat.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;
as well as URLs for NNTP newsgroup(s).