Skip to content

Commit

Permalink
Restrict package installation to 1 thread
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
elad335 authored Dec 30, 2022
1 parent 02f3538 commit 3250c16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpcs3/Crypto/unpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ bool package_reader::extract_data(atomic_t<double>& sync)
atomic_t<usz> entry_indexer = 0;
atomic_t<usz> thread_indexer = 0;

m_bufs.resize(std::min<usz>(utils::get_thread_count(), entries.size()));
m_bufs.resize(std::min<usz>(1 /*utils::get_thread_count()*/, entries.size()));

named_thread_group workers("PKG Installer "sv, std::max<usz>(m_bufs.size(), 1) - 1, [&]()
{
Expand Down

0 comments on commit 3250c16

Please sign in to comment.