ACK: [PATCH 1/1] kernfs: fix potential null pointer dereference
Colin Ian King
colin.king at canonical.com
Wed Apr 22 10:07:18 UTC 2020
On 22/04/2020 10:53, Kai-Heng Feng wrote:
> From: Peng Wang <rocking at whu.edu.cn>
>
> BugLink: https://bugs.launchpad.net/bugs/1874221
>
> Get root safely after kn is ensureed to be not null.
>
> Signed-off-by: Peng Wang <rocking at whu.edu.cn>
> Acked-by: Tejun Heo <tj at kernel.org>
> Link: https://lore.kernel.org/r/20190708151611.13242-1-rocking@whu.edu.cn
> Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> (cherry picked from commit 2fd60da46da76948b8cc561ae8cc902209686253)
> Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
> ---
> fs/kernfs/dir.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
> index a5a65de50318..c7b31e1f095b 100644
> --- a/fs/kernfs/dir.c
> +++ b/fs/kernfs/dir.c
> @@ -430,7 +430,6 @@ struct kernfs_node *kernfs_get_active(struct kernfs_node *kn)
> */
> void kernfs_put_active(struct kernfs_node *kn)
> {
> - struct kernfs_root *root = kernfs_root(kn);
> int v;
>
> if (unlikely(!kn))
> @@ -442,7 +441,7 @@ void kernfs_put_active(struct kernfs_node *kn)
> if (likely(v != KN_DEACTIVATED_BIAS))
> return;
>
> - wake_up_all(&root->deactivate_waitq);
> + wake_up_all(&kernfs_root(kn)->deactivate_waitq);
> }
>
> /**
>
upstream cherry pick, looks good, thank you.
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the kernel-team
mailing list