From nobody Mon Feb 14 19:47:41 2022 X-Original-To: dev-commits-src-branches@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 F020D19CAD43; Mon, 14 Feb 2022 19:47:41 +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 4JyFB56TC9z4ZM4; Mon, 14 Feb 2022 19:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644868061; 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=LnCDtiHm/KcbBIC1kQeyEt4DAFYlYJ5STr3cs+8p0Zc=; b=wB/a8g/AWfcmqlv1vOXc7dbFUE+y9F2UwdhsrZnfEozNJ9WprDZu7azsOeperkBtnEkKkK c5DalY7uxXdsO0zZBibDZWtl9WpiOdYu8h0QhTE1VQhDfUfcjdKqV4g8jO0XAeXSx5eJed EnK6ruYAAZdvHcFxF7gscS9pzdZ28Zc444tGUOPGyYe6g6CFaXp3P22TcIsaS3x667tUug ClRPsUvs8/AZomDq7nhIiXdWrX9WxjznocZG1w4XldSpFdMdTdE6+Vh+FM/tg9jf6pY3gp OaLFCQsOvpd9aD1jeC4YhS+99f580ObGUMjRR4C6EzwFA6VmsXMKdYIurOQj9A== 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 BA3FC14DA2; Mon, 14 Feb 2022 19:47:41 +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 21EJlfux035896; Mon, 14 Feb 2022 19:47:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21EJlf58035895; Mon, 14 Feb 2022 19:47:41 GMT (envelope-from git) Date: Mon, 14 Feb 2022 19:47:41 GMT Message-Id: <202202141947.21EJlf58035895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: 2053dee56a9f - stable/13 - Fix gzip compressed core dumps on big endian architectures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2053dee56a9f5b2ad9286def352c4e198f39dfb1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644868061; 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=LnCDtiHm/KcbBIC1kQeyEt4DAFYlYJ5STr3cs+8p0Zc=; b=G1cs/24Nx6OH5Ywl9/jr8QyzpmBtgp5/zuAlQDuNk4BEEKm3FuWVKJGbmWreh/JATuy7/H xrW4UTT1Ju6LxNfp3IyaqGAcFHopSWwOoGDLYzkAI6Hwkl1nukI0iCm9oBRbyz+oesgSd2 jXHSoyz1AvfHDP/d6ey1mm8zonYyqfWMlOCpQ4qEUzQ2RTpdHqyS0ntcbzt+K5iXJH65Ip iBFSXavXPpV0XDFcHxkRiRQYlge6f1MaZIft3RRdWCSRvlUr007B3SI1xue9vL0LxkKvov W65WaGmfTs51onFV5r/aftmYGO4qttpiQUkN7V1UwM5UKFlccA3BgeGtLnKOJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644868061; a=rsa-sha256; cv=none; b=GHZOY9+fCqY8ZPEz3g/vI5ovzphjF3F4M/JdAfbg0gkS6uBHPdGvL4qjypPnPN+iRj2o+V uGLRdNGJa6cH0aGhQ9uJ2RYutzJRqD1SIJE+60YU+Ihwwypetb1F2kKrIOfTMxcmBH+P8C TwV9jvYjKElsjJ8dEi/IOfZ9NgxSfl7QwLHDKKUh1t1aBnPn2JM09g7FLOZ7F2bqvEgYCk 5YVNLdVCX8QbMhvcg+nXqlftZoKv1p8KO4TCwi8OioAc9u9cKuzI0wFYiRCsLSdG6vuWmb tWt5oMOfTYw2AAbcI8S53JqiLBdV4wH6x+NUnC2BDK18mPCxKZHvLdpZPgaIvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=2053dee56a9f5b2ad9286def352c4e198f39dfb1 commit 2053dee56a9f5b2ad9286def352c4e198f39dfb1 Author: Justin Hibbits AuthorDate: 2022-02-10 15:21:36 +0000 Commit: Justin Hibbits CommitDate: 2022-02-14 19:30:52 +0000 Fix gzip compressed core dumps on big endian architectures The gzip trailer words (size and CRC) are both little-endian per the spec. MFC after: 3 days Sponsored by: Juniper Networks, Inc. (cherry picked from commit 6db44b0158c37f2206f2c4ea7f29f5b774389e54) --- sys/kern/subr_compressor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_compressor.c b/sys/kern/subr_compressor.c index b202d271cfa3..74526a949437 100644 --- a/sys/kern/subr_compressor.c +++ b/sys/kern/subr_compressor.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -201,9 +202,9 @@ gz_write(void *stream, void *data, size_t len, compressor_cb_t cb, * Try to pack as much of the trailer into the * output buffer as we can. */ - ((uint32_t *)trailer)[0] = s->gz_crc; + ((uint32_t *)trailer)[0] = htole32(s->gz_crc); ((uint32_t *)trailer)[1] = - s->gz_stream.total_in; + htole32(s->gz_stream.total_in); room = MIN(sizeof(trailer), s->gz_bufsz - len); memcpy(s->gz_buffer + len, trailer, room);