summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/InodeWatcher.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-19 16:39:52 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-19 16:39:52 +0200
commit2cb32f83569579720c927fc43a8bc413755bd946 (patch)
treee2cc3b266e3925b1c8b8e5f96e8755f483a5daab /Kernel/FileSystem/InodeWatcher.cpp
parent55dd13ccac56144cbf437584fed9b2d21be1665f (diff)
downloadserenity-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.cpp10
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() });
}
}