[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvwAV1duoAmodrUigyhzN-2cAkG2Ae6DXUtWCyOzPHOk7Q@mail.gmail.com>
Date: Thu, 21 May 2015 12:42:01 +0200
From: Richard Weinberger <richard.weinberger@...il.com>
To: maninder1.s@...sung.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
Fabian Frederick <fabf@...net.be>,
Al Viro <viro@...iv.linux.org.uk>,
LKML <linux-kernel@...r.kernel.org>,
"v.narang@...sung.com" <v.narang@...sung.com>
Subject: Re: [EDT] [PATCH] devpts/inode.c : Fix Possible dentry NULL dereference
On Thu, May 21, 2015 at 12:28 PM, Maninder Singh
<maninder1.s@...sung.com> wrote:
>
> EP-F6AA0618C49C4AEDA73BFF1B39950BAB
What is this?
> Hi,
>
> Subject: [PATCH 1/1] devpts/inode.c : Fix Possible dentry NULL dereference
>
> Issue reported by static tool Analyzer (Prevent).
> d_find_alias can return NULL to deentry, Thus we need NULL check
> before calling d_delete(dentry)
>
> Signed-off-by: Maninder Singh <maninder1.s@...sung.com>
> Reviewed-by: Vaneet Narang <v.narang@...sung.com>
> ---
> fs/devpts/inode.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
> index add5663..0350ac2 100644
> --- a/fs/devpts/inode.c
> +++ b/fs/devpts/inode.c
> @@ -663,7 +663,8 @@ void devpts_pty_kill(struct inode *inode)
> dentry = d_find_alias(inode);
>
> drop_nlink(inode);
> - d_delete(dentry);
> + if (dentry)
> + d_delete(dentry);
> dput(dentry); /* d_alloc_name() in devpts_pty_new() */
> dput(dentry); /* d_find_alias above */
While it is correct that d_find_alias() may return NULL, can this also
happen here?
I mean if that happens in the kill path we might have bigger trouble...
Al?
--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists