Wrapfs: fix NULL pointer dereference when stacking wrapfs on top of itself.
authoraburford <andrew.burford@stonybrook.edu>
Sun, 15 May 2022 01:32:03 +0000 (21:32 -0400)
committeraburford <andrew.burford@stonybrook.edu>
Sun, 15 May 2022 01:32:03 +0000 (21:32 -0400)
commitdbdec37cb77d2b981de3861785ecc9d06d36d9f7
tree7094e6533573a7deacad4169e6afb3df63264b76
parentd2135771953caaa7e76f138502850657a5ea5730
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