Wrapfs: fix NULL pointer dereference when stacking wrapfs on top of itself.
authoraburford <andrew.burford@stonybrook.edu>
Sun, 15 May 2022 01:32:04 +0000 (21:32 -0400)
committeraburford <andrew.burford@stonybrook.edu>
Sun, 15 May 2022 01:32:04 +0000 (21:32 -0400)
commit82fd2bdfc10ea7980708114de98aec7ec8ad55f2
tree5561f44e0483e36c677626ca4da12b5395fc948c
parent75e43e4356350c79e618255eb74f5745740ec974
Wrapfs: fix NULL pointer dereference when stacking wrapfs on top of itself.

Wrapfs assumes that the d_fsdata field has already been initialized whenever
it is passed one of its own dentries, but it doesn't give the lower fs a chance
to allocate their d_fsdata field when it creates a new lower_dentry. This is
fixed by simply replacing a call to d_add in __wrapfs_lookup with a call to
->lookup on the lower fs inode.

Signed-off-by: Andrew Burford <aburford@cs.stonybrook.edu>
fs/wrapfs/lookup.c