mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
Fix deadlock in synthfs read implementation.
Not cool disabling interrupts and then calling out to arbitrary code.
This commit is contained in:
parent
3b2dcd5929
commit
abdf24cb73
1 changed files with 9 additions and 6 deletions
|
@ -194,8 +194,6 @@ bool SyntheticFileSystem::writeInode(InodeIdentifier, const ByteBuffer&)
|
||||||
|
|
||||||
Unix::ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer, FileDescriptor* handle) const
|
Unix::ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer, FileDescriptor* handle) const
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
|
||||||
|
|
||||||
ASSERT(inode.fileSystemID() == id());
|
ASSERT(inode.fileSystemID() == id());
|
||||||
#ifdef SYNTHFS_DEBUG
|
#ifdef SYNTHFS_DEBUG
|
||||||
kprintf("synthfs: readInode %u\n", inode.index());
|
kprintf("synthfs: readInode %u\n", inode.index());
|
||||||
|
@ -203,10 +201,15 @@ Unix::ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::o
|
||||||
ASSERT(offset >= 0);
|
ASSERT(offset >= 0);
|
||||||
ASSERT(buffer);
|
ASSERT(buffer);
|
||||||
|
|
||||||
auto it = m_inodes.find(inode.index());
|
const File* found_file;
|
||||||
if (it == m_inodes.end())
|
{
|
||||||
return false;
|
InterruptDisabler disabler;
|
||||||
const File& file = *(*it).value;
|
auto it = m_inodes.find(inode.index());
|
||||||
|
if (it == m_inodes.end())
|
||||||
|
return false;
|
||||||
|
found_file = (*it).value.ptr();
|
||||||
|
}
|
||||||
|
const File& file = *found_file;
|
||||||
ByteBuffer generatedData;
|
ByteBuffer generatedData;
|
||||||
if (file.generator) {
|
if (file.generator) {
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue