Repository navigation
Commit 6ff9b09
committed
gfs2: Get rid of potential double-freeing in gfs2_create_inode
In gfs2_create_inode, after setting and releasing the acl / default_acl, the
acl / default_acl pointers are not set to NULL as they should be. In that
state, when the function reaches label fail_free_acls, gfs2_create_inode will
try to release the same acls again.
Fix that by setting the pointers to NULL after releasing the acls. Slightly
simplify the logic. Also, posix_acl_release checks for NULL already, so
there is no need to duplicate those checks here.
Fixes: e01580b ("gfs2: use generic posix ACL infrastructure")
Reported-by: Pan Bian <bianpan2016@163.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>1 parent cbbe76c commit 6ff9b09
1 file changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
| 748 | + | |
747 | 749 | | |
| 750 | + | |
748 | 751 | | |
749 | 752 | | |
750 | | - | |
751 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
752 | 756 | | |
| 757 | + | |
753 | 758 | | |
754 | 759 | | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | 760 | | |
759 | 761 | | |
760 | 762 | | |
| |||
789 | 791 | | |
790 | 792 | | |
791 | 793 | | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
| 794 | + | |
| 795 | + | |
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| |||
0 commit comments