Wednesday, December 02, 2026

Re: databases/leveldb: disable snappy

On 2026/12/01 22:13, Martijn van Duren wrote: > databases/leveldb failed to build on my alpha, since it had snappy > installed by chance. Somehow it finds the library, but can't find the > header. With ports-gcc IIRC libraries are searched for in /usr/local/lib. > Since snappy isn't listed as a dependency for leveldb, let's explicitly > disable it. > > This is probably what kmos@ previously hit. Same thing for crc32c as well, but I think it might make sense to enable properly instead, i.e. the diff below. Or alternatively as it's a library only and unused by other ports, perhaps it makes sense to drop it instead. Index: Makefile =================================================================== RCS file: /cvs/ports/databases/leveldb/Makefile,v diff -u -p -r1.26 Makefile --- Makefile 20 Sep 2026 16:17:10 -0000 1.26 +++ Makefile 2 Dec 2026 11:17:33 -0000 @@ -1,8 +1,7 @@ GH_ACCOUNT= google GH_PROJECT= leveldb GH_TAGNAME= 1.23 - -REVISION= 0 +REVISION= 1 COMMENT= fast key-value storage library CATEGORIES= databases devel @@ -12,17 +11,22 @@ SHARED_LIBS= leveldb 3.0 # 0.0 # BSD3 PERMIT_PACKAGE= Yes -WANTLIB= ${COMPILER_LIBCXX} m pthread +WANTLIB= ${COMPILER_LIBCXX} crc32c m pthread snappy -# C++11 +# C++17 COMPILER= base-clang ports-gcc MODULES= devel/cmake -CONFIGURE_ARGS+= -DBUILD_SHARED_LIBS=on \ +CONFIGURE_ARGS= -DBUILD_SHARED_LIBS=on \ -DLEVELDB_INSTALL=on \ -DLEVELDB_BUILD_TESTS=off \ -DLEVELDB_BUILD_BENCHMARKS=off +CXXFLAGS += -I${LOCALBASE}/include +MODCMAKE_LDFLAGS= -L${LOCALBASE}/lib + +LIB_DEPENDS= archivers/snappy \ + devel/crc32c # Tests are broken right now due to googletest weirdness. NO_TEST= Yes Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/databases/leveldb/pkg/PLIST,v diff -u -p -r1.9 PLIST --- pkg/PLIST 11 Mar 2022 18:31:20 -0000 1.9 +++ pkg/PLIST 2 Dec 2026 11:17:33 -0000 @@ -14,7 +14,6 @@ include/leveldb/status.h include/leveldb/table.h include/leveldb/table_builder.h include/leveldb/write_batch.h -lib/cmake/ lib/cmake/leveldb/ lib/cmake/leveldb/leveldbConfig.cmake lib/cmake/leveldb/leveldbConfigVersion.cmake

dovecot-pigeonhole, fix CVE-2026-42007 (Sieve editheader use-after-free)

To: ports@openbsd.org Cc: Brad Smith <brad@comstyle.com> Subject: dovecot-pigeonhole, fix CVE-2026-42007 (Sieve editheader use-after-free) Dovecot Security Advisory 3/2026 (oss-security, 2026-08-28) lists CVE-2026-42007 (CVSS 9.1): an authenticated user can use a Sieve script with the editheader extension to trigger a use-after-free in the mail editing code, and to leak heap memory into the delivered mail, during delivery. CE is fixed only in 2.4.5; there is no 2.3 community release, so 0.5.21.1 in ports is still affected. Debian backported the fix to their 2.3 package (DLA-4873-1). The attached diff (sent as an attachment because my mailer mangles inline diffs) adds the two upstream pigeonhole commits as a patch: 69bac9cd (reset header_index first pointers before rebuilding the index, the use-after-free) and a44ba381 (copy the full header size instead of i_strndup(), the NUL-truncation over-read). Both apply to 0.5.21.1 with small offsets only. The upstream test-only commit cd9870e and the new regression .svtest files are not included, as they need Makefile.am changes. Tested on 8.0/amd64 with the OPENBSD_8_0 ports tree: - the upstream regression test deleteheader-snapshot.svtest segfaults with the current package and passes with this patch; - the full pigeonhole testsuite (make test) passes; - the package builds, installs over 0.5.21.1v1 and runs with dovecot 2.3.21.1p3v0 (Sieve and editheader delivery work as before). The same diff applies to -current. Could it also go to 8.0-stable? ok? Index: Makefile =================================================================== RCS file: /cvs/ports/mail/dovecot-pigeonhole/Makefile,v diff -u -p -u -p -r1.88 Makefile --- Makefile 16 Aug 2024 10:57:26 -0000 1.88 +++ Makefile 2 Dec 2026 09:47:03 -0000 @@ -6,6 +6,7 @@ V_DOVECOT= 2.3 DISTNAME= dovecot-${V_DOVECOT}-pigeonhole-${V_SIEVE} PKGNAME= dovecot-pigeonhole-${V_SIEVE} EPOCH= 1 +REVISION= 0 CATEGORIES= mail SITES= ${HOMEPAGE}releases/${V_DOVECOT}/ DPB_PROPERTIES= parallel Index: patches/patch-src_lib-sieve_util_edit-mail_c =================================================================== RCS file: patches/patch-src_lib-sieve_util_edit-mail_c diff -N patches/patch-src_lib-sieve_util_edit-mail_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_lib-sieve_util_edit-mail_c 2 Dec 2026 09:47:03 -0000 @@ -0,0 +1,59 @@ +Fix CVE-2026-42007 (Dovecot Security Advisory 3/2026, Sieve editheader +use-after-free and heap over-read) + +From 69bac9cd6d4ac09100ee50c98052be1437f1da29 Mon Sep 17 00:00:00 2001 +From: Timo Sirainen <timo.sirainen@open-xchange.com> +Date: Tue, 14 Apr 2026 12:58:08 +0200 +Subject: [PATCH] lib-sieve: util: edit-mail - Fix writing to freed memory + +From a44ba381619a06416ce3f34eae9765de46ece5d9 Mon Sep 17 00:00:00 2001 +From: Timo Sirainen <timo.sirainen@open-xchange.com> +Date: Fri, 1 May 2026 06:28:33 +0000 +Subject: [PATCH] lib-sieve: edit_mail_headers_parse() - Fix info leak via + NUL-truncated header copy + +Index: src/lib-sieve/util/edit-mail.c +--- src/lib-sieve/util/edit-mail.c.orig ++++ src/lib-sieve/util/edit-mail.c +@@ -550,8 +550,9 @@ edit_mail_header_field_create(struct edit_mail *edmail + &field->body_offset); + + /* Copy to new field */ +- field->data = i_strndup(str_data(data), str_len(data)); + field->size = str_len(data); ++ field->data = i_malloc(field->size + 1); ++ memcpy(field->data, str_data(data), field->size); + field->virtual_size = (edmail->crlf ? + field->size : field->size + lines); + field->lines = lines; +@@ -828,8 +829,9 @@ static int edit_mail_headers_parse(struct edit_mail *e + + field->size = str_len(hdr_data); + field->virtual_size = field->size + vsize_diff; +- field->data = i_strndup(str_data(hdr_data), +- field->size); ++ field->data = i_malloc(field->size + 1); ++ memcpy(field->data, str_data(hdr_data), ++ field->size); + field->offset = offset; + field->lines = lines; + +@@ -887,7 +889,17 @@ static int edit_mail_headers_parse(struct edit_mail *e + } + } + +- /* Rebuild header index */ ++ /* Rebuild header index. Reset first pointers before rebuilding so that ++ the actual first occurrence in the final list is used. Without this, ++ a snapshot's pre-set first pointer may refer to an appended field ++ that sits later in the list than a parsed field with the same header, ++ causing deleteheader to miss the parsed fields while still freeing ++ the header_index — leaving stale field_idx->header pointers. */ ++ struct _header_index *hidx = edmail->headers_head; ++ while (hidx != NULL) { ++ hidx->first = NULL; ++ hidx = hidx->next; ++ } + current = edmail->header_fields_head; + while (current != NULL) { + if (current->header->first == NULL)