summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/InodeWatcher.h
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.h
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.h')
-rw-r--r--Kernel/FileSystem/InodeWatcher.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/FileSystem/InodeWatcher.h b/Kernel/FileSystem/InodeWatcher.h
index cd371e2f1a..3396159064 100644
--- a/Kernel/FileSystem/InodeWatcher.h
+++ b/Kernel/FileSystem/InodeWatcher.h
@@ -50,7 +50,7 @@ public:
};
Type type { Type::Invalid };
- String string;
+ unsigned inode_index { 0 };
};
virtual bool can_read(const FileDescription&, size_t) const override;
@@ -61,8 +61,8 @@ public:
virtual const char* class_name() const override { return "InodeWatcher"; };
void notify_inode_event(Badge<Inode>, Event::Type);
- void notify_child_added(Badge<Inode>, const String& child_name);
- void notify_child_removed(Badge<Inode>, const String& child_name);
+ void notify_child_added(Badge<Inode>, const InodeIdentifier& child_id);
+ void notify_child_removed(Badge<Inode>, const InodeIdentifier& child_id);
private:
explicit InodeWatcher(Inode&);