mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:35:06 +00:00
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.
This commit is contained in:
parent
55dd13ccac
commit
2cb32f8356
6 changed files with 19 additions and 18 deletions
|
@ -229,19 +229,19 @@ void Inode::set_metadata_dirty(bool metadata_dirty)
|
|||
}
|
||||
}
|
||||
|
||||
void Inode::did_add_child(const String& name)
|
||||
void Inode::did_add_child(const InodeIdentifier& child_id)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
for (auto& watcher : m_watchers) {
|
||||
watcher->notify_child_added({}, name);
|
||||
watcher->notify_child_added({}, child_id);
|
||||
}
|
||||
}
|
||||
|
||||
void Inode::did_remove_child(const String& name)
|
||||
void Inode::did_remove_child(const InodeIdentifier& child_id)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
for (auto& watcher : m_watchers) {
|
||||
watcher->notify_child_removed({}, name);
|
||||
watcher->notify_child_removed({}, child_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue