Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Issue 23364002: asan use after free in Aura cc:TextureLayer::Update (Closed)

Created:
7 years, 4 months ago by cpu_(ooo_6.6-7.5)
Modified:
7 years, 2 months ago
Reviewers:
danakj, piman
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, cc-bugs_chromium.org, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Asan use after free in Aura cc:TextureLayer::Update What happens is that GpuProcessTransportFactory::OffscreenContextProviderForMainThread() resets the shared context, so the existing one is freed, but OwnedTexture has a raw pointer to it Which is accessed by TextureLayer::Update via the client. So the solution is to have the client reset the raw pointer when the OnLostMainThreadSharedContext() is fired on the OwnedTexture, note how that function has a scoped pointer on the old_contexts_main_thread which makes it safe to call host_context_ while in the callback. BUG=275775 TEST=none, see bug for asan notes.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M cc/layers/texture_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/aura/gpu_process_transport_factory.cc View 1 chunk +1 line, -0 lines 2 comments Download

Messages

Total messages: 6 (0 generated)
cpu_(ooo_6.6-7.5)
7 years, 4 months ago (2013-08-20 23:57:41 UTC) #1
piman
lgtm
7 years, 4 months ago (2013-08-21 00:01:04 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cpu@chromium.org/23364002/1
7 years, 4 months ago (2013-08-21 19:22:09 UTC) #3
cpu_(ooo_6.6-7.5)
Aborted commit of this patch at request of danakj So this CL will be left ...
7 years, 4 months ago (2013-08-21 22:50:09 UTC) #4
cpu_(ooo_6.6-7.5)
7 years, 4 months ago (2013-08-21 22:50:36 UTC) #5
piman
7 years, 4 months ago (2013-08-21 23:01:32 UTC) #6
https://chromiumcodereview.appspot.com/23364002/diff/1/content/browser/aura/g...
File content/browser/aura/gpu_process_transport_factory.cc (right):

https://chromiumcodereview.appspot.com/23364002/diff/1/content/browser/aura/g...
content/browser/aura/gpu_process_transport_factory.cc:76: DeleteTexture();
On 2013/08/21 22:50:09, cpu wrote:
> I think we should not call DeleteTexture() here and simply set the texture_id_
> to zero.

I disagree. It can cause leaks depending on the GL behavior (and the reason for
the lost resource).

Powered by Google App Engine
This is Rietveld 408576698