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=1796283049; b=JtoTPUN54G+YH6Gl6jiCoZUw9R2U1j23BhoOlZFMiO9welCaElha7HJn6LOGaca5LTVr 7sQr5LjVsS8WvsP60ZpN8vEQTDzjyfhztby/zq580JzrOduqSbFfqCT3N+PYucSZ3QJhp mOGhzaLum4KDqKQ1VNfqewQl4ciPMVhxGeg8D6IwL0BvXg/gkrp62E6SfQDVH3LQL8jDE rmNWloT5FTFsiinKH+p1xvalAODDgXxVNveffiPk4tmmzuAXCh0y7NGASJOT2D9oypy1j MSAUS4RUpQfT1b2qeTfdJCFA+5Q4giza5C+iFdsOkgoNWMZLfZ/4cIbVz8Sh1wrrDkg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796283049; 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=GnZTMRr8H7+uFCvk15gcA1gRIsyGGxp0YYjk3EIRmc8=; b=mUNxnTg7FWmCFHBZ9MUdf01UPbY4rTCBsoSS1/KCaQEHUy5xmjIyCtmZTC19MXbSJtZS ZSQt1KgU0uGjiCzYpllSANv+GjdZfOe9zlhPIX7iLoczcFl1san9gVr3C5GBmJ88glpvs CmQ4wm0Ka3W6EefxhN3NZq1xxKWIATBANBusDGjnhYxEhWYRtPMAJDaecHYBuYE1zFWE0 F8hg/WNHrKT3gnkhBxkyc/3qwkoh0XtrOj5IQEc3I13gBMwoFRu9ZNtGL7Or3VMCkUL/w DkfvbH9Gc3iGd0DQPPcNnuCoh2u4Kw3ripwmfNHUJGOg81fvcfh3/IaL3qH7olGFRoQ== 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="DAU/YC8J"; 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 C0D52606A322 for ; Thu, 3 Dec 2026 07:30:49 +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=DAU/YC8J Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0D6E1F00893; Thu, 3 Dec 2026 07:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796283049; bh=GnZTMRr8H7+uFCvk15gcA1gRIsyGGxp0YYjk3EIRmc8=; h=From:Date:Subject:References:In-Reply-To:To; b=DAU/YC8Jlsme4B0YSjFZtFYjk7DUzi9iV1GKbeU65XGXr2Xwr6hCXx8b9SJg/2Qja yolNniN4vybwycMyUpCKoqYlOBiaYgcdyIRobhLu+O+KRv3HJqaqus/rPiSrhtdhc+ HNn7Qsz89IiZ2iSIekEDqmKH5D/ewAMfjgt1xwPs= From: Greg Kroah-Hartman Date: Thu, 03 Dec 2026 08:29:48 +0100 Subject: [PATCH 08/21] lib/zlib: update deflate to zlib 1.2.0.5 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-8-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=2904; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wqlaTQCe3RLG4OsF3/hzJ3g9ltQZfiCprVB4qejxcEU=; b=owGbwMvMwCRo6H6F97bub03G02pJDNmCUlmsf8TPqR6/7F7445y5ZeaaPGanV872XFP/FX59b L1cpZ65I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaS+4xhQbvUUS7TZMbwvHad PY8Nrv822O1zkGF+ufHyDw+6o8rifO+Jfjnz5KqEYqYvAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Sync the kernel deflate code with the zlib 1.2.0.5 release. This involves: - reorder the INSERT_STRING() assignment so match_head is assigned from the chained store rather than relying on the evaluation order of s->prev[...] = match_head = s->head[...]: when str aliases the head slot's chain this reads more clearly and avoids a sequencing surprise on exotic compilers, which the kernel really doesn't need to worry about at all, our compilers are anything but exotic, fortunatly. - change the TOO_FAR guard from "< 32768" to "<= 32767" to avoid an overflowing constant comparison on 16-bit ints. - comment case fix in zutil.h There were some 1.2.0.5 changes that were not relevant to the kernel copy: - alloc_func/free_func cast changes. - OS_CODE table reshuffle. The kernel is now in sync with zlib commit 4b5a43a219d5 ("zlib 1.2.0.5"). Signed-off-by: Greg Kroah-Hartman --- include/linux/zlib.h | 2 +- include/linux/zutil.h | 2 +- lib/zlib_deflate/deflate.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/zlib.h b/include/linux/zlib.h index fd34fd3ee715..5e6b5ed3766e 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h @@ -32,7 +32,7 @@ #include -/* zlib deflate based on ZLIB_VERSION "1.2.0.4" */ +/* zlib deflate based on ZLIB_VERSION "1.2.0.5" */ /* zlib inflate based on ZLIB_VERSION "1.2.3" */ /* diff --git a/include/linux/zutil.h b/include/linux/zutil.h index 2197ac6cff70..4032cfc1e82b 100644 --- a/include/linux/zutil.h +++ b/include/linux/zutil.h @@ -36,7 +36,7 @@ typedef unsigned long ulg; /* target dependencies */ - /* Common defaults */ + /* common defaults */ #ifndef OS_CODE # define OS_CODE 0x03 /* assume Unix */ diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c index 7cc54a3551d7..cb221eab7aa6 100644 --- a/lib/zlib_deflate/deflate.c +++ b/lib/zlib_deflate/deflate.c @@ -171,7 +171,7 @@ static const config configuration_table[10] = { */ #define INSERT_STRING(s, str, match_head) \ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \ + match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ s->head[s->ins_h] = (Pos)(str)) /* =========================================================================== @@ -1173,7 +1173,7 @@ static block_state deflate_slow( /* longest_match() or longest_match_fast() sets match_start */ if (s->match_length <= 5 && (s->strategy == Z_FILTERED -#if TOO_FAR < 32768 +#if TOO_FAR <= 32767 || (s->match_length == MIN_MATCH && s->strstart - s->match_start > TOO_FAR) #endif -- 2.56.1