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

Issue 14533007: Avoid crashing the browser on truncated reads from the cache backend (Closed)

Created:
7 years, 7 months ago by pasko-google - do not use
Modified:
7 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, Ilya Sherman, gavinp+disk_chromium.org, MAD, jar (doing other things)
Visibility:
Public.

Description

Avoid crashing the browser on truncated reads from the cache backend BUG=236384 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197164

Patch Set 1 #

Total comments: 2

Patch Set 2 : comments addressed #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -2 lines) Patch
M net/http/http_cache_transaction.cc View 1 2 chunks +24 lines, -2 lines 8 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
pasko-google - do not use
7 years, 7 months ago (2013-04-29 16:01:04 UTC) #1
pasko-google - do not use
Adding Jim as a reviewer to histograms.xml
7 years, 7 months ago (2013-04-29 16:53:04 UTC) #2
gavinp
lgtm. You'll need an owners review from jar as well.
7 years, 7 months ago (2013-04-29 16:53:49 UTC) #3
gavinp
https://codereview.chromium.org/14533007/diff/1/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/14533007/diff/1/tools/metrics/histograms/histograms.xml#newcode823 tools/metrics/histograms/histograms.xml:823: <histogram name="HttpCache.HeaderTruncated" units="BooleanTruncated"> Would "TruncatedHeader" and "TruncatedMetadata" be better ...
7 years, 7 months ago (2013-04-29 16:54:30 UTC) #4
pasko-google - do not use
https://codereview.chromium.org/14533007/diff/1/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/14533007/diff/1/tools/metrics/histograms/histograms.xml#newcode823 tools/metrics/histograms/histograms.xml:823: <histogram name="HttpCache.HeaderTruncated" units="BooleanTruncated"> On 2013/04/29 16:54:30, gavinp wrote: > ...
7 years, 7 months ago (2013-04-29 17:31:40 UTC) #5
jar (doing other things)
Patch set 2 histograms.xml LGTM
7 years, 7 months ago (2013-04-29 17:33:16 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pasko@google.com/14533007/9001
7 years, 7 months ago (2013-04-29 17:36:35 UTC) #7
commit-bot: I haz the power
Change committed as 197164
7 years, 7 months ago (2013-04-29 22:31:34 UTC) #8
rvargas (doing something else)
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { This doesn't look good ...
7 years, 7 months ago (2013-04-30 18:06:25 UTC) #9
pasko-google - do not use
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { On 2013/04/30 18:06:25, rvargas ...
7 years, 7 months ago (2013-04-30 19:12:38 UTC) #10
rvargas (doing something else)
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { On 2013/04/30 19:12:38, pasko ...
7 years, 7 months ago (2013-04-30 21:09:05 UTC) #11
pasko-google - do not use
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { On 2013/04/30 21:09:05, rvargas ...
7 years, 7 months ago (2013-04-30 22:13:33 UTC) #12
rvargas (doing something else)
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { On 2013/04/30 22:13:33, pasko ...
7 years, 7 months ago (2013-04-30 22:50:06 UTC) #13
pasko-google - do not use
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transaction.cc#newcode1388 net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) { On 2013/04/30 22:50:07, rvargas ...
7 years, 7 months ago (2013-05-02 16:56:37 UTC) #14
rvargas (doing something else)
7 years, 7 months ago (2013-05-02 17:52:31 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transa...
File net/http/http_cache_transaction.cc (right):

https://codereview.chromium.org/14533007/diff/9001/net/http/http_cache_transa...
net/http/http_cache_transaction.cc:1388: if (io_buf_len_ > 0) {
On 2013/05/02 16:56:37, pasko wrote:
> On 2013/04/30 22:50:07, rvargas wrote:
> > > Should we also disable the chromium sandbox? It would be fun to blame
Blink
> > for
> > > all contract violations.
> > > </sarcasm>
> > 
> > We don't need to disable the sandbox... we crash right away when the
renderer
> > does something that is not supposed to do. :p
> 
> We have the sandbox because the renderer, if tricked, can do really nasty
things
> without a crash or prior to crashing. And there were too many things to fix
> there, instead we reduced the attack surface by placing the renderer process
> into the sandbox and putting extra guards around talking to the renderer.

And that is why the sandbox has nothing to do with this code (I mean, it was not
a very good example to pick). The sandbox is a security feature; it has nothing
to do with enforcing any point of view on code correctness or API contracts.

> 
> Luckily disk cache backends are less nasty, but they too are not free from
> occasional human error, and are somewhat complex, multithreaded components. I
do
> _not_ suggest placing the cache into the sandbox right now, though it's a
viable
> thing to do when sandbox supports chroot which seccomp-bpf does.
> 
> On the other hand, what is wrong with being on a slightly safer side with
almost
> no cost?

It is wrong to mask bugs by _handling_ cases that an API forbids, when both
sides of that API are fully implemented by code under our control. That muddy
the waters about whose responsibility is to do something, and that is not a good
thing to have in the long term.

> 
> I uploaded a change to revert this CL, if after this much discussion you still
> think it is not a proper layer here to put safety checks, lgtm that one:
> https://codereview.chromium.org/14740016

Powered by Google App Engine
This is Rietveld 408576698