Re: [PATCH V2] exportfs: do not read dentry after free

2018-11-23 Thread J. Bruce Fields
On Fri, Nov 23, 2018 at 03:56:33PM +0800, Pan Bian wrote: > The function dentry_connected calls dput(dentry) to drop the previously > acquired reference to dentry. In this case, dentry can be released. > After that, IS_ROOT(dentry) checks the condition > (dentry == dentry->d_parent), which may

Re: [PATCH V2] exportfs: do not read dentry after free

2018-11-23 Thread J. Bruce Fields
On Fri, Nov 23, 2018 at 03:56:33PM +0800, Pan Bian wrote: > The function dentry_connected calls dput(dentry) to drop the previously > acquired reference to dentry. In this case, dentry can be released. > After that, IS_ROOT(dentry) checks the condition > (dentry == dentry->d_parent), which may

Re: [PATCH V2] exportfs: do not read dentry after free

2018-11-23 Thread Al Viro
On Fri, Nov 23, 2018 at 03:56:33PM +0800, Pan Bian wrote: > The function dentry_connected calls dput(dentry) to drop the previously > acquired reference to dentry. In this case, dentry can be released. > After that, IS_ROOT(dentry) checks the condition > (dentry == dentry->d_parent), which may

Re: [PATCH V2] exportfs: do not read dentry after free

2018-11-23 Thread Al Viro
On Fri, Nov 23, 2018 at 03:56:33PM +0800, Pan Bian wrote: > The function dentry_connected calls dput(dentry) to drop the previously > acquired reference to dentry. In this case, dentry can be released. > After that, IS_ROOT(dentry) checks the condition > (dentry == dentry->d_parent), which may

[PATCH V2] exportfs: do not read dentry after free

2018-11-22 Thread Pan Bian
The function dentry_connected calls dput(dentry) to drop the previously acquired reference to dentry. In this case, dentry can be released. After that, IS_ROOT(dentry) checks the condition (dentry == dentry->d_parent), which may result in a use-after-free bug. This patch directly compares dentry

[PATCH V2] exportfs: do not read dentry after free

2018-11-22 Thread Pan Bian
The function dentry_connected calls dput(dentry) to drop the previously acquired reference to dentry. In this case, dentry can be released. After that, IS_ROOT(dentry) checks the condition (dentry == dentry->d_parent), which may result in a use-after-free bug. This patch directly compares dentry