From nobody Sun Feb 11 04:23:53 2024 X-Original-To: dev-commits-ports-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 4TXZGf1tRcz59MTn; Sun, 11 Feb 2024 04:23:54 +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 4TXZGf17Dqz4RnW; Sun, 11 Feb 2024 04:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707625434; 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=movk96kNrjM5wXKMF9I6s2NHQFi0b6OqZc+tA2ZJPgI=; b=mrjFuEheGmd40o+RBHKjWLTNrsBbpeKMKdx6kLUpHtDvRw/QYxQ+TT7B/AQR428TOl1GK6 qDFgtu0aUTL3iqD7Eh6djqtsViJLS8x2scuJvNJj1Fk9vRcRbivfHfFEY1HQj+5EQhGXuH SPH7PsboWEIG+xvuFxXwcTvWcGJQBC+0EYbww6YKYFy0USHKSvPVlVADrSgx84UvBNMa05 pY/fnbJlClxnfef9TfKQzPOmqX1jYTIZbLrD7Xz4eq+Q3My6XdTI+aEOrbSX6uvkLtz0sU g7c2X4lWijLx9mELWgw/ge5LUOqQfEtlwjSBgbxuUXTG6bszBoJW0sHuifcZiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707625434; a=rsa-sha256; cv=none; b=PY32f+DOufh4Cd0iEEy+X6dFAUzUDZd2Prvbo/kziLdQplihfUeyhwnuj+XhGndHEK8TMh 7ZcVr88oWuL52nEx12nJSyw1czXWxkyq2TF6BYpS9ktfwJtsUoC/ejGqm68F7CAtTff7Ko S2F/tpB/78ZrX97VTzT0B3gsrmimaq6mEwNaZuU1fN0x0JbUPqaF1yks+iki0cQniEPTcr Qzu2rEcuhilftKEjhbCy4/kU4pC15MB2RQNdykxQut2sM2tFyYlkaKZdyga/jur9IIhuab sx3fXxsg8oy9ju8N8M+thmKrEkXpPOX7A50hl+7AFXdKFATJNgXXtXb19Wa4Lw== 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=1707625434; 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=movk96kNrjM5wXKMF9I6s2NHQFi0b6OqZc+tA2ZJPgI=; b=dX0w//5tTDXUFBujK8fg/4+NSGYQvL4iT+hW/LJK/seJh8QXA78O399TnohRFI45aZA5qm 3rCt/EY70A6Wqu6tzqeV2ERVhnA1zUwam+NmvWhmRgMwiza1yPa/sBvbAN++VY/UE8wfxF RL6Bmx8qq3F1qkTYn6Ma8XoBY9l1RtULHm+DVGRPqxcpcPvpKRFDVBfalXdKiGgwRQW+oe ptySUuy7O44a1s/wy947XadjVKRAFnX/69Uel0LtM8VL4U53aVWy/kKQWbMzBBPhRyZCWn 8kAsa3z0cBvtjmrPAD7v1cz5CP3IOxaXtNMRyaYf70C+CpMRniWh8CjmJjG84w== 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 4TXZGf0CpWzkrZ; Sun, 11 Feb 2024 04:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41B4Nrgd044239; Sun, 11 Feb 2024 04:23:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41B4NrPa044236; Sun, 11 Feb 2024 04:23:53 GMT (envelope-from git) Date: Sun, 11 Feb 2024 04:23:53 GMT Message-Id: <202402110423.41B4NrPa044236@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Joseph Mingrone Subject: git: 3fb51f85c5f3 - main - net/samba416: Patch to prevent abnormal smbd abort List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fb51f85c5f397a427eca02936c935cba048a06e Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/ports/commit/?id=3fb51f85c5f397a427eca02936c935cba048a06e commit 3fb51f85c5f397a427eca02936c935cba048a06e Author: Joseph Mingrone AuthorDate: 2023-12-24 14:41:30 +0000 Commit: Joseph Mingrone CommitDate: 2024-02-11 04:20:00 +0000 net/samba416: Patch to prevent abnormal smbd abort Update a call to memcpy() because readdir() only guarantees memory up to result+result->d_reclen is readable. Under certain conditions, result+sizeof(struct dirent) landed in unmapped memory. Most of the legwork to pinpoint the problem, as well as a solution similar to the one applied here, was submitted by uratan@miomio.jp. Martin Simmons contributed to understanding the problem and wrote a useful test case. PR: 275597 Approved by: maintainer timeout Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43171 --- net/samba416/Makefile | 2 +- net/samba416/files/patch-source3_modules_vfs__cap.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/net/samba416/Makefile b/net/samba416/Makefile index 79b06f99eeb1..65536326cbdb 100644 --- a/net/samba416/Makefile +++ b/net/samba416/Makefile @@ -1,6 +1,6 @@ PORTNAME= ${SAMBA4_BASENAME}416 PORTVERSION= ${SAMBA4_VERSION} -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES?= net MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc DISTNAME= ${SAMBA4_DISTNAME} diff --git a/net/samba416/files/patch-source3_modules_vfs__cap.c b/net/samba416/files/patch-source3_modules_vfs__cap.c new file mode 100644 index 000000000000..8e40492bf70d --- /dev/null +++ b/net/samba416/files/patch-source3_modules_vfs__cap.c @@ -0,0 +1,14 @@ +--- source3/modules/vfs_cap.c.orig 2022-01-24 10:26:59 UTC ++++ source3/modules/vfs_cap.c +@@ -112,7 +112,10 @@ static struct dirent *cap_readdir(vfs_handle_struct *h + return NULL; + } + talloc_set_name_const(newdirent, "struct dirent"); +- memcpy(newdirent, result, sizeof(struct dirent)); ++ /* See FreeBSD bug #275597 for an explanation of this patch. */ ++ /* memcpy(newdirent, result, sizeof(struct dirent)); */ ++ memcpy(newdirent, result, result->d_reclen); ++ /*******************************************************************/ + memcpy(&newdirent->d_name, newname, newnamelen); + return newdirent; + }