From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796283097; b=5jfNRTZjf9bwohN3hvAaxUFilwXhKLvdWgAosrtgQ31wn4JGAUYbY0CpxjbO2Y4quFnU HiXe0ERJ8ii36oJDgjd/1dBK7lfBJeEnzVCN8ZK2z7wVIjQBnJBQ0qwwBLrgc8z9H/nu9 8NcDFmQyugghwnlAmgAup4KD79IiFirsjPbaorE83rVsktKCd6sj/4WpqAAIcfxOr+EIv KcGMrlvQs5/7Z5d7grct3I7QSJIk6vQ4Cdnbg/5OkdZkdCeNeTNcxVLp7L5d7SXZadADu e8hPZS40QIkchlBGNxYrg9TivYngNSo7ag8NFIoU8TEsxXAtC7uUf4me+7MOUK+TIXA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796283097; h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=vJws04rDcOICveBTvzyoXoAS0aW/iACmer8i1D5PE3s=; b=4A+UdITRj+EvaCuBFzSC2KVo8dtwPbaoh8jhlmaRZuSsb1rySTNHANKqvaAaqfNl5k9/ 4dLvT/KXdSV38kqPUGNaRLESKOvIebZDcoA6gbL0JHKFdjBP0Tn7IcAe3P19HuBNaaso4 L+m/vak8GHjm3QEah2ILduvcXXpTO4EGDoFRYtVdHXQ94f/XhETN7jUglJocFgbT6k4W1 f+xyPeNaW/DbvFcdo2jZ1Y0If74rzNWbbYAC7ldz7yhP3z0chYd1kReGMCJqTjqsg2xMn uMo9iPMkw23AbBgp35WN9AhIuiUBX3I69nAbK4JEzK2m+V9SpsuheK+AVeJ4WWWBPVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qoDfl1fP; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92568606A322 for ; Thu, 3 Dec 2026 07:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qoDfl1fP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C1251F00893; Thu, 3 Dec 2026 07:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796283097; bh=vJws04rDcOICveBTvzyoXoAS0aW/iACmer8i1D5PE3s=; h=From:Date:Subject:References:In-Reply-To:To; b=qoDfl1fPnQzVKFeyrAyGKLfjCdhUhGk8pKKLRi34lxDwsVJNJyHihK2IuiCDmRPFs o6b0LfXSy3yr/pPKr4DaTlD+S+NWxRsz1gB/DY8HVTTjBWEx5O3V8qGqnPa0ertS+4 jRRNKea7lu+KThD0khIrZJAy8Dk3CR6/8motri4E= From: Greg Kroah-Hartman Date: Thu, 03 Dec 2026 08:29:54 +0100 Subject: [PATCH 14/21] lib/zlib: update deflate to zlib 1.2.1.2 release X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261203-zlib-sync-v1-14-0d4ec56f1afb@linuxfoundation.org> References: <20261203-zlib-sync-v1-0-0d4ec56f1afb@linuxfoundation.org> In-Reply-To: <20261203-zlib-sync-v1-0-0d4ec56f1afb@linuxfoundation.org> To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman X-Mailer: b4 0.17-dev-73bef X-Developer-Signature: v=1; a=openpgp-sha256; l=3237; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4L3m5EBRFlBPtZFbB5ELItdZ4AlZYF8UQk2ZQ3+R+V0=; b=owGbwMvMwCRo6H6F97bub03G02pJDNmCUtlRfy4rxjEcD7p2ro3T36HKXzVyb3aO/oSLnBKv2 K5dUDncEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNR6WaYZ3Xh27TzKoudl6yf xJBypObJpL6MmwwLblZ82noxYN7ydU+n1OjqSCqEtO0XBwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Sync the kernel deflate code with the zlib 1.2.1.2 release. Only one change was "needed", other than the version string update: - Drop the data_type field from the deflate state and set the data type guess directly in z_stream.data_type. There was one 1.2.1.2 change that wasn't relevant to the kernel copy: - VMS vsnprintf/strerror handling. The kernel is now in sync with zlib commit 7a6955760ba9 ("zlib 1.2.1.2"). Signed-off-by: Greg Kroah-Hartman --- include/linux/zlib.h | 2 +- lib/zlib_deflate/deflate.c | 2 +- lib/zlib_deflate/deftree.c | 4 ++-- lib/zlib_deflate/defutil.h | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 2419cbc1e08f..2dbc3aec1f81 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h @@ -32,7 +32,7 @@ #include -/* zlib deflate based on ZLIB_VERSION "1.2.1.1" */ +/* zlib deflate based on ZLIB_VERSION "1.2.1.2" */ /* zlib inflate based on ZLIB_VERSION "1.2.3" */ /* diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c index cb221eab7aa6..d6d29f63b572 100644 --- a/lib/zlib_deflate/deflate.c +++ b/lib/zlib_deflate/deflate.c @@ -1,6 +1,6 @@ /* +++ deflate.c */ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/lib/zlib_deflate/deftree.c b/lib/zlib_deflate/deftree.c index 2eaf8264cc33..dbe0eda9a824 100644 --- a/lib/zlib_deflate/deftree.c +++ b/lib/zlib_deflate/deftree.c @@ -814,7 +814,7 @@ ulg zlib_tr_flush_block( if (s->level > 0) { /* Check if the file is ascii or binary */ - if (s->data_type == Z_UNKNOWN) set_data_type(s); + if (s->strm->data_type == Z_UNKNOWN) set_data_type(s); /* Construct the literal and distance trees */ build_tree(s, (tree_desc *)(&(s->l_desc))); @@ -1027,7 +1027,7 @@ static void set_data_type( while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII; } /* =========================================================================== diff --git a/lib/zlib_deflate/defutil.h b/lib/zlib_deflate/defutil.h index dec377b7d25c..b639235c4fa6 100644 --- a/lib/zlib_deflate/defutil.h +++ b/lib/zlib_deflate/defutil.h @@ -85,7 +85,6 @@ typedef struct deflate_state { Byte *pending_out; /* next pending byte to output to the stream */ int pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ -- 2.56.1