forked from Imagelibrary/rtems
jffs2: fix use-after-free on symlink traversal
free the symlink body after the same RCU delay we have for freeing the struct inode itself, so that traversal during RCU pathwalk wouldn't step into freed memory. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1434,11 +1434,12 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
|
||||
}
|
||||
|
||||
jffs2_kill_fragtree(&f->fragtree, deleted?c:NULL);
|
||||
|
||||
#ifdef __rtems__
|
||||
if (f->target) {
|
||||
kfree(f->target);
|
||||
f->target = NULL;
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
|
||||
fds = f->dents;
|
||||
while(fds) {
|
||||
|
||||
Reference in New Issue
Block a user