mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
Kernel: De-atomicize fields for promises in Process
These 4 fields were made `Atomic` inc3f668a758
, at which time these were still accessed unserialized and TOCTOU bugs could happen. Later, in8ed06ad814
, we serialized access to these fields in a number of helper methods, removing the need for `Atomic`.
This commit is contained in:
parent
7f855ad6b3
commit
81a6976e90
3 changed files with 11 additions and 11 deletions
|
@ -120,10 +120,10 @@ class Process final
|
|||
RefPtr<TTY> tty;
|
||||
bool dumpable { false };
|
||||
bool executable_is_setid { false };
|
||||
Atomic<bool> has_promises { false };
|
||||
Atomic<u32> promises { 0 };
|
||||
Atomic<bool> has_execpromises { false };
|
||||
Atomic<u32> execpromises { 0 };
|
||||
bool has_promises { false };
|
||||
u32 promises { 0 };
|
||||
bool has_execpromises { false };
|
||||
u32 execpromises { 0 };
|
||||
mode_t umask { 022 };
|
||||
VirtualAddress signal_trampoline;
|
||||
Atomic<u32> thread_count { 0 };
|
||||
|
@ -520,7 +520,7 @@ public:
|
|||
|
||||
bool has_promises() const
|
||||
{
|
||||
return with_protected_data([](auto& protected_data) { return protected_data.has_promises.load(); });
|
||||
return with_protected_data([](auto& protected_data) { return protected_data.has_promises; });
|
||||
}
|
||||
bool has_promised(Pledge pledge) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue