diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-19 16:39:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-19 16:39:52 +0200 |
commit | 2cb32f83569579720c927fc43a8bc413755bd946 (patch) | |
tree | e2cc3b266e3925b1c8b8e5f96e8755f483a5daab /Kernel/FileSystem/InodeWatcher.cpp | |
parent | 55dd13ccac56144cbf437584fed9b2d21be1665f (diff) | |
download | serenity-2cb32f83569579720c927fc43a8bc413755bd946.zip |
Kernel: Let InodeWatcher track child inode numbers instead of names
First of all, this fixes a dumb info leak where we'd write kernel heap
addresses (StringImpl*) into userspace memory when reading a watcher.
Instead of trying to pass names to userspace, we now simply pass the
child inode index. Nothing in userspace makes use of this yet anyway,
so it's not like we're breaking anything. We'll see how this evolves.
Diffstat (limited to 'Kernel/FileSystem/InodeWatcher.cpp')
-rw-r--r-- | Kernel/FileSystem/InodeWatcher.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/FileSystem/InodeWatcher.cpp b/Kernel/FileSystem/InodeWatcher.cpp index 50cb5db065..193095de4d 100644 --- a/Kernel/FileSystem/InodeWatcher.cpp +++ b/Kernel/FileSystem/InodeWatcher.cpp @@ -96,19 +96,19 @@ String InodeWatcher::absolute_path(const FileDescription&) const void InodeWatcher::notify_inode_event(Badge<Inode>, Event::Type event_type) { LOCKER(m_lock); - m_queue.enqueue({ event_type, {} }); + m_queue.enqueue({ event_type }); } -void InodeWatcher::notify_child_added(Badge<Inode>, const String& child_name) +void InodeWatcher::notify_child_added(Badge<Inode>, const InodeIdentifier& child_id) { LOCKER(m_lock); - m_queue.enqueue({ Event::Type::ChildAdded, child_name }); + m_queue.enqueue({ Event::Type::ChildAdded, child_id.index() }); } -void InodeWatcher::notify_child_removed(Badge<Inode>, const String& child_name) +void InodeWatcher::notify_child_removed(Badge<Inode>, const InodeIdentifier& child_id) { LOCKER(m_lock); - m_queue.enqueue({ Event::Type::ChildRemoved, child_name }); + m_queue.enqueue({ Event::Type::ChildRemoved, child_id.index() }); } } |