From 3250c16cdccc64f7f8ac98c02e162edf83e05894 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi Date: Fri, 30 Dec 2022 22:10:23 +0200 Subject: [PATCH] Restrict package installation to 1 thread It is possible that a package contains the same file multiple times. This leads to possible corruption or installation failure when they are extracted on different threads. (easy to reproduce with DeS) --- rpcs3/Crypto/unpkg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index a8d45954ab..feaa0acbcb 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -968,7 +968,7 @@ bool package_reader::extract_data(atomic_t& sync) atomic_t entry_indexer = 0; atomic_t thread_indexer = 0; - m_bufs.resize(std::min(utils::get_thread_count(), entries.size())); + m_bufs.resize(std::min(1 /*utils::get_thread_count()*/, entries.size())); named_thread_group workers("PKG Installer "sv, std::max(m_bufs.size(), 1) - 1, [&]() {