All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Rui Miguel Silva <rmfrfs@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bryan O'Donoghue <pure.logic@nexus-software.ie>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@linaro.org>,
	devel@driverdev.osuosl.org, greybus-dev@lists.linaro.org,
	"# 4 . 9 . x" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] staging: greybus: timesync: validate platform state callback
Date: Mon, 23 Jan 2017 17:35:26 +0100	[thread overview]
Message-ID: <20170123163526.GF3389@localhost> (raw)
In-Reply-To: <20170123163257.15855-1-rmfrfs@gmail.com>

On Mon, Jan 23, 2017 at 04:32:57PM +0000, Rui Miguel Silva wrote:
> When tearingdown timesync, and not in arche platform, the state platform
> callback is not initialized. That will trigger the following NULL
> dereferencing.
> CallTrace:
> 
>  ? gb_timesync_platform_unlock_bus+0x11/0x20 [greybus]
>  gb_timesync_teardown+0x85/0xc0 [greybus]
>  gb_timesync_svc_remove+0xab/0x190 [greybus]
>  gb_svc_del+0x29/0x110 [greybus]
>  gb_hd_del+0x14/0x20 [greybus]
>  ap_disconnect+0x24/0x60 [gb_es2]
>  usb_unbind_interface+0x7a/0x2c0
>  __device_release_driver+0x96/0x150
>  device_release_driver+0x1e/0x30
>  bus_remove_device+0xe7/0x130
>  device_del+0x116/0x230
>  usb_disable_device+0x97/0x1f0
>  usb_disconnect+0x80/0x260
>  hub_event+0x5ca/0x10e0
>  process_one_work+0x126/0x3b0
>  worker_thread+0x55/0x4c0
>  ? process_one_work+0x3b0/0x3b0
>  kthread+0xc4/0xe0
>  ? kthread_park+0xb0/0xb0
>  ret_from_fork+0x22/0x30
> 
> So, fix that by adding checks before use the callback.
> 
> Fixes: 970dc85bd95d ("greybus: timesync: Add timesync core driver")
> Cc: <stable@vger.kernel.org> # 4.9.x
> Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>

Reviewed-by: Johan Hovold <johan@kernel.org>

  reply	other threads:[~2017-01-23 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 16:32 [PATCH v2] staging: greybus: timesync: validate platform state callback Rui Miguel Silva
2017-01-23 16:35 ` Johan Hovold [this message]
2017-01-24  3:17 ` [greybus-dev] " Viresh Kumar

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=20170123163526.GF3389@localhost \
    --to=johan@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=elder@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=pure.logic@nexus-software.ie \
    --cc=rmfrfs@gmail.com \
    --cc=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.