From: Simon Horman <horms@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>, Willy Tarreau <w@1wt.eu>,
Keyu Man <keyu.man@email.ucr.edu>,
Jesper Dangaard Brouer <hawk@kernel.org>,
netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next 0/3] icmp: avoid possible side-channels attacks
Date: Thu, 29 Aug 2024 21:11:00 +0100 [thread overview]
Message-ID: <20240829201100.GY1368797@kernel.org> (raw)
In-Reply-To: <20240829144641.3880376-1-edumazet@google.com>
On Thu, Aug 29, 2024 at 02:46:38PM +0000, Eric Dumazet wrote:
> Keyu Man reminded us that linux ICMP rate limiting was still allowing
> side-channels attacks.
>
> Quoting the fine document [1]:
>
> 4.4 Private Source Port Scan Method
> ...
> We can then use the same global ICMP rate limit as a side
> channel to infer if such an ICMP message has been triggered. At
> first glance, this method can work but at a low speed of one port
> per second, due to the per-IP rate limit on ICMP messages.
> Surprisingly, after we analyze the source code of the ICMP rate
> limit implementation, we find that the global rate limit is checked
> prior to the per-IP rate limit. This means that even if the per-IP
> rate limit may eventually determine that no ICMP reply should be
> sent, a packet is still subjected to the global rate limit check and one
> token is deducted. Ironically, such a decision is consciously made
> by Linux developers to avoid invoking the expensive check of the
> per-IP rate limit [ 22], involving a search process to locate the per-IP
> data structure.
> This effectively means that the per-IP rate limit can be disre-
> garded for the purpose of our side channel based scan, as it only
> determines if the final ICMP reply is generated but has nothing to
> do with the global rate limit counter decrement. As a result, we can
> continue to use roughly the same scan method as efficient as before,
> achieving 1,000 ports per second
> ...
>
> This series :
>
> 1) Changes the order of the two rate limiters to fix the issue.
>
> 2-3) Make the 'host-wide' rate limiter a per-netns one.
>
> [1]
> Link: https://dl.acm.org/doi/pdf/10.1145/3372297.3417280
>
> v2: added kerneldoc changes for icmp_global_allow() (Simon)
Thanks for the update; confirming that part looks good to me.
next prev parent reply other threads:[~2024-08-29 20:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 14:46 [PATCH v2 net-next 0/3] icmp: avoid possible side-channels attacks Eric Dumazet
2024-08-29 14:46 ` [PATCH v2 net-next 1/3] icmp: change the order of rate limits Eric Dumazet
2024-08-29 14:46 ` [PATCH v2 net-next 2/3] icmp: move icmp_global.credit and icmp_global.stamp to per netns storage Eric Dumazet
2024-08-29 14:46 ` [PATCH v2 net-next 3/3] icmp: icmp_msgs_per_sec and icmp_msgs_burst sysctls become per netns Eric Dumazet
2024-08-29 20:11 ` Simon Horman [this message]
2024-08-30 18:40 ` [PATCH v2 net-next 0/3] icmp: avoid possible side-channels attacks patchwork-bot+netdevbpf
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=20240829201100.GY1368797@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=hawk@kernel.org \
--cc=keyu.man@email.ucr.edu \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=w@1wt.eu \
/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).