From owner-svn-ports-head@freebsd.org Sat Jan 30 13:22:41 2021 Return-Path: Delivered-To: svn-ports-head@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 5406C4ECA90; Sat, 30 Jan 2021 13:22:41 +0000 (UTC) (envelope-from dim@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 4DSZdF1v9Kz4Y7V; Sat, 30 Jan 2021 13:22:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33E93163CC; Sat, 30 Jan 2021 13:22:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 10UDMeJh038977; Sat, 30 Jan 2021 13:22:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 10UDMddO038970; Sat, 30 Jan 2021 13:22:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202101301322.10UDMddO038970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 30 Jan 2021 13:22:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r563405 - in head/net: samba411 samba411/files samba412 samba412/files samba413 samba413/files X-SVN-Group: ports-head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/net: samba411 samba411/files samba412 samba412/files samba413 samba413/files X-SVN-Commit-Revision: 563405 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 13:22:41 -0000 Author: dim (src committer) Date: Sat Jan 30 13:22:39 2021 New Revision: 563405 URL: https://svnweb.freebsd.org/changeset/ports/563405 Log: net/samba411 net/samba412 net/samba413: Fix zero-sized VLAs With recent versions of clang, samba could dump core shortly after startup, terminating with either SIGILL or SIGSEGV. Investigation showed that samba is using C99 variable length arrays (VLAs), and in some cases the length of these arrays would become zero. Since this is undefined behavior, various interesting things would happen, often ending in segfaults. Fix this by avoiding to use zero as the length for these VLA declarations. A similar patch was also sent upstream, and was accepted and included in subsequent samba releases. See also: https://bugzilla.samba.org/show_bug.cgi?id=14605 Reported by: Dries Michiels PR: 252157 MFH: 2021Q1 Added: head/net/samba411/files/patch-source3_lib_messages.c (contents, props changed) head/net/samba412/files/patch-source3_lib_messages.c (contents, props changed) head/net/samba413/files/patch-source3_lib_messages.c (contents, props changed) Modified: head/net/samba411/Makefile head/net/samba412/Makefile head/net/samba413/Makefile Modified: head/net/samba411/Makefile ============================================================================== --- head/net/samba411/Makefile Sat Jan 30 13:19:45 2021 (r563404) +++ head/net/samba411/Makefile Sat Jan 30 13:22:39 2021 (r563405) @@ -3,7 +3,7 @@ PORTNAME= ${SAMBA4_BASENAME}411 PORTVERSION= ${SAMBA4_VERSION} -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES?= net MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc DISTNAME= ${SAMBA4_DISTNAME} Added: head/net/samba411/files/patch-source3_lib_messages.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/samba411/files/patch-source3_lib_messages.c Sat Jan 30 13:22:39 2021 (r563405) @@ -0,0 +1,29 @@ +--- source3/lib/messages.c.orig 2020-01-08 10:24:52 UTC ++++ source3/lib/messages.c +@@ -158,7 +158,7 @@ struct messaging_rec *messaging_rec_create( + + { + struct messaging_rec rec; +- int64_t fds64[num_fds]; ++ int64_t fds64[MAX(1, num_fds)]; + size_t i; + + for (i=0; ievent_ctx) { + struct iovec iov; +- int fds[rec->num_fds]; ++ int fds[MAX(1, rec->num_fds)]; + int ret; + + /* Modified: head/net/samba412/Makefile ============================================================================== --- head/net/samba412/Makefile Sat Jan 30 13:19:45 2021 (r563404) +++ head/net/samba412/Makefile Sat Jan 30 13:22:39 2021 (r563405) @@ -3,7 +3,7 @@ PORTNAME= ${SAMBA4_BASENAME}412 PORTVERSION= ${SAMBA4_VERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES?= net MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc DISTNAME= ${SAMBA4_DISTNAME} Added: head/net/samba412/files/patch-source3_lib_messages.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/samba412/files/patch-source3_lib_messages.c Sat Jan 30 13:22:39 2021 (r563405) @@ -0,0 +1,29 @@ +--- source3/lib/messages.c.orig 2020-02-28 08:59:35 UTC ++++ source3/lib/messages.c +@@ -157,7 +157,7 @@ struct messaging_rec *messaging_rec_create( + + { + struct messaging_rec rec; +- int64_t fds64[num_fds]; ++ int64_t fds64[MAX(1, num_fds)]; + size_t i; + + for (i=0; ievent_ctx) { + struct iovec iov; +- int fds[rec->num_fds]; ++ int fds[MAX(1, rec->num_fds)]; + int ret; + + /* Modified: head/net/samba413/Makefile ============================================================================== --- head/net/samba413/Makefile Sat Jan 30 13:19:45 2021 (r563404) +++ head/net/samba413/Makefile Sat Jan 30 13:22:39 2021 (r563405) @@ -3,7 +3,7 @@ PORTNAME= ${SAMBA4_BASENAME}413 PORTVERSION= ${SAMBA4_VERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES?= net MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc DISTNAME= ${SAMBA4_DISTNAME} Added: head/net/samba413/files/patch-source3_lib_messages.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/samba413/files/patch-source3_lib_messages.c Sat Jan 30 13:22:39 2021 (r563405) @@ -0,0 +1,29 @@ +--- source3/lib/messages.c.orig 2020-07-09 09:33:56 UTC ++++ source3/lib/messages.c +@@ -157,7 +157,7 @@ struct messaging_rec *messaging_rec_create( + + { + struct messaging_rec rec; +- int64_t fds64[num_fds]; ++ int64_t fds64[MAX(1, num_fds)]; + size_t i; + + for (i=0; ievent_ctx) { + struct iovec iov; +- int fds[rec->num_fds]; ++ int fds[MAX(1, rec->num_fds)]; + int ret; + + /*