From nobody Wed Jun 26 04:50:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W88QT5cbGz5P0Cs; Wed, 26 Jun 2024 04:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W88QT36nXz57NT; Wed, 26 Jun 2024 04:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719377425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5+TJRontAsJADPOnGrds5LWmoMxcx/u7b/IMuIc0X4s=; b=E01Q4pVd856gsJYg0h9KPI5SmCZ0DS7EaXIZIkvomcXkiECvLX/dDlCMyaM4cT+8p6K/jn ZnLFx6lVt+04f6VhAle6JNI7rTEAViHy738ApzCNFeHVGLimMuPBjdQTwWNec9pvHYEXeX RMoRNT+RuRgNy1N6lTpz8N4xZJvy2eSierliwGT2H79rPfdetK6iY8BWuXpjTSL/ZFuoIX Szz4rshj9ylvsGWD0gf5/LHBjbBp5WPVL4D0y65isd1hvxv5NhMUc1a7TtPMw9Y5SmYiMj Lf0kZR3xRrpxqqIfKcAXEvgqfcYuhx4ZT6aF0njmebopzof0BODSM1S9wuG1sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719377425; a=rsa-sha256; cv=none; b=jBNK/SHS8acU+vYQwogFSdt8W5YcY9tms8Pl06kKMEuqheye87IwfCuUNA4mPnyUupQKxC f9OHBZGg5XtEwhFI2c3/ju13rrwqqRr53wUhI0yxTOoYYDrbpFLJCB3j6dHajI+HxKi5Vg o+xsw9/4j/H5KYXNnARzHR16AfIBAaN7Arr22qlHLCmw4z/EVloeZvvKuJI0C6SgAICAmH zYghoIUjtEbu60c3H6ZbdBhQrliO5J4E1mcru2OjQuj0+83jmjZSmaZADT/cjh5TrP5jvm ch/jlwxyx25Deajf5fZZhNCYma3ZuU2mCyzkA+qLj4GpkmsFz+Ul13uKFpFp7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719377425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5+TJRontAsJADPOnGrds5LWmoMxcx/u7b/IMuIc0X4s=; b=wqrH/h9iG2CQOR/3+yNMn7aJQgfeJgQhQbAVMEwl3IWGTSyuYR8xCoFAb4cCHUtj/HSZE0 skoM0kdstslhWuwfvLMhus3SNzhDHZ1sGwID5MGg8HfWdd/3WJZIFyp5xl3ZwHjz69D4jL Cc+U66ngR8WyiXAo6oAns0oRiruZffjSyYDUEU6bH0Xw8yuMmW2K6pVz5sd8aZd168UxKX OPDRWOsWZ/LRZkEe8znFH2Z3Wm8RoKNeH5753TEhrw1HrMKcWpw5dV0ea6MbA9SP1axLM9 UIiZNBBglSRPpIbiieaohzUup7uTEaoviUAuvgqIxaADh+5dbJBAloAouSh1EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W88QT2jTSzXNM; Wed, 26 Jun 2024 04:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45Q4oP2O063817; Wed, 26 Jun 2024 04:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45Q4oPPD063814; Wed, 26 Jun 2024 04:50:25 GMT (envelope-from git) Date: Wed, 26 Jun 2024 04:50:25 GMT Message-Id: <202406260450.45Q4oPPD063814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f6561ff8ee10 - stable/14 - icmp6: rate limit our echo replies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6561ff8ee103194e2551efdfda1cd6d655b183d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f6561ff8ee103194e2551efdfda1cd6d655b183d commit f6561ff8ee103194e2551efdfda1cd6d655b183d Author: Gleb Smirnoff AuthorDate: 2024-03-24 16:13:23 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-26 04:48:43 +0000 icmp6: rate limit our echo replies The generation of ICMP6_ECHO_REPLY bypasses icmp6_error(), thus rate limit was not applied. Reviewed by: tuexen, zlei Differential Revision: https://reviews.freebsd.org/D44480 (cherry picked from commit 32aeee8ce7e72738fff236ccd5629d55035458f8) --- sys/netinet6/icmp6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index ba66e18b6524..5b384889d422 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -548,6 +548,8 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) icmp6_ifstat_inc(ifp, ifs6_in_echo); if (code != 0) goto badcode; + if (icmp6_ratelimit(&ip6->ip6_src, ICMP6_ECHO_REPLY, 0)) + break; if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Give up remote */ break;