diff options
-rw-r--r-- | AK/SharedBuffer.cpp | 12 | ||||
-rw-r--r-- | AK/SharedBuffer.h | 1 | ||||
-rw-r--r-- | Kernel/API/Syscall.h | 1 | ||||
-rw-r--r-- | Kernel/Process.h | 1 | ||||
-rw-r--r-- | Kernel/SharedBuffer.cpp | 16 | ||||
-rw-r--r-- | Kernel/SharedBuffer.h | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/shbuf.cpp | 14 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator.cpp | 9 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator.h | 1 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/SharedBufferRegion.cpp | 5 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/SharedBufferRegion.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibC/serenity.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibC/serenity.h | 1 |
13 files changed, 0 insertions, 70 deletions
diff --git a/AK/SharedBuffer.cpp b/AK/SharedBuffer.cpp index 4705cf9882..873b3e4e33 100644 --- a/AK/SharedBuffer.cpp +++ b/AK/SharedBuffer.cpp @@ -98,18 +98,6 @@ bool SharedBuffer::share_with([[maybe_unused]] pid_t peer) return true; } -bool SharedBuffer::share_globally() -{ -#if defined(__serenity__) - int ret = shbuf_allow_all(shbuf_id()); - if (ret < 0) { - perror("shbuf_allow_all"); - return false; - } -#endif - return true; -} - RefPtr<SharedBuffer> SharedBuffer::create_from_shbuf_id(int shbuf_id) { #if defined(__serenity__) diff --git a/AK/SharedBuffer.h b/AK/SharedBuffer.h index b07c9d21b0..a9cb438c70 100644 --- a/AK/SharedBuffer.h +++ b/AK/SharedBuffer.h @@ -37,7 +37,6 @@ public: static RefPtr<SharedBuffer> create_from_shbuf_id(int); ~SharedBuffer(); - bool share_globally(); bool share_with(pid_t); int shbuf_id() const { return m_shbuf_id; } void seal(); diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 18e227c001..8eb23a56d9 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -156,7 +156,6 @@ namespace Kernel { S(dbgputch) \ S(dbgputstr) \ S(watch_file) \ - S(shbuf_allow_all) \ S(mprotect) \ S(realpath) \ S(get_process_name) \ diff --git a/Kernel/Process.h b/Kernel/Process.h index 3d8bfba55b..fc80ca2ac9 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -336,7 +336,6 @@ public: int sys$mknod(Userspace<const Syscall::SC_mknod_params*>); int sys$shbuf_create(int, void** buffer); int sys$shbuf_allow_pid(int, pid_t peer_pid); - int sys$shbuf_allow_all(int); void* sys$shbuf_get(int shbuf_id, Userspace<size_t*> size); int sys$shbuf_release(int shbuf_id); int sys$shbuf_seal(int shbuf_id); diff --git a/Kernel/SharedBuffer.cpp b/Kernel/SharedBuffer.cpp index 7ec25ea701..39bef11392 100644 --- a/Kernel/SharedBuffer.cpp +++ b/Kernel/SharedBuffer.cpp @@ -65,8 +65,6 @@ void SharedBuffer::sanity_check(const char* what) bool SharedBuffer::is_shared_with(ProcessID peer_pid) const { LOCKER(shared_buffers().lock(), Lock::Mode::Shared); - if (m_global) - return true; for (auto& ref : m_refs) { if (ref.pid == peer_pid) { return true; @@ -80,18 +78,6 @@ void* SharedBuffer::ref_for_process_and_get_address(Process& process) { LOCKER(shared_buffers().lock()); ASSERT(is_shared_with(process.pid())); - if (m_global) { - bool found = false; - for (auto& ref : m_refs) { - if (ref.pid == process.pid()) { - found = true; - break; - } - } - if (!found) - m_refs.append(Reference(process.pid())); - } - for (auto& ref : m_refs) { if (ref.pid == process.pid()) { if (!ref.region) { @@ -112,8 +98,6 @@ void* SharedBuffer::ref_for_process_and_get_address(Process& process) void SharedBuffer::share_with(ProcessID peer_pid) { LOCKER(shared_buffers().lock()); - if (m_global) - return; for (auto& ref : m_refs) { if (ref.pid == peer_pid) { // don't increment the reference count yet; let them shbuf_get it first. diff --git a/Kernel/SharedBuffer.h b/Kernel/SharedBuffer.h index 03cba038aa..f92f861fcd 100644 --- a/Kernel/SharedBuffer.h +++ b/Kernel/SharedBuffer.h @@ -65,7 +65,6 @@ public: bool is_shared_with(ProcessID peer_pid) const; void* ref_for_process_and_get_address(Process& process); void share_with(ProcessID peer_pid); - void share_globally() { m_global = true; } void deref_for_process(Process& process); bool disown(ProcessID pid); static void share_all_shared_buffers(Process& from_process, Process& with_process); @@ -86,7 +85,6 @@ public: private: int m_shbuf_id { -1 }; bool m_writable { true }; - bool m_global { false }; NonnullRefPtr<AnonymousVMObject> m_vmobject; Vector<Reference, 2> m_refs; unsigned m_total_refs { 0 }; diff --git a/Kernel/Syscalls/shbuf.cpp b/Kernel/Syscalls/shbuf.cpp index c49674a876..6077905486 100644 --- a/Kernel/Syscalls/shbuf.cpp +++ b/Kernel/Syscalls/shbuf.cpp @@ -96,20 +96,6 @@ int Process::sys$shbuf_allow_pid(int shbuf_id, pid_t peer_pid) return 0; } -int Process::sys$shbuf_allow_all(int shbuf_id) -{ - REQUIRE_PROMISE(shared_buffer); - LOCKER(shared_buffers().lock()); - auto it = shared_buffers().resource().find(shbuf_id); - if (it == shared_buffers().resource().end()) - return -EINVAL; - auto& shared_buffer = *(*it).value; - if (!shared_buffer.is_shared_with(m_pid)) - return -EPERM; - shared_buffer.share_globally(); - return 0; -} - int Process::sys$shbuf_release(int shbuf_id) { REQUIRE_PROMISE(shared_buffer); diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp index c43b47cd0b..fa86c26417 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp @@ -389,8 +389,6 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) return virt$shbuf_create(arg1, arg2); case SC_shbuf_allow_pid: return virt$shbuf_allow_pid(arg1, arg2); - case SC_shbuf_allow_all: - return virt$shbuf_allow_all(arg1); case SC_shbuf_get: return virt$shbuf_get(arg1, arg2); case SC_shbuf_release: @@ -597,13 +595,6 @@ int Emulator::virt$shbuf_allow_pid(int shbuf_id, pid_t peer_pid) return region->allow_pid(peer_pid); } -int Emulator::virt$shbuf_allow_all(int shbuf_id) -{ - auto* region = m_mmu.shbuf_region(shbuf_id); - ASSERT(region); - return region->allow_all(); -} - int Emulator::virt$shbuf_release(int shbuf_id) { auto* region = m_mmu.shbuf_region(shbuf_id); diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.h b/Userland/DevTools/UserspaceEmulator/Emulator.h index 238276df14..db3dd39cd1 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.h +++ b/Userland/DevTools/UserspaceEmulator/Emulator.h @@ -93,7 +93,6 @@ private: int virt$gethostname(FlatPtr, ssize_t); int virt$shbuf_create(int size, FlatPtr buffer); int virt$shbuf_allow_pid(int, pid_t peer_pid); - int virt$shbuf_allow_all(int); FlatPtr virt$shbuf_get(int shbuf_id, FlatPtr size); int virt$shbuf_release(int shbuf_id); int virt$shbuf_seal(int shbuf_id); diff --git a/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.cpp b/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.cpp index ae4942dc7c..a4c58e862a 100644 --- a/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.cpp +++ b/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.cpp @@ -104,11 +104,6 @@ void SharedBufferRegion::write64(u32 offset, ValueWithShadow<u64> value) *reinterpret_cast<u64*>(m_shadow_data + offset) = value.shadow(); } -int SharedBufferRegion::allow_all() -{ - return syscall(SC_shbuf_allow_all, m_shbuf_id); -} - int SharedBufferRegion::allow_pid(pid_t pid) { return syscall(SC_shbuf_allow_pid, m_shbuf_id, pid); diff --git a/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.h b/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.h index a099b16ebc..c3e0df87f9 100644 --- a/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.h +++ b/Userland/DevTools/UserspaceEmulator/SharedBufferRegion.h @@ -51,7 +51,6 @@ public: int shbuf_id() const { return m_shbuf_id; } - int allow_all(); int allow_pid(pid_t); int seal(); int release(); diff --git a/Userland/Libraries/LibC/serenity.cpp b/Userland/Libraries/LibC/serenity.cpp index df5d5bfacc..730f37932a 100644 --- a/Userland/Libraries/LibC/serenity.cpp +++ b/Userland/Libraries/LibC/serenity.cpp @@ -113,12 +113,6 @@ int shbuf_allow_pid(int shbuf_id, pid_t peer_pid) __RETURN_WITH_ERRNO(rc, rc, -1); } -int shbuf_allow_all(int shbuf_id) -{ - int rc = syscall(SC_shbuf_allow_all, shbuf_id); - __RETURN_WITH_ERRNO(rc, rc, -1); -} - int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size) { int rc = syscall(SC_get_stack_bounds, user_stack_base, user_stack_size); diff --git a/Userland/Libraries/LibC/serenity.h b/Userland/Libraries/LibC/serenity.h index 5ad28a5723..f1abc160bd 100644 --- a/Userland/Libraries/LibC/serenity.h +++ b/Userland/Libraries/LibC/serenity.h @@ -35,7 +35,6 @@ int disown(pid_t); int shbuf_create(int, void** buffer); int shbuf_allow_pid(int, pid_t peer_pid); -int shbuf_allow_all(int); void* shbuf_get(int shbuf_id, size_t* size); int shbuf_release(int shbuf_id); int shbuf_seal(int shbuf_id); |