All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Garver <eric@garver.life>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org, Phil Sutter <phil@nwl.cc>
Subject: Re: [PATCH nf] netfilter: nat: force port remap to prevent shadowing well-known ports
Date: Mon, 29 Nov 2021 15:22:26 -0500	[thread overview]
Message-ID: <YaU2gndowxjvV+zn@egarver.remote.csb> (raw)
In-Reply-To: <20211129144218.2677-1-fw@strlen.de>

On Mon, Nov 29, 2021 at 03:42:18PM +0100, Florian Westphal wrote:
> If destination port is above 32k and source port below 16k
> assume this might cause 'port shadowing' where a 'new' inbound
> connection matches an existing one, e.g.

How did you arrive at 16k?

> 
> inbound X:41234 -> Y:53 matches existing conntrack entry
>         Z:53 -> X:4123, where Z got natted to X.
> 
> In this case, new packet is natted to Z:53 which is likely
> unwanted.
> 
> We could avoid the rewrite for connections that are not being forwarded,
> but get_unique_tuple() and the callers don't propagate the required hook
> information for this.
> 
> Also adjust test case.
> 
> Cc: Eric Garver <eric@garver.life>
> Cc: Phil Sutter <phil@nwl.cc>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---

[..]


  reply	other threads:[~2021-11-29 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 14:42 [PATCH nf] netfilter: nat: force port remap to prevent shadowing well-known ports Florian Westphal
2021-11-29 20:22 ` Eric Garver [this message]
2021-11-29 22:02   ` Florian Westphal
2021-11-30 14:34     ` Eric Garver
2021-12-08  0:28 ` Pablo Neira Ayuso
2021-12-08 10:47   ` Florian Westphal

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=YaU2gndowxjvV+zn@egarver.remote.csb \
    --to=eric@garver.life \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.