From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Colin King <colin.king@canonical.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] kobject: fix dereference before null check on kobj
Date: Wed, 1 May 2019 15:08:25 +0200 [thread overview]
Message-ID: <20190501130825.GA28441@kroah.com> (raw)
In-Reply-To: <20190501124317.1759-1-colin.king@canonical.com>
On Wed, May 01, 2019 at 01:43:17PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The kobj pointer is being null-checked so potentially it could be null,
> however, the ktype declaration before the null check is dereferencing kobj
> hence we have a potential null pointer deference. Fix this by moving the
> assignment of ktype after kobj has been null checked.
>
> Addresses-Coverity: ("Dereference before null check")
> Fixes: aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> lib/kobject.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Nice catch, thanks, will go queue this up now.
greg k-h
prev parent reply other threads:[~2019-05-01 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 12:43 [PATCH][next] kobject: fix dereference before null check on kobj Colin King
2019-05-01 13:08 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190501130825.GA28441@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox