Shao Miller
2011-Aug-02 07:10 UTC
[syslinux] Missing Error Condition Check in core/fs/fs.c
In 'core/fs/fs.c', 'fs.root' is set, but the 'iget_root' function pointer call might return a null pointer and we don't check for it. A symptom was that QEmu crashed as EIP landed outside of memory. - Shao /* start out in the root directory */ if (fs.fs_ops->iget_root) { fs.root = fs.fs_ops->iget_root(&fs); /* Maybe we should check 'fs.root' here */ fs.cwd = get_inode(fs.root); }
H. Peter Anvin
2011-Aug-02 18:24 UTC
[syslinux] Missing Error Condition Check in core/fs/fs.c
On 08/02/2011 12:10 AM, Shao Miller wrote:> In 'core/fs/fs.c', 'fs.root' is set, but the 'iget_root' function > pointer call might return a null pointer and we don't check for it. A > symptom was that QEmu crashed as EIP landed outside of memory. - Shao > > > /* start out in the root directory */ > if (fs.fs_ops->iget_root) { > fs.root = fs.fs_ops->iget_root(&fs); > /* Maybe we should check 'fs.root' here */ > fs.cwd = get_inode(fs.root); > } >We're kind of dead if we can't get the root directory, no? I guess we should panic at that point... -hpa