diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-06-19 01:00:55 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-24 00:01:07 +0200 |
commit | c0c3a718e3ab2430a52a60d614b109e5e48e83e2 (patch) | |
tree | d4341a60d055e21310a16bcef68f4c8319f224c7 /fs/inode.c | |
parent | nilfs2_direct_IO(): remove dead code (diff) | |
download | linux-c0c3a718e3ab2430a52a60d614b109e5e48e83e2.tar.xz linux-c0c3a718e3ab2430a52a60d614b109e5e48e83e2.zip |
fs/posix_acl.c: make posix_acl_create() safer and cleaner
If posix_acl_create() returns an error code then "*acl" and "*default_acl"
can be uninitialized or point to freed memory. This is a dangerous thing
to do. For example, it causes a problem in ocfs2_reflink():
fs/ocfs2/refcounttree.c:4327 ocfs2_reflink()
error: potentially using uninitialized 'default_acl'.
I've re-written this so we set the pointers to NULL at the start. I've
added a temporary "clone" variable to hold the value of "*acl" until end.
Setting them to NULL means means we don't need the "no_acl" label. We may
as well remove the "apply_umask" stuff forward and remove that label as
well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/inode.c')
0 files changed, 0 insertions, 0 deletions