1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Kernel: De-atomicize fields for promises in Process

These 4 fields were made `Atomic` in
c3f668a758, at which time these were still
accessed unserialized and TOCTOU bugs could happen. Later, in
8ed06ad814, we serialized access to these
fields in a number of helper methods, removing the need for `Atomic`.
This commit is contained in:
Jelle Raaijmakers 2023-06-08 09:22:48 +02:00 committed by Andreas Kling
parent 7f855ad6b3
commit 81a6976e90
3 changed files with 11 additions and 11 deletions

View file

@ -712,8 +712,8 @@ ErrorOr<void> Process::do_exec(NonnullRefPtr<OpenFileDescription> main_program_d
// NOTE: Be careful to not trigger any page faults below!
with_mutable_protected_data([&](auto& protected_data) {
protected_data.promises = protected_data.execpromises.load();
protected_data.has_promises = protected_data.has_execpromises.load();
protected_data.promises = protected_data.execpromises;
protected_data.has_promises = protected_data.has_execpromises;
protected_data.execpromises = 0;
protected_data.has_execpromises = false;