From nobody Fri Apr 17 11:55:43 2026 X-Original-To: dev-commits-src-main@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 4fxtcc3SZtz6ZdY2 for ; Fri, 17 Apr 2026 11:55:44 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcb3h8Kz47JY for ; Fri, 17 Apr 2026 11:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426943; 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=5khgc9K8z9W6+pfQ7UMJj2PfJFQ9f7OsSxhWFGS2Zi4=; b=b9WmRfVICGamniIvCNHOgrOW37+x+6hZAOyThTOPMVFHIy5cgTqO+rEZ216oYokx/7vZBb ItvG6FiV023GNqJjB+QY4C0kn2vADSxORdLzOx2EJvQ+xN5GzaDDVac0VTq+1gDZM0O78s SHOaSAP09NuB2sRREtIVCiGJtVVBFkeZLnLTAzlkzq0FcyopI9vcLTKzJ+3Am/JoWKo0Pg J3g93BuP8rc9In3HkSAsB4z56u59WaAeP9ap9gb/xQhMKjvnzUVrsU04KLH200NiW6Qlmm M9AIZx2gBldCf59OHU2zOIMJi2ioi666V6Oj7x1kdenLJWwfjueTcsgzHA75Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426943; a=rsa-sha256; cv=none; b=CW4WRMGtHJTtwdNl1/qwqW+wFQpLgoG3lITxHjcXgqxCd+hG4HMCDMV+QKxgbrSj/9ZDbd UazfFmoKZ9dHsoBH+4BBD7Uo5r+bn6UN4gvlM9KjkM8NdXTvRDiYHinL/0hoRovmCCZYa+ huyiSRSSVp50nN+990kJjCtMluEkv0aFSv2O1YXGkW/7+yPeCyAoszSJHOgbcydejKJ1cC bXvarlzI9iGtEMMNgA6lD9dNgxjF9ywvjO4Ey9oJwqq1ndSVkx0O611QKbaIPKVzxP5Zft /SFhs/RMv9RM/hYoT86z+QegD3mctaqp7MagmktKoDU6WMdpi7bK0iQ2EJftBQ== 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=1776426943; 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=5khgc9K8z9W6+pfQ7UMJj2PfJFQ9f7OsSxhWFGS2Zi4=; b=QEt0IKfC9DLwDIjZZDRq5bQIpzDw3e07rL3IT2IX96jzXt/uUZnjjzdUOYe1LZQSHTTwuO Meoa9y09S91C2yIYybBZEQ7hoqHA90sdtAH8wIluwJ4mAqcC9+nmTynMSytLs62AjOUbF6 PbWTmQwGwtawPauhVT5KB1695aEbsZ5CC9u9yAt8TnY5iZuL7tieOFfuo68ldSuEomeCE+ /Rw7SzVCdTMSZhhqCWb8l+qYZIt4GkcFrhiC5YN/hCUBVNxaq3A4YL7zmwUTDDc6eGOLAw mxF1+waNsjqdUiYs3V3vDonBbIvnW1hYdcPrZkv7o89H2f9Mlescgqu5IUyuXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcb1MDLzsxV for ; Fri, 17 Apr 2026 11:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b1f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 05ac1013984c - main - pf: fix error handling in pf_sourcelim_add() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05ac1013984ced5b8b57430fe92a7074e34054ce Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:43 +0000 Message-Id: <69e21fbf.3b1f5.27471d54@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05ac1013984ced5b8b57430fe92a7074e34054ce commit 05ac1013984ced5b8b57430fe92a7074e34054ce Author: Kristof Provost AuthorDate: 2026-04-16 13:49:26 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:06 +0000 pf: fix error handling in pf_sourcelim_add() There are two issues in pf_sourcelim_add() error path: - stale pointers are left in pf_sourcelim_id_tree_inactive when duplicate source limiter instance is found in pf_sourcelim_nm_tree - overload table may leak when insertion of new source limiter instance fails. Both issues reported and patch submitted by: Renaud Allard OK sashan@ Obtained from: OpenBSD, sashan , 32063577ec Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index a2e12b3065d0..8b2ff108d9cb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2239,7 +2239,7 @@ pf_sourcelim_add(const struct pfioc_sourcelim *ioc) if (RB_INSERT(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, pfsrlim) != NULL) { - RB_INSERT(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, + RB_REMOVE(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, pfsrlim); error = EBUSY; goto unlock; @@ -2252,6 +2252,8 @@ pf_sourcelim_add(const struct pfioc_sourcelim *ioc) return (0); unlock: + if (pfsrlim->pfsrlim_overload.table != NULL) + pfr_detach_table(pfsrlim->pfsrlim_overload.table); PF_RULES_WUNLOCK(); free: