From nobody Mon Jul 07 15:08:00 2025 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 4bbSKY2HqRz61w7r; Mon, 07 Jul 2025 15:08:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKX4C09z3wRk; Mon, 07 Jul 2025 15:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; 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=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=wR9/u04XL7YhnSf/naNmcAaeDVuWTRqcu7Ay0KNAS5AuZjSGWbfAZNRVqQVqzJFEy9Xzqi bjjCRumTrKid11zq51QE8rGlgOpbdkk4GuEfQPUhOaAep8tUUcbRXqeQeTE6meVvjrG2wu 7axvzIQ/6YFcuu1WXU/PhkX9sLexYO/spdkMP73GPJ0FutioSDb57pXeoGHTo8emK+BKBs nfR5pic9/no3A1TRjsS+AdDe42Yw6gFGQGTP8favYFgR7hLWYtpRz7tdx18HH+4g6s22nW jEfqOrctDIicRwXEYS3Q87kVyehKOe5faZSS0Q9MGtRqHoNlD4bTdY0uoNOTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; 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=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=dB9UV7A2fZLOTpCNDh4y35sefWiDB30dgU4mq+dCzFDyWGtbu06p4l8R5jx+GeMOQdtpfl jTNV4eJU03DHQy4c1boztxZPx6QLQh3CTeLx8xXTguh84JZol5TmsjkVpI6w8MmSmtWSNb x0vmKyCkKqsXQ2BKwRQJ0g3yn4IvkL8/5GXu2IeqjxzMf17ojTM7Dw2NhZRKlSjgOh2+WJ 9YjkR6aZgAiE2bNaanf1NqRVFsXRdHCK3JUabiVQnPVOCDkwXGOGoj7vcxXbuhc73Brlf5 nEp1q6L6Kp9YVU8MYB5cZhT8y3zKI3k3pY/VPrBVeNiX/QxtZzoJQUuTocssBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900880; a=rsa-sha256; cv=none; b=l6Wki9LzQt9DGIfJY5jTQYlQ89WrH388d+Zm1mUTuH4oTyaJQx9SlLfSyBH4fUZGqpZHlV TGO5tdG4uxBv9Z5I9rDHQEfgnKlNk4gIWzHMh/FNdT09d8DQ1+2wsGLFAvv/Vfn7btCuZN my8GYEG8mMLrgX4oXxpcYorRsJerPdbkz4GvrvEp9nH8BK1IFGvbgAU6y2tro7tjeJx17q 1EdJsnqOZIFqlDGqNWoNe8tuN7IEWqkUqq1IPXyJ4OB2AgH8D/mZqKxKFr93TUeOC0AzK/ 0ehLKhg/a1EPh+AQCkA05fPlAyI5DUynM7Tr8/zfVoIkIqjUzpgXilsWyAjwRg== 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 4bbSKX37PjzwNy; Mon, 07 Jul 2025 15:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F80KP016771; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F80uM016768; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:00 GMT Message-Id: <202507071508.567F80uM016768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: beb3c25d42a8 - main - pfctl: Fail on invalid netmasks when filling tables 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: beb3c25d42a885f58f77dd36e1a31199c79fbd82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=beb3c25d42a885f58f77dd36e1a31199c79fbd82 commit beb3c25d42a885f58f77dd36e1a31199c79fbd82 Author: Kristof Provost AuthorDate: 2025-07-02 13:18:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Fail on invalid netmasks when filling tables Fix a regression of revision 1.326 "Zap v4mask and v6mask in host()" which allowed CIDR networks with more than one "/" to be loaded into tables. I took care of this code path with regard to rules coming the ruleset parser, which aborts earlier on such invalid specifications, but missed `-T add 1/2/3' and the like. Analyzed and fixed by Petr Hoffmann , thanks! OK deraadt Obtained from: OpenBSD, kn , dfaca1426d Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index a213487fb648..26a213c3ffd9 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1794,7 +1794,7 @@ host(const char *s, int opts) char *p, *ps; const char *errstr; - if ((p = strrchr(s, '/')) != NULL) { + if ((p = strchr(s, '/')) != NULL) { mask = strtonum(p+1, 0, 128, &errstr); if (errstr) { fprintf(stderr, "netmask is %s: %s\n", errstr, p);