Skip to content

Commit 77bb438

Browse files
committed
Update contrib/libs/lzma to 5.6.3
commit_hash:625353c0ed27ce033147a8f5121982b83e126bdc
1 parent d3b5041 commit 77bb438

File tree

14 files changed

+192
-38
lines changed

14 files changed

+192
-38
lines changed

contrib/libs/lzma/.yandex_meta/override.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
pkgs: attrs: with pkgs; with attrs; rec {
2-
version = "5.6.2";
2+
version = "5.6.3";
33

44
src = fetchFromGitHub {
55
owner = "tukaani-project";
66
repo = "xz";
77
rev = "v${version}";
8-
hash = "sha256-NB6EHOSAL4eMyhgSJqyJ10H9HgTUv5NFJpEQTEzUofo=";
8+
hash = "sha256-2bxTxgDGlA0zPlfFs69bkuBGL44Se1ktSZCJ1Pt75I0=";
99
};
1010

1111
nativeBuildInputs = [ autoreconfHook ];

contrib/libs/lzma/INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ XZ Utils Installation
789789

790790
The configure script determines if assembler code can be used by
791791
looking at the configure triplet; there is currently no check if
792-
the assembler code can actually actually be built. The x86 assembler
792+
the assembler code can actually be built. The x86 assembler
793793
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
794794
Cygwin, and DJGPP. On other x86 systems, there may be problems and
795795
the assembler code may need to be disabled with the configure option.

contrib/libs/lzma/NEWS

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,131 @@
22
XZ Utils Release Notes
33
======================
44

5+
5.6.3 (2024-10-01)
6+
7+
IMPORTANT: This includes a Windows-specific security fix to
8+
the command line tools. liblzma isn't affected by this issue.
9+
10+
* liblzma:
11+
12+
- Fix x86-64 inline assembly compatibility with GNU Binutils
13+
older than 2.27.
14+
15+
- Fix the build with GCC 4.2 on OpenBSD/sparc64.
16+
17+
* xzdec: Display an error instead of failing silently if the
18+
unsupported option -M is specified.
19+
20+
* lzmainfo: Fix integer overflows when rounding the dictionary and
21+
uncompressed sizes to the nearest mebibyte.
22+
23+
* Windows (except Cygwin and MSYS2): Add an application manifest to
24+
xz, xzdec, lzmadec, and lzmainfo executables:
25+
26+
- Declare them compatible with Vista/7/8/8.1/10/11. This way
27+
the programs won't needlessly use Operating System Context
28+
of Vista when running on later Windows versions. This setting
29+
doesn't mean that the executables cannot run on even older
30+
versions if otherwise built that way.
31+
32+
- Declare them as UAC-compliant. MSVC added this by default
33+
already but it wasn't done with MinGW-w64, at least not
34+
with all toolchain variants.
35+
36+
- Declare them long path aware. This makes long path names
37+
work on Windows 10 and 11 if the feature has been enabled
38+
in the Windows registry.
39+
40+
- Use the UTF-8 code page on Windows 10 version 1903 and later.
41+
42+
* Now command line tools can access files whose names
43+
contain characters that don't exist in the current
44+
legacy code page.
45+
46+
* The options --files and --files0 now expect file lists
47+
to be in UTF-8 instead of the legacy code page.
48+
49+
* This fixes a security issue: If a command line contains
50+
Unicode characters (for example, filenames) that don't
51+
exist in the current legacy code page, the characters are
52+
converted to similar-looking characters with best-fit
53+
mapping. Some best-fit mappings result in ASCII
54+
characters that change the meaning of the command line,
55+
which can be exploited with malicious filenames to do
56+
argument injection or directory traversal attacks.
57+
UTF-8 avoids best-fit mappings and thus fixes the issue.
58+
59+
Forcing the process code page to UTF-8 is possible only
60+
on Windows 10 version 1903 and later. The command line
61+
tools remain vulnerable if used on an old older
62+
version of Windows.
63+
64+
This issue was discovered by Orange Tsai and splitline
65+
from DEVCORE Research Team.
66+
67+
A related smaller issue remains: Windows filenames may
68+
contain unpaired surrogates (invalid UTF-16). These are
69+
converted to the replacement character U+FFFD in the
70+
UTF-8 code page. Thus, filenames with different unpaired
71+
surrogates appear identical and aren't distinguishable
72+
from filenames that contain the actual replacement
73+
character U+FFFD.
74+
75+
* When building with MinGW-w64, it is recommended to use
76+
UCRT version instead of the old MSVCRT. For example,
77+
non-ASCII characters from filenames won't print
78+
correctly in messages to console with MSVCRT with
79+
the UTF-8 code page (a cosmetic issue). liblzma-only
80+
builds are still fine with MSVCRT.
81+
82+
- Cygwin and MSYS2 process command line options differently and
83+
the above issues don't exist. There is no need to replace the
84+
default application manifest on Cygwin and MSYS2.
85+
86+
* Autotools-based build:
87+
88+
- Fix feature checks with link-time optimization (-flto).
89+
90+
- Solaris: Fix a compatibility issue in version.sh. It matters
91+
if one wants to regenerate configure by running autoconf.
92+
93+
* CMake:
94+
95+
- Use paths relative to ${prefix} in liblzma.pc when possible.
96+
This is done only with CMake >= 3.20.
97+
98+
- MSVC: Install liblzma.pc as it can be useful with MSVC too.
99+
100+
- Windows: Fix liblzma filename prefix, for example:
101+
102+
* Cygwin: The DLL was incorrectly named liblzma-5.dll.
103+
Now it is cyglzma-5.dll.
104+
105+
* MSVC: Rename import library from liblzma.lib to lzma.lib
106+
while keeping liblzma.dll name as is. This helps with
107+
"pkgconf --msvc-syntax --libs liblzma" because it mungles
108+
"-llzma" in liblzma.pc to "lzma.lib".
109+
110+
* MinGW-w64: No changes.
111+
112+
- Windows: Use the correct resource file for lzmadec.exe.
113+
Previously the resource file for xzdec.exe was used for both.
114+
Autotools-based build isn't affected.
115+
116+
- Prefer a C11 compiler over a C99 compiler but accept both.
117+
118+
- Link Threads::Threads against liblzma using PRIVATE so that
119+
-pthread and such flags won't unnecessarily get included in
120+
the usage requirements of shared liblzma. That is,
121+
target_link_libraries(foo PRIVATE liblzma::liblzma) no
122+
longer adds -pthread if using POSIX threads and linking
123+
against shared liblzma. The threading flags are still added
124+
if linking against static liblzma.
125+
126+
* Updated translations: Catalan, Chinese (simplified), and
127+
Brazilian Portuguese.
128+
129+
5130
5.6.2 (2024-05-29)
6131

7132
* Remove the backdoor (CVE-2024-3094).

contrib/libs/lzma/THANKS

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ has been important. :-) In alphabetical order:
3333
- Tomer Chachamu
3434
- Vitaly Chikunov
3535
- Antoine Cœur
36+
- Felix Collin
3637
- Gabi Davar
3738
- İhsan Doğan
3839
- Chris Donawa
@@ -69,9 +70,11 @@ has been important. :-) In alphabetical order:
6970
- Hans Jansen
7071
- Jouk Jansen
7172
- Jun I Jin
73+
- Christoph Junghans
7274
- Kiyoshi Kanazawa
7375
- Joona Kannisto
7476
- Per Øyvind Karlsen
77+
- Firas Khalil Khana
7578
- Iouri Kharon
7679
- Thomas Klausner
7780
- Richard Koch
@@ -92,6 +95,7 @@ has been important. :-) In alphabetical order:
9295
- Cary Lewis
9396
- Wim Lewis
9497
- Xin Li
98+
- Yifeng Li
9599
- Eric Lindblad
96100
- Lorenzo De Liso
97101
- H.J. Lu
@@ -107,9 +111,11 @@ has been important. :-) In alphabetical order:
107111
- Nathan Moinvaziri
108112
- Étienne Mollier
109113
- Conley Moorhous
114+
- Andrew Murray
110115
- Rafał Mużyło
111116
- Adrien Nader
112117
- Evan Nemerson
118+
- Alexander Neumann
113119
- Hongbo Ni
114120
- Jonathan Nieder
115121
- Andre Noll
@@ -118,11 +124,13 @@ has been important. :-) In alphabetical order:
118124
- Daniel Packard
119125
- Filip Palian
120126
- Peter Pallinger
127+
- Kai Pastor
121128
- Rui Paulo
122129
- Igor Pavlov
123130
- Diego Elio Pettenò
124131
- Elbert Pol
125132
- Mikko Pouru
133+
- Frank Prochnow
126134
- Rich Prohaska
127135
- Trần Ngọc Quân
128136
- Pavel Raiskup
@@ -138,9 +146,12 @@ has been important. :-) In alphabetical order:
138146
- Stephen Sachs
139147
- Jukka Salmi
140148
- Agostino Sarubbo
149+
- Vijay Sarvepalli
141150
- Alexandre Sauvé
142151
- Benno Schulenberg
143152
- Andreas Schwab
153+
- Eli Schwartz
154+
- Peter Seiderer
144155
- Bhargava Shastry
145156
- Dan Shechter
146157
- Stuart Shelton
@@ -149,14 +160,18 @@ has been important. :-) In alphabetical order:
149160
- Brad Smith
150161
- Bruce Stark
151162
- Pippijn van Steenhoven
163+
- Tobias Stoeckmann
152164
- Martin Storsjö
153165
- Jonathan Stott
154166
- Dan Stromberg
167+
- Douglas Thor
155168
- Vincent Torri
156169
- Alexey Tourbin
157170
- Paul Townsend
158171
- Mohammed Adnène Trojette
172+
- Orange Tsai
159173
- Taiki Tsunekawa
174+
- Mathieu Vachon
160175
- Maksym Vatsyk
161176
- Loganaden Velvindron
162177
- Patrick J. Volkerding
@@ -176,6 +191,10 @@ has been important. :-) In alphabetical order:
176191
- Ryan Young
177192
- Andreas Zieringer
178193

194+
Companies:
195+
- Google
196+
- Sandfly Security
197+
179198
Also thanks to all the people who have participated in the Tukaani project.
180199

181200
I have probably forgot to add some names to the above list. Sorry about

contrib/libs/lzma/common/tuklib_integer.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@
8686
#elif defined(HAVE_SYS_ENDIAN_H)
8787
// *BSDs and Darwin
8888
# include <sys/endian.h>
89-
# define byteswap16(num) bswap16(num)
90-
# define byteswap32(num) bswap32(num)
91-
# define byteswap64(num) bswap64(num)
89+
# ifdef __OpenBSD__
90+
# define byteswap16(num) swap16(num)
91+
# define byteswap32(num) swap32(num)
92+
# define byteswap64(num) swap64(num)
93+
# else
94+
# define byteswap16(num) bswap16(num)
95+
# define byteswap32(num) bswap32(num)
96+
# define byteswap64(num) bswap64(num)
97+
# endif
9298

9399
#elif defined(HAVE_SYS_BYTEORDER_H)
94100
// Solaris
@@ -237,7 +243,7 @@
237243
// from the memcpy() method than from simple byte-by-byte shift-or code
238244
// when reading a 32-bit integer:
239245
//
240-
// (1) It may be constructed on stack using using four 8-bit loads,
246+
// (1) It may be constructed on stack using four 8-bit loads,
241247
// four 8-bit stores to stack, and finally one 32-bit load from stack.
242248
//
243249
// (2) Especially with -Os, an actual memcpy() call may be emitted.

contrib/libs/lzma/liblzma/api/lzma/container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
306306
* number and zero or more flags. Usually flags aren't
307307
* used, so preset is simply a number [0, 9] which match
308308
* the options -0 ... -9 of the xz command line tool.
309-
* Additional flags can be be set using bitwise-or with
309+
* Additional flags can be set using bitwise-or with
310310
* the preset level number, e.g. 6 | LZMA_PRESET_EXTREME.
311311
* \param check Integrity check type to use. See check.h for available
312312
* checks. The xz command line tool defaults to

contrib/libs/lzma/liblzma/api/lzma/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define LZMA_VERSION_MINOR 6
2323

2424
/** \brief Patch version number of the liblzma release. */
25-
#define LZMA_VERSION_PATCH 2
25+
#define LZMA_VERSION_PATCH 3
2626

2727
/**
2828
* \brief Version stability marker

contrib/libs/lzma/liblzma/check/crc32_table.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ typedef void lzma_crc32_dummy;
3434
// Having the declaration here silences clang -Wmissing-variable-declarations.
3535
extern const uint32_t lzma_crc32_table[8][256];
3636

37-
# ifdef WORDS_BIGENDIAN
38-
# error #include "crc32_table_be.h"
39-
# else
40-
# include "crc32_table_le.h"
41-
# endif
37+
# ifdef WORDS_BIGENDIAN
38+
# error #include "crc32_table_be.h"
39+
# else
40+
# include "crc32_table_le.h"
41+
# endif
4242
#endif

contrib/libs/lzma/liblzma/check/crc_common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
// NOTE: Keep this and the next check in sync with the macro
7777
// NO_CRC32_TABLE in crc32_table.c
7878
#if defined(HAVE_ARM64_CRC32) && !defined(WORDS_BIGENDIAN)
79-
// Allow ARM64 CRC32 instruction without a runtime check if
80-
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
81-
// proper compiler options are used.
79+
// Allow ARM64 CRC32 instruction without a runtime check if
80+
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define
81+
// this if the proper compiler options are used.
8282
# if defined(__ARM_FEATURE_CRC32)
8383
# define CRC32_ARCH_OPTIMIZED 1
8484
# define CRC32_ARM64 1

contrib/libs/lzma/liblzma/check/crc_x86_clmul.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
266266

267267
__m128i v0, v1, v2;
268268

269-
crc_simd_body(buf, size, &v0, &v1, vfold16,
269+
crc_simd_body(buf, size, &v0, &v1, vfold16,
270270
_mm_cvtsi32_si128((int32_t)~crc));
271271

272272
v1 = _mm_xor_si128(
@@ -355,12 +355,12 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
355355
__m128i v0, v1, v2;
356356

357357
#if defined(__i386__) || defined(_M_IX86)
358-
crc_simd_body(buf, size, &v0, &v1, vfold16,
358+
crc_simd_body(buf, size, &v0, &v1, vfold16,
359359
_mm_set_epi64x(0, (int64_t)~crc));
360360
#else
361361
// GCC and Clang would produce good code with _mm_set_epi64x
362362
// but MSVC needs _mm_cvtsi64_si128 on x86-64.
363-
crc_simd_body(buf, size, &v0, &v1, vfold16,
363+
crc_simd_body(buf, size, &v0, &v1, vfold16,
364364
_mm_cvtsi64_si128((int64_t)~crc));
365365
#endif
366366

@@ -385,6 +385,9 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
385385
#endif // BUILDING_CRC64_CLMUL
386386

387387

388+
// Even though this is an inline function, compile it only when needed.
389+
// This way it won't appear in E2K builds at all.
390+
#if defined(CRC32_GENERIC) || defined(CRC64_GENERIC)
388391
// Inlining this function duplicates the function body in crc32_resolve() and
389392
// crc64_resolve(), but this is acceptable because this is a tiny function.
390393
static inline bool
@@ -420,9 +423,10 @@ is_arch_extension_supported(void)
420423
// - ICC's _may_i_use_cpu_feature: the other methods should work too.
421424
// - GCC >= 6 / Clang / ICX __builtin_cpu_supports("pclmul")
422425
//
423-
// CPUID decding is needed with MSVC anyway and older GCC. This keeps
426+
// CPUID decoding is needed with MSVC anyway and older GCC. This keeps
424427
// the feature checks in the build system simpler too. The nice thing
425428
// about __builtin_cpu_supports would be that it generates very short
426429
// code as is it only reads a variable set at startup but a few bytes
427430
// doesn't matter here.
428431
}
432+
#endif

0 commit comments

Comments
 (0)