Wrapfs: fix NULL ptr deref in ->d_release and ->read_super
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 8 May 2022 01:31:40 +0000 (21:31 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 8 May 2022 01:31:40 +0000 (21:31 -0400)
commitdf73159d7297c8eb9f310411340f1320f3ecc491
treeb52624bd0ee9788dd036eab3cceb573a3bfa25ab
parentfeaab311eba0b66b45f5c6e013ad427e8950b9b1
Wrapfs: fix NULL ptr deref in ->d_release and ->read_super

It is possible that the dentry private data is NULL in case we ran out of
memory while initializing it in new_dentry_private_data.  So check for NULL
before attempting to release resources.  Similarly, in ->read_super, only
cleanu resources actually needed (the VFS cleans up the rest indirectly).

Signed-off-by: Andrew Burford <aburford@cs.stonybrook.edu>
Signed-off-by: Erez Zadok <ezk@cs.stonybrook.edu>
fs/wrapfs/dentry.c
fs/wrapfs/main.c