[PR #1728] [MERGED] semaphore: Use handles to properly handle semaphore double-delete. #2264

Closed
opened 2026-02-27 21:15:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1728
Author: @squidbus
Created: 12/10/2024
Status: Merged
Merged: 12/10/2024
Merged by: @raphaelthegreat

Base: mainHead: sema-handle


📝 Commits (1)

  • 6f63927 semaphore: Use handles to properly handle semaphore double-delete.

📊 Changes

1 file changed (+17 additions, -13 deletions)

View changed files

📝 src/core/libraries/kernel/threads/semaphore.cpp (+17 -13)

📄 Description

Switch to storing semaphores in a SlotVector and using handles instead of pointers, so that we can properly determine if a semaphore has been deleted or not and prevent double-deletes or use-after-frees.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1728 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 12/10/2024 **Status:** ✅ Merged **Merged:** 12/10/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `sema-handle` --- ### 📝 Commits (1) - [`6f63927`](https://github.com/shadps4-emu/shadPS4/commit/6f6392732f1a36d9c8b8a9061137db504aabbe27) semaphore: Use handles to properly handle semaphore double-delete. ### 📊 Changes **1 file changed** (+17 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/threads/semaphore.cpp` (+17 -13) </details> ### 📄 Description Switch to storing semaphores in a `SlotVector` and using handles instead of pointers, so that we can properly determine if a semaphore has been deleted or not and prevent double-deletes or use-after-frees. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2264
No description provided.