All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Prashant Malani <pmalani@chromium.org>
Cc: Victor Ding <victording@chromium.org>,
	linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev,
	groeck@chromium.org, dustin@howett.net, gustavoars@kernel.org,
	gregkh@linuxfoundation.org, sebastian.reichel@collabora.com,
	dnojiri@chromium.org, lee.jones@linaro.org, bleung@chromium.org,
	tinghan.shen@mediatek.com,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v2] platform/chrome: cros_ec_typec: zero out stale pointers
Date: Thu, 8 Dec 2022 10:01:35 +0800	[thread overview]
Message-ID: <Y5FFf+VjViglELbZ@google.com> (raw)
In-Reply-To: <Y5EZmSSbOFRpfBNj@chromium.org>

On Wed, Dec 07, 2022 at 10:54:17PM +0000, Prashant Malani wrote:
> On Dec 07 09:39, Victor Ding wrote:
> > `cros_typec_get_switch_handles` allocates four pointers when obtaining
> > type-c switch handles. These pointers are all freed if failing to obtain
> > any of them; therefore, pointers in `port` become stale. The stale
> > pointers eventually cause use-after-free or double free in later code
> > paths. Zeroing out all pointer fields after freeing to eliminate these
> > stale pointers.
> > 
> > Fixes: f28adb41dab4 ("platform/chrome: cros_ec_typec: Register Type C switches")
> > Fixes: 1a8912caba02 ("platform/chrome: cros_ec_typec: Get retimer handle")
> > Signed-off-by: Victor Ding <victording@chromium.org>
> Acked-by: Prashant Malani <pmalani@chromium.org>
> 
> Hey Tzung-Bi, it looks like you've already created a tag for the
> v6.2 pull request, so I don't know if it's too late to apply this
> for the current dev cycle.
> So, I've not applied it, but have left the Acked-by tag.
> 
> Please feel free to apply it if there's still room for it before
> you send out the pull request.

Given that the patch fixes an use-after-free, let's include this in the
coming merge window.  Have queued.

  reply	other threads:[~2022-12-08  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  9:39 [PATCH v2] platform/chrome: cros_ec_typec: zero out stale pointers Victor Ding
2022-12-07 22:54 ` Prashant Malani
2022-12-08  2:01   ` Tzung-Bi Shih [this message]
2022-12-08  2:00 ` patchwork-bot+chrome-platform
2022-12-08  2:00 ` patchwork-bot+chrome-platform

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=Y5FFf+VjViglELbZ@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dnojiri@chromium.org \
    --cc=dustin@howett.net \
    --cc=enric.balletbo@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=gustavoars@kernel.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmalani@chromium.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=tinghan.shen@mediatek.com \
    --cc=victording@chromium.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.