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