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

Issue 1107043003: [ABANDONED] Make sure that threaded-data-provider doesn't cause a use-after-free. (Closed)

Created:
5 years, 8 months ago by yhirano
Modified:
5 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make sure that threaded-data-provider doesn't cause a use-after-free. As ThreadedDataProvider::OnReceivedDataOnForegroundThread passes the given pointer to another thread, it requires the pointer to be valid until it is used. On ResourceDispatcher::OnReceivedData, the pointer comes from shared memory buffer, or from std::string data (alternative data). As written above, it is dangerous to pass the alternative data pointer because it is stack allocated. BUG=None R=oysteine@chromium.org

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M content/child/resource_dispatcher.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
yhirano
Hi Oystein, I am writing a CL[1] and I'm not certain about ThreadedDataProvider behavior. As ...
5 years, 8 months ago (2015-04-28 06:23:39 UTC) #2
oystein (OOO til 10th of July)
On 2015/04/28 06:23:39, yhirano wrote: > Hi Oystein, I am writing a CL[1] and I'm ...
5 years, 7 months ago (2015-04-28 17:14:45 UTC) #3
yhirano
5 years, 7 months ago (2015-04-30 01:16:44 UTC) #4
On 2015/04/28 17:14:45, Oystein wrote:
> On 2015/04/28 06:23:39, yhirano wrote:
> > Hi Oystein, I am writing a CL[1] and I'm not certain about
> > ThreadedDataProvider behavior. As written in the description, it looks
> dangerous
> > because you retain a pointer that can be freed synchronously.
> > If it is actually safe, I think adding a DCHECK is good for readability.
> > 
> > Can you take a look?
> > 
> > 1: https://codereview.chromium.org/1103813002/
> 
> Looks like you're right, yep! The site_isolation_policy.cc isn't turned on in
> practice, but this'll be dangerous if/when it does. Since all it does is use
the
> "alternate data" to insert a space (and only when it's blocked), this could do
> with some refactoring regardless.

Thanks, I will add a TODO in https://codereview.chromium.org/1103813002/.

Powered by Google App Engine
This is Rietveld 408576698