From nobody Tue Mar 29 13:54:11 2022 X-Original-To: dev-commits-src-all@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 7B34C1A3F0DE; Tue, 29 Mar 2022 13:54:11 +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 4KSWJM31Zyz3HKc; Tue, 29 Mar 2022 13:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648562051; 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=sHXs8T4m+XaIVZZh+LlQBVx/idACRivDK0l71wXnfUo=; b=LV5SK0Si9fY1srhqDwHBCCoAYUMf3rDjiGP52VxtuEZ2B4wZE4z0IqBCBX8dhkjThfg990 qegUoGlc7oMZjNYEFlr1ItwBwSuYhryYLkSFBFXBp5UffGIyPEzN6JlelecPCZJz4U1q6e kKinQlSV1Y/kQPQAQiBglDp6LBCDEU8APmeoENhz8vEVVudHCSgD0VsWd2TIffnPbP7UNg ltug0iEZ89RJRNX9V4Hx5S/HGpPzxWGDbXjIFHQdujAywxSrxXdoeFZspN5QDJz5qagn7R HMrkl2Ydw1Yy08bWKURgd+FOZajn5+fi+j0urSnWq9/0Kq1jDTLYbVdQC3MH2g== 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 47B5A1FE81; Tue, 29 Mar 2022 13:54:11 +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 22TDsBr3008844; Tue, 29 Mar 2022 13:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22TDsBoX008843; Tue, 29 Mar 2022 13:54:11 GMT (envelope-from git) Date: Tue, 29 Mar 2022 13:54:11 GMT Message-Id: <202203291354.22TDsBoX008843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: c19caf8852f5 - releng/13.1 - libarchive: merge vendor bugfixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: c19caf8852f5deecb050ee35b042a1a9b659fc49 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648562051; 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=sHXs8T4m+XaIVZZh+LlQBVx/idACRivDK0l71wXnfUo=; b=r8/sCw+GxcJy8seBKCsBnWVHyaEzZ9iS0Nj6IAcYfRD/Q+OQrTtHGKJGGN60wTAXY4zdUO pwCoby67rFMmZeqTpZXgkKLJKxAc5I+0mefe6MlauDAWq12yKLzcXbmLmDDywZQk1Ndw7K tOse3LmVvvrcHs/SgXv1OQOaNUtTGcUGCDJiN6W56za4Tkng7qwyop38JtfieI3sA+VDgB /tyeQdaKh7isoCCCf/s36EnSbdYPmezdqeH4OFYm71E9/o+DHCKhlP31hJolh5FtYovZb7 br1DP3HEe0eP07CE2xa4Dou0vdcRc38BKsR5bNoyRTXtVORylI5fYjxaiPiQEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648562051; a=rsa-sha256; cv=none; b=r2DVvRqlwRFL/aFs+cMFxrYrgVTY2Tw3kan3v1Og6hQrGZKwUX7iN0QHxPdgERB4XSokFp LP4wlTtSrlp2QlOvR7xu4e60xCu7ENGvle6Tkwkl0f9f5eXlhP8LfHzCl4y1pPKl9ywi4n 7gtLxLYHMRmvCq+lG6BvyQoG2ipxekYFm6Nxa+wjrviKCHvPzteCiZe5aF037vg0gDCiKz t43zkk4FExuKNhNf1/UFBRcso2NPwobkmGTln1o4r1H4hXWUgiYE7eK4Y8B2WA9yw5XXjG siwxLGLlo5IDAMufLhJwl1F/FKIBUen4Oi/h9rPI3eR7TBd+y4C/lvJIlC+khA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c19caf8852f5deecb050ee35b042a1a9b659fc49 commit c19caf8852f5deecb050ee35b042a1a9b659fc49 Author: Martin Matuska AuthorDate: 2022-03-26 10:04:36 +0000 Commit: Martin Matuska CommitDate: 2022-03-29 13:53:15 +0000 libarchive: merge vendor bugfixes Bugfixes: IS #1672 and OSS-Fuzz #38766: (zip reader) fix possible out-of-bounds read in zipx_lzma_alone_init() PR #1676: (mtree reader) remove the unused variable "detected_bytes" PR #1674: (doc) fix use of At mdoc(7) macro in cpio.5 Approved by: re (gjb) (cherry picked from commit 0c9c2eb394b4a5694bc5ea11b326f334c735c813) (cherry picked from commit 60338b80693000ed0f9812b90ca54d35fd077cd0) --- contrib/libarchive/libarchive/archive_read_disk_posix.c | 7 ++++++- contrib/libarchive/libarchive/archive_read_support_format_mtree.c | 5 +---- contrib/libarchive/libarchive/archive_read_support_format_zip.c | 2 +- contrib/libarchive/libarchive/cpio.5 | 2 +- lib/libarchive/config_freebsd.h | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_read_disk_posix.c b/contrib/libarchive/libarchive/archive_read_disk_posix.c index d0e1f35c8291..2b39e672b49c 100644 --- a/contrib/libarchive/libarchive/archive_read_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_read_disk_posix.c @@ -109,6 +109,11 @@ __FBSDID("$FreeBSD$"); #define O_CLOEXEC 0 #endif +#if defined(__hpux) && !defined(HAVE_DIRFD) +#define dirfd(x) ((x)->__dd_fd) +#define HAVE_DIRFD +#endif + /*- * This is a new directory-walking system that addresses a number * of problems I've had with fts(3). In particular, it has no @@ -2428,7 +2433,7 @@ tree_dir_next_posix(struct tree *t) #else /* HAVE_FDOPENDIR */ if (tree_enter_working_dir(t) == 0) { t->d = opendir("."); -#if HAVE_DIRFD || defined(dirfd) +#ifdef HAVE_DIRFD __archive_ensure_cloexec_flag(dirfd(t->d)); #endif } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c index bfcec220285d..96eb133ed361 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c @@ -692,7 +692,7 @@ detect_form(struct archive_read *a, int *is_form_d) { const char *p; ssize_t avail, ravail; - ssize_t detected_bytes = 0, len, nl; + ssize_t len, nl; int entry_cnt = 0, multiline = 0; int form_D = 0;/* The archive is generated by `NetBSD mtree -D' * (In this source we call it `form D') . */ @@ -728,8 +728,6 @@ detect_form(struct archive_read *a, int *is_form_d) * character of previous line was '\' character. */ if (bid_keyword_list(p, len, 0, 0) <= 0) break; - if (multiline == 1) - detected_bytes += len; if (p[len-nl-1] != '\\') { if (multiline == 1 && ++entry_cnt >= MAX_BID_ENTRY) @@ -745,7 +743,6 @@ detect_form(struct archive_read *a, int *is_form_d) keywords = bid_entry(p, len, nl, &last_is_path); if (keywords >= 0) { - detected_bytes += len; if (form_D == 0) { if (last_is_path) form_D = 1; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_zip.c b/contrib/libarchive/libarchive/archive_read_support_format_zip.c index 3456c100c6f5..75df44ba93aa 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_zip.c @@ -1667,7 +1667,7 @@ zipx_lzma_alone_init(struct archive_read *a, struct zip *zip) */ /* Read magic1,magic2,lzma_params from the ZIPX stream. */ - if((p = __archive_read_ahead(a, 9, NULL)) == NULL) { + if(zip->entry_bytes_remaining < 9 || (p = __archive_read_ahead(a, 9, NULL)) == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated lzma data"); return (ARCHIVE_FATAL); diff --git a/contrib/libarchive/libarchive/cpio.5 b/contrib/libarchive/libarchive/cpio.5 index 837a45692e3b..c71018b1996e 100644 --- a/contrib/libarchive/libarchive/cpio.5 +++ b/contrib/libarchive/libarchive/cpio.5 @@ -354,7 +354,7 @@ while working in AT&T's Unix Support Group. It appeared in 1977 as part of PWB/UNIX 1.0, the .Dq Programmer's Work Bench derived from -.At 6th Edition UNIX +.At v6 that was used internally at AT&T. Both the new binary and old character formats were in use by 1980, according to the System III source released diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index 0e8ac64eba47..20230ca26adf 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -98,6 +98,7 @@ #define HAVE_DECL_UINT64_MAX 1 #define HAVE_DECL_UINTMAX_MAX 1 #define HAVE_DIRENT_H 1 +#define HAVE_DIRFD 1 #define HAVE_DLFCN_H 1 #define HAVE_D_MD_ORDER 1 #define HAVE_EFTYPE 1