From owner-dev-commits-ports-branches@freebsd.org Mon Oct 4 04:30:29 2021 Return-Path: Delivered-To: dev-commits-ports-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBAA1675EA5; Mon, 4 Oct 2021 04:30:29 +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 4HN7795Xykz3LKn; Mon, 4 Oct 2021 04:30:29 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9EA9D12E5D; Mon, 4 Oct 2021 04:30:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1944UT56070493; Mon, 4 Oct 2021 04:30:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1944UTpo070492; Mon, 4 Oct 2021 04:30:29 GMT (envelope-from git) Date: Mon, 4 Oct 2021 04:30:29 GMT Message-Id: <202110040430.1944UTpo070492@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Philip Paeps Subject: git: 371d21badc1c - 2021Q4 - security/sshguard: Fix memset() off-by-one MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: ports X-Git-Refname: refs/heads/2021Q4 X-Git-Reftype: branch X-Git-Commit: 371d21badc1c56e48e307eb2f0a0ccf376a03cdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 04:30:30 -0000 The branch 2021Q4 has been updated by philip: URL: https://cgit.FreeBSD.org/ports/commit/?id=371d21badc1c56e48e307eb2f0a0ccf376a03cdb commit 371d21badc1c56e48e307eb2f0a0ccf376a03cdb Author: Kevin Zheng AuthorDate: 2021-09-01 05:07:43 +0000 Commit: Philip Paeps CommitDate: 2021-10-04 04:28:58 +0000 security/sshguard: Fix memset() off-by-one This bug causes a stack overflow (and crash due to failed stack check) when certain IPv6 addresses are whitelisted on i386. PR: 258179 Reported by: John Marshall MFH: 2021Q4 (cherry picked from commit c3381bf4d961159f4903f573c7f01fae85ad5a18) --- security/sshguard/Makefile | 1 + .../sshguard/files/patch-src_blocker_sshguard__whitelist.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/security/sshguard/Makefile b/security/sshguard/Makefile index ba84072408b4..48621f158097 100644 --- a/security/sshguard/Makefile +++ b/security/sshguard/Makefile @@ -2,6 +2,7 @@ PORTNAME= sshguard PORTVERSION= 2.4.2 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= security MASTER_SITES= SF/sshguard/sshguard/${PORTVERSION} diff --git a/security/sshguard/files/patch-src_blocker_sshguard__whitelist.c b/security/sshguard/files/patch-src_blocker_sshguard__whitelist.c new file mode 100644 index 000000000000..6e468872f458 --- /dev/null +++ b/security/sshguard/files/patch-src_blocker_sshguard__whitelist.c @@ -0,0 +1,11 @@ +--- src/blocker/sshguard_whitelist.c.orig 2020-12-31 17:06:03 UTC ++++ src/blocker/sshguard_whitelist.c +@@ -275,7 +275,7 @@ int whitelist_add_block6(const char *restrict address, + bitlen = masklen % 8; + bitmask = 0xFF << (8 - bitlen); + ab.address.ip6.mask.s6_addr[bytelen] = bitmask; +- memset(& ab.address.ip6.mask.s6_addr[bytelen+1], 0x00, sizeof(ab.address.ip6.mask.s6_addr) - bytelen); ++ memset(& ab.address.ip6.mask.s6_addr[bytelen+1], 0x00, sizeof(ab.address.ip6.mask.s6_addr) - bytelen - 1); + + if (! list_contains(& whitelist, &ab)) { + list_append(& whitelist, &ab);