提交 4a19fb11 编写于 作者: S Stefan Bader 提交者: Dave Kleikamp

jfs: Fix early release of acl in jfs_get_acl

BugLink: http://bugs.launchpad.net/ubuntu/+bug/396780

Commit 073aaa1b "helpers for acl
caching + switch to those" introduced new helper functions for
acl handling but seems to have introduced a regression for jfs as
the acl is released before returning it to the caller, instead of
leaving this for the caller to do.
This causes the acl object to be used after freeing it, leading
to kernel panics in completely different places.

Thanks to Christophe Dumez for reporting and bisecting into this.
Reported-by: NChristophe Dumez <dchris@gmail.com>
Tested-by: NChristophe Dumez <dchris@gmail.com>
Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
Acked-by: NAndy Whitcroft <apw@canonical.com>
Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
上级 4be3bd78
......@@ -67,10 +67,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
acl = posix_acl_from_xattr(value, size);
}
kfree(value);
if (!IS_ERR(acl)) {
if (!IS_ERR(acl))
set_cached_acl(inode, type, acl);
posix_acl_release(acl);
}
return acl;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册