Wrapfs: fix NULL pointer dereference when stacking wrapfs on top of itself. wrapfs
authorAndrew Burford <aburford@cs.stonybrook.edu>
Sun, 15 May 2022 02:15:44 +0000 (22:15 -0400)
committerAndrew Burford <aburford@cs.stonybrook.edu>
Sun, 15 May 2022 02:15:44 +0000 (22:15 -0400)
commit3ace96ff2674eb85f49b2906f0b1259469c7a04b
treecd98e51ea29993ada1082f30d6bfe5cfe95f28f4
parent4470ff7f10ae563fa5d4bc89da18e44c4dc8c3e6
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
fs/wrapfs/main.c