From nobody Tue Nov 17 17:49:04 2026 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 4jTXKX5Y1cz71Xkm for ; Tue, 17 Nov 2026 17:49:04 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTXKX4qyXz4gf3 for ; Tue, 17 Nov 2026 17:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794937744; 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=MmC1gK88VleLzImof3S3J8LpYbPANItSF4vxqtJ9Z9I=; b=fY9bw7Hd3DoeQNeiK/055o9dSumMpBaECf9YWQs5BqPvZxEe4evkmGlyR+bOoNSMuDspW4 VgvdOjzBup9Wu1a9/EZFREeTdORdnd4uEclFo8VaeFTBSBggJ/UABbghEE3iNK5dXhyJ/C KXuAGfqfI6UHdxIFG7oQdjukEYg80RA2EmXKeO+8TfDUDdPG8iksS/2z6k7Qc/u2FQWdmW yxVJHm/9RtBXoLh2KEEXd0/e39uu2xCs+PeTYaZz7AxowmhXjbCnE8uZBfaVKCHAqUgem7 ssZYc0PZgGmd6YA5pCnBsJa1AwveZHjNFGbI5vtkUoj7lpLK67ZGB6b1n9i2rA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794937744; b=GeWv19WX70zvQXQPzi5RvjYaYh3calvbaFJ8dFyso9D/D/yjst8DqNzNMJq7caZNw1pBNb vwzqxodgBgawzGhCyRwY/n9RUKHI29nifK3mIsH3V4Utu5ZMUWllc6qLgGkb6wuBa/jIcB rQJyHskjEiGbE81Gzr3H3iDLrMA+dTiBQP1YZblsJTY0ZZsoOywR+kTzMAKjdZ1yyKGYDy X2TqRDdqMwFQem4/EeC8EMeo9lRNkxjPGePMjoqLmjI9iSF33hq5/4Bzu50mQLCCLVnsoD ZR8XC70fzqCjvE9JvJASBoy/VVyEMlzCAusXzYWoianOqIbFbEmxOKhqqwP1/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794937744; 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=MmC1gK88VleLzImof3S3J8LpYbPANItSF4vxqtJ9Z9I=; b=v16V8eSQK/V9UjcWUEsQ0tP0ehQpXu9VxF4Uw5duF0JHEkLa7Ug7yNk36nNrUX/oTt+J2r 4vz7/YbW61uk6+BS/OOYx/aaxnkKYMG5xJntZwFbiAbAUPUKYJMowYR/VRwCMjHDEySsm6 twMUMIY1MAnob0eZpW4Sld/LTAQxPLzgPw2cnq0rsdAxlOhVbCpYL3pDFpvQMzbYjQeth0 ftDqUOSo0uQ7lt2tqwOWnsJzJ1H69i/x2fRf7PWe7L4MFZ/q371lzHJsnWB7jrJxTpyUZ7 gspQ7gAtbqxKkDqvZy23D1g9ayITdDfci2msV2LUiRnjdE7cqgml0AljMZGSgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTXKX4Vf9zt1b for ; Tue, 17 Nov 2026 17:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3358 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:49:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: edb5996b5080 - stable/15 - MFV: Import blocklist 2026-11-12 (590e95e) List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: edb5996b5080f76114ed486ce9a0295c90786fa6 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:49:04 +0000 Message-Id: <6afc9390.3358.428db7a8@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=edb5996b5080f76114ed486ce9a0295c90786fa6 commit edb5996b5080f76114ed486ce9a0295c90786fa6 Author: Jose Luis Duran AuthorDate: 2026-11-13 13:39:12 +0000 Commit: Jose Luis Duran CommitDate: 2026-11-17 17:47:30 +0000 MFV: Import blocklist 2026-11-12 (590e95e) Merge commit 'b0788c28c7bc6631129bc366bad491cf5698b2dc' Changes: https://github.com/zoulasc/blocklist/compare/10a907f...590e95e MFC after: 3 days (cherry picked from commit ea9a38e03249e25e1be8bd8f3c64028f9ac1102f) --- contrib/blocklist/bin/blocklistd.8 | 30 ++-- contrib/blocklist/diff/named.diff | 323 ++++++++++++++-------------------- contrib/blocklist/etc/blocklistd.conf | 2 +- 3 files changed, 154 insertions(+), 201 deletions(-) diff --git a/contrib/blocklist/bin/blocklistd.8 b/contrib/blocklist/bin/blocklistd.8 index e0b9fb482cbd..73ed853325c3 100644 --- a/contrib/blocklist/bin/blocklistd.8 +++ b/contrib/blocklist/bin/blocklistd.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: blocklistd.8,v 1.8 2025/02/25 22:13:34 christos Exp $ +.\" $NetBSD: blocklistd.8,v 1.9 2026/11/12 18:47:50 christos Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 25, 2025 +.Dd November 12, 2026 .Dt BLOCKLISTD 8 .Os .Sh NAME @@ -47,14 +47,13 @@ .Nm is a daemon similar to .Xr syslogd 8 -that listens to sockets at paths specified in the -.Ar sockpathsfile -for notifications from other daemons about successful or failed connection -attempts. -If no such file is specified, then it only listens to the socket path -specified by -.Ar sockpath -or if that is not specified to +that listens to sockets for notifications from other daemons about +successful or failed connection attempts. +It listens to every socket given with +.Fl s +and every socket listed in the +.Ar sockpathsfile . +If neither is given, it listens to .Pa /var/run/blocklistd.sock . Each notification contains an (action, port, protocol, address, owner) tuple that identifies the remote connection and the action. @@ -223,7 +222,8 @@ control flush .It Fl P Ar sockpathsfile A file containing a list of pathnames, one per line that .Nm -will create sockets to listen to. +will create sockets to listen to, in addition to those given with +.Fl s . This is useful for chrooted environments. .It Fl R Ar rulename Specify the default rule name for the packet filter rules, usually @@ -238,6 +238,14 @@ Add to the list of Unix sockets .Nm listens to. +This option can be given more than once. +When any +.Fl s +or +.Fl P +option is given, +.Pa /var/run/blocklistd.sock +is not used unless it is listed explicitly. .It Fl t Ar timeout The interval in seconds .Nm diff --git a/contrib/blocklist/diff/named.diff b/contrib/blocklist/diff/named.diff index a5069ff94df7..75ebc74bde78 100644 --- a/contrib/blocklist/diff/named.diff +++ b/contrib/blocklist/diff/named.diff @@ -1,216 +1,161 @@ ---- /dev/null 2015-01-22 01:48:00.000000000 -0500 -+++ dist/bin/named/pfilter.c 2015-01-22 01:35:16.000000000 -0500 -@@ -0,0 +1,42 @@ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include "pfilter.h" -+ -+static struct blocklist *blstate; -+ -+void -+pfilter_open(void) -+{ -+ if (blstate == NULL) -+ blstate = blocklist_open(); -+} -+ -+#define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0) -+ -+void -+pfilter_notify(isc_result_t res, ns_client_t *client, const char *msg) -+{ -+ isc_socket_t *socket; -+ -+ pfilter_open(); -+ -+ if (TCP_CLIENT(client)) -+ socket = client->tcpsocket; -+ else { -+ socket = client->udpsocket; -+ if (!client->peeraddr_valid) -+ return; -+ } -+ if (socket == NULL) -+ return; -+ blocklist_sa_r(blstate, -+ res != ISC_R_SUCCESS, isc_socket_getfd(socket), -+ &client->peeraddr.type.sa, client->peeraddr.length, msg); -+} ---- /dev/null 2015-01-22 01:48:00.000000000 -0500 -+++ dist/bin/named/pfilter.h 2015-01-22 01:16:56.000000000 -0500 -@@ -0,0 +1,2 @@ -+void pfilter_open(void); -+void pfilter_notify(isc_result_t, ns_client_t *, const char *); Index: bin/named/Makefile =================================================================== -RCS file: /cvsroot/src/external/bsd/bind/bin/named/Makefile,v -retrieving revision 1.8 -diff -u -u -r1.8 Makefile ---- bin/named/Makefile 31 Dec 2013 20:23:12 -0000 1.8 -+++ bin/named/Makefile 23 Jan 2015 21:37:09 -0000 -@@ -33,7 +33,9 @@ - lwaddr.c lwdclient.c lwderror.c \ - lwdgabn.c lwdgnba.c lwdgrbn.c lwdnoop.c lwresd.c lwsearch.c \ - main.c notify.c query.c server.c sortlist.c statschannel.c \ -- tkeyconf.c tsigconf.c \ -+ pfilter.c tkeyconf.c tsigconf.c \ - update.c xfrout.c zoneconf.c ${SRCS_UNIX} +RCS file: /cvsroot/src/external/mpl/bind/bin/named/Makefile,v +retrieving revision 1.6 +diff -u -p -u -r1.6 Makefile +--- bin/named/Makefile 21 Feb 2024 22:50:56 -0000 1.6 ++++ bin/named/Makefile 9 Apr 2026 15:53:58 -0000 +@@ -47,5 +47,7 @@ CLEANFILES+= xsl.c + + main.o: ${VERSIONFILE} +LDADD+=-lblocklist +DPADD+=${LIBBLOCKLIST} + .include -Index: dist/bin/named/client.c +Index: dist/bin/named/main.c =================================================================== -RCS file: /cvsroot/src/external/bsd/bind/dist/bin/named/client.c,v -retrieving revision 1.11 -diff -u -u -r1.11 client.c ---- dist/bin/named/client.c 10 Dec 2014 04:37:51 -0000 1.11 -+++ dist/bin/named/client.c 23 Jan 2015 21:37:09 -0000 -@@ -65,6 +65,8 @@ - #include - #include +RCS file: /cvsroot/src/external/mpl/bind/dist/bin/named/main.c,v +retrieving revision 1.22 +diff -u -p -u -r1.22 main.c +--- dist/bin/named/main.c 8 Apr 2026 00:15:44 -0000 1.22 ++++ dist/bin/named/main.c 9 Apr 2026 15:53:59 -0000 +@@ -54,6 +54,8 @@ -+#include "pfilter.h" -+ - /*** - *** Client - ***/ -@@ -3101,6 +3103,7 @@ - result = ns_client_checkaclsilent(client, sockaddr ? &netaddr : NULL, - acl, default_allow); + #include -+ pfilter_notify(result, client, opname); - if (result == ISC_R_SUCCESS) - ns_client_log(client, DNS_LOGCATEGORY_SECURITY, - NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(3), -Index: dist/bin/named/main.c -=================================================================== -RCS file: /cvsroot/src/external/bsd/bind/dist/bin/named/main.c,v -retrieving revision 1.15 -diff -u -u -r1.15 main.c ---- dist/bin/named/main.c 10 Dec 2014 04:37:51 -0000 1.15 -+++ dist/bin/named/main.c 23 Jan 2015 21:37:09 -0000 -@@ -83,6 +83,9 @@ - #ifdef HAVE_LIBXML2 - #include - #endif -+ -+#include "pfilter.h" ++#include "ns/pfilter.h" + - /* - * Include header files for database drivers here. - */ -@@ -1206,6 +1209,8 @@ + #ifdef HAVE_GPERFTOOLS_PROFILER + #include + #endif /* ifdef HAVE_GPERFTOOLS_PROFILER */ +@@ -1554,6 +1556,9 @@ main(int argc, char *argv[]) { parse_command_line(argc, argv); -+ pfilter_open(); ++ // Should we have a command line flag? ++ pfilter_enable(); + - /* - * Warn about common configuration error. - */ -Index: dist/bin/named/query.c + #ifdef ENABLE_AFL + if (named_g_fuzz_type != isc_fuzz_none) { + named_fuzz_setup(); +Index: dist/lib/ns/client.c =================================================================== -RCS file: /cvsroot/src/external/bsd/bind/dist/bin/named/query.c,v -retrieving revision 1.17 -diff -u -u -r1.17 query.c ---- dist/bin/named/query.c 10 Dec 2014 04:37:52 -0000 1.17 -+++ dist/bin/named/query.c 23 Jan 2015 21:37:09 -0000 -@@ -65,6 +65,8 @@ - #include - #include +RCS file: /cvsroot/src/external/mpl/bind/dist/lib/ns/client.c,v +retrieving revision 1.27 +diff -u -p -u -r1.27 client.c +--- dist/lib/ns/client.c 8 Apr 2026 00:16:16 -0000 1.27 ++++ dist/lib/ns/client.c 9 Apr 2026 15:54:00 -0000 +@@ -66,6 +66,8 @@ + #include + #include +#include "pfilter.h" + - #if 0 - /* - * It has been recommended that DNS64 be changed to return excluded -@@ -762,6 +764,8 @@ + /*** + *** Client + ***/ +@@ -2703,6 +2705,7 @@ ns_client_checkacl(ns_client_t *client, + ns_client_log(client, DNS_LOGCATEGORY_SECURITY, + NS_LOGMODULE_CLIENT, log_level, "%s denied", + opname); ++ pfilter_notify(result, client, opname); } - - result = ns_client_checkaclsilent(client, NULL, queryacl, ISC_TRUE); -+ if (result != ISC_R_SUCCESS) -+ pfilter_notify(result, client, "validatezonedb"); - if ((options & DNS_GETDB_NOLOG) == 0) { - char msg[NS_CLIENT_ACLMSGSIZE("query")]; - if (result == ISC_R_SUCCESS) { -@@ -1026,6 +1030,8 @@ - result = ns_client_checkaclsilent(client, NULL, - client->view->cacheacl, - ISC_TRUE); -+ if (result == ISC_R_SUCCESS) -+ pfilter_notify(result, client, "cachedb"); - if (result == ISC_R_SUCCESS) { - /* - * We were allowed by the "allow-query-cache" ACL. -Index: dist/bin/named/update.c + return result; + } +Index: dist/lib/ns/xfrout.c =================================================================== -RCS file: /cvsroot/src/external/bsd/bind/dist/bin/named/update.c,v -retrieving revision 1.9 -diff -u -u -r1.9 update.c ---- dist/bin/named/update.c 10 Dec 2014 04:37:52 -0000 1.9 -+++ dist/bin/named/update.c 23 Jan 2015 21:37:09 -0000 -@@ -59,6 +59,8 @@ - #include - #include +RCS file: /cvsroot/src/external/mpl/bind/dist/lib/ns/xfrout.c,v +retrieving revision 1.16 +diff -u -p -u -r1.16 xfrout.c +--- dist/lib/ns/xfrout.c 29 Jan 2026 18:37:56 -0000 1.16 ++++ dist/lib/ns/xfrout.c 9 Apr 2026 15:54:00 -0000 +@@ -48,6 +48,8 @@ + #include + #include +#include "pfilter.h" + /*! \file * \brief - * This module implements dynamic update as in RFC2136. -@@ -307,6 +309,7 @@ - - result = ns_client_checkaclsilent(client, NULL, queryacl, ISC_TRUE); - if (result != ISC_R_SUCCESS) { -+ pfilter_notify(result, client, "queryacl"); - dns_name_format(zonename, namebuf, sizeof(namebuf)); - dns_rdataclass_format(client->view->rdclass, classbuf, - sizeof(classbuf)); -@@ -324,6 +327,7 @@ - sizeof(classbuf)); - - result = DNS_R_REFUSED; -+ pfilter_notify(result, client, "updateacl"); - ns_client_log(client, NS_LOGCATEGORY_UPDATE_SECURITY, - NS_LOGMODULE_UPDATE, ISC_LOG_INFO, - "update '%s/%s' denied", namebuf, classbuf); -@@ -362,6 +366,7 @@ - msg = "disabled"; - } else { - result = ns_client_checkaclsilent(client, NULL, acl, ISC_FALSE); -+ pfilter_notify(result, client, "updateacl"); - if (result == ISC_R_SUCCESS) { - level = ISC_LOG_DEBUG(3); - msg = "approved"; -Index: dist/bin/named/xfrout.c + * Outgoing AXFR and IXFR. +@@ -826,6 +828,7 @@ ns_xfr_start(ns_client_t *client, dns_rd + ISC_LOG_ERROR, + "zone transfer '%s/%s' denied", + _buf1, _buf2); ++ pfilter_notify(result, client, "zonexfr"); + goto cleanup; + } + if (result != ISC_R_SUCCESS) { +Index: include/ns/pfilter.h =================================================================== -RCS file: /cvsroot/src/external/bsd/bind/dist/bin/named/xfrout.c,v -retrieving revision 1.7 -diff -u -u -r1.7 xfrout.c ---- dist/bin/named/xfrout.c 10 Dec 2014 04:37:52 -0000 1.7 -+++ dist/bin/named/xfrout.c 23 Jan 2015 21:37:09 -0000 -@@ -54,6 +54,8 @@ - #include - #include - -+#include "pfilter.h" +RCS file: /cvsroot/src/external/mpl/bind/include/ns/pfilter.h,v +retrieving revision 1.1 +diff -u -p -u -r1.1 pfilter.h +--- include/ns/pfilter.h 26 Jan 2025 16:30:19 -0000 1.1 ++++ include/ns/pfilter.h 9 Apr 2026 15:54:00 -0000 +@@ -1,2 +1,3 @@ + void pfilter_enable(void); +-void pfilter_notify(isc_result_t, ns_client_t *, const char *); ++struct ns_client; ++void pfilter_notify(isc_result_t, struct ns_client *, const char *); +Index: include/ns/pfilter.h +=================================================================== +RCS file: include/ns/pfilter.h +diff -N include/ns/pfilter.h +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ include/ns/pfilter.h 9 Apr 2026 15:54:52 -0000 1.2 +@@ -0,0 +1,3 @@ ++void pfilter_enable(void); ++struct ns_client; ++void pfilter_notify(isc_result_t, struct ns_client *, const char *); +Index: lib/libns/pfilter.c +=================================================================== +RCS file: lib/libns/pfilter.c +diff -N lib/libns/pfilter.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ lib/libns/pfilter.c 26 Jan 2025 16:30:19 -0000 1.1 +@@ -0,0 +1,43 @@ + - /*! \file - * \brief - * Outgoing AXFR and IXFR. -@@ -822,6 +824,7 @@ - &client->peeraddr, - &db); - -+ pfilter_notify(result, client, "zonexfr"); - if (result == ISC_R_NOPERM) { - char _buf1[DNS_NAME_FORMATSIZE]; - char _buf2[DNS_RDATACLASS_FORMATSIZE]; ++#include ++#include ++#include ++ ++#include ++ ++#include ++ ++static struct blocklist *blstate; ++static int blenable; ++ ++void ++pfilter_enable(void) { ++ blenable = 1; ++} ++ ++#define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0) ++ ++void ++pfilter_notify(isc_result_t res, ns_client_t *client, const char *msg) ++{ ++ int fd; ++ ++ if (!blenable) ++ return; ++ ++ if (blstate == NULL) ++ blstate = blocklist_open(); ++ ++ if (blstate == NULL) ++ return; ++ ++ if (!TCP_CLIENT(client) && !client->peeraddr_valid) ++ return; ++ ++ if ((fd = isc_nmhandle_getfd(client->handle)) == -1) ++ return; ++ ++ blocklist_sa_r(blstate, ++ res != ISC_R_SUCCESS, fd, ++ &client->peeraddr.type.sa, client->peeraddr.length, msg); ++} diff --git a/contrib/blocklist/etc/blocklistd.conf b/contrib/blocklist/etc/blocklistd.conf index b52b994fe950..49eb99a4107a 100644 --- a/contrib/blocklist/etc/blocklistd.conf +++ b/contrib/blocklist/etc/blocklistd.conf @@ -9,7 +9,7 @@ domain * * named * 3 12h # adr/mask:port type proto owner name nfail duration [remote] -#129.168.0.0/16 * * * = * * +#192.168.0.0/16 * * * = * * #[2001:db8::]/32:ssh * * * = * * #6161 = = = =/24 = = #* stream tcp * = = =