FROMLIST: 9p: fix a potential acl leak
authorCong Wang <xiyou.wangcong@gmail.com>
Tue, 13 Dec 2016 18:33:34 +0000 (10:33 -0800)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:55 +0000 (18:03 +0200)
commit84e33ed9d93cec3fc6bbc64f4538211a18c2a942
tree3c7d7169ef1f42283912525eabb1a0ce3d1be21c
parentc4f1af7009d1a6d5d102107c575ad255be2b75a8
FROMLIST: 9p: fix a potential acl leak

(https://lkml.org/lkml/2016/12/13/579)

posix_acl_update_mode() could possibly clear 'acl', if so
we leak the memory pointed by 'acl'. Save this pointer
before calling posix_acl_update_mode() and release the memory
if 'acl' really gets cleared.

Reported-by: Mark Salyzyn <salyzyn@android.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Greg Kurz <groug@kaod.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Bug: 32458736
Change-Id: Ia78da401e6fd1bfd569653bd2cd0ebd3f9c737a0
fs/9p/acl.c