Skip to content

Commit

Permalink
jfs: Fix early release of acl in jfs_get_acl
Browse files Browse the repository at this point in the history
BugLink: http://bugs.launchpad.net/ubuntu/+bug/396780

Commit 073aaa1 "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: Christophe Dumez <[email protected]>
Tested-by: Christophe Dumez <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
Acked-by: Andy Whitcroft <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>
  • Loading branch information
smb49 authored and Dave Kleikamp committed Jul 23, 2009
1 parent 4be3bd7 commit 4a19fb1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/jfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4a19fb1

Please sign in to comment.