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

Issue 2487983003: Part 2.3: Is policy list subsumed under subsuming policy? (Closed)

Created:
4 years, 1 month ago by amalika
Modified:
4 years ago
CC:
blink-reviews, chromium-reviews, oilpan-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Part 2.3: Is policy list subsumed under subsuming policy? This is part of an experimental feature Embedding-CSP. This patch considers schemes when finding an `effective` vector of CSPSources. Previously, we handled scheme to host and host to host source expressions. This CL considers specifically scheme to scheme source expressions. Example 1: A: http: B: http://example.com Then the resulting intersaction should be B. Example 2: A: https: http://example.com B: http://example.com http: Then the result should be `http://example.com https:`, i.e. the former should not be upgraded to "https" Moreover, we should also NOT stop when we find a match. Example 3: A: https://example.com http://example.com/foo B: http://example.com/foo https://example.com If we stop based on first match, we would get: `https://example.com/foo http://example.com/foo` However, the correct result should be: `https://example.com http://example.com/foo` since the order of CSPSources should not matter. BUG=647588 Committed: https://crrev.com/cb5cc2c4d0e9f56a7b408d33d264b7ca0c864a18 Cr-Commit-Position: refs/heads/master@{#434477}

Patch Set 1 : Properly handling scheme-source to scheme-source matching #

Total comments: 6

Patch Set 2 : Separating scheme to scheme normalization #

Total comments: 20

Patch Set 3 : Addressing comments #

Total comments: 4

Patch Set 4 : Adding a comment #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -11 lines) Patch
M third_party/WebKit/Source/core/frame/csp/CSPSource.h View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPSource.cpp View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPSourceTest.cpp View 1 2 3 2 chunks +203 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/SourceListDirective.h View 1 2 2 chunks +6 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp View 1 2 2 chunks +68 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/SourceListDirectiveTest.cpp View 1 2 3 chunks +57 lines, -3 lines 0 comments Download

Messages

Total messages: 35 (18 generated)
amalika
This is a second part for finding `effective policy`. Previously, we handled scheme to host ...
4 years, 1 month ago (2016-11-09 17:53:46 UTC) #6
Mike West
Small comments, mostly good to go! https://codereview.chromium.org/2487983003/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp File third_party/WebKit/Source/core/frame/csp/CSPSource.cpp (right): https://codereview.chromium.org/2487983003/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp#newcode148 third_party/WebKit/Source/core/frame/csp/CSPSource.cpp:148: if (isSchemeOnly() || ...
4 years, 1 month ago (2016-11-17 10:58:31 UTC) #10
amalika
I added and refactored some parts to better scheme to scheme normalization. In particular, when ...
4 years, 1 month ago (2016-11-19 18:34:32 UTC) #12
blink-reviews
On Sat, Nov 19, 2016 at 7:34 PM, <amalika@google.com> wrote: > I added and refactored ...
4 years, 1 month ago (2016-11-22 12:28:17 UTC) #13
chromium-reviews
On Sat, Nov 19, 2016 at 7:34 PM, <amalika@google.com> wrote: > I added and refactored ...
4 years, 1 month ago (2016-11-22 12:28:17 UTC) #14
Mike West
Sorry again for the delay. I've left some comments! https://codereview.chromium.org/2487983003/diff/100001/third_party/WebKit/Source/core/frame/csp/CSPSource.h File third_party/WebKit/Source/core/frame/csp/CSPSource.h (right): https://codereview.chromium.org/2487983003/diff/100001/third_party/WebKit/Source/core/frame/csp/CSPSource.h#newcode43 third_party/WebKit/Source/core/frame/csp/CSPSource.h:43: ...
4 years ago (2016-11-23 09:19:18 UTC) #15
amalika
https://codereview.chromium.org/2487983003/diff/100001/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp File third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp (right): https://codereview.chromium.org/2487983003/diff/100001/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp#newcode608 third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp:608: if (schemesMap.contains(sourceA->getScheme())) On 2016/11/23 at 09:19:18, Mike West (slow) ...
4 years ago (2016-11-24 13:25:30 UTC) #17
Mike West
Would you mind responding to comments with "done" or something similar? It's hard to figure ...
4 years ago (2016-11-24 14:00:54 UTC) #18
Mike West
On 2016/11/24 at 14:00:54, Mike West (slow) wrote: > Would you mind responding to comments ...
4 years ago (2016-11-24 14:02:23 UTC) #19
amalika
That's very strange as I had answered with an exact error. I might have mistakenly ...
4 years ago (2016-11-24 14:50:33 UTC) #20
Mike West
On 2016/11/24 at 14:50:33, amalika wrote: > That's very strange as I had answered with ...
4 years ago (2016-11-24 15:03:02 UTC) #21
Mike West
LGTM % the `Member<>` thing, which I think we'll need to revisit in a subsequent ...
4 years ago (2016-11-24 15:03:58 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2487983003/160001
4 years ago (2016-11-25 11:03:40 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:160001)
4 years ago (2016-11-25 11:08:23 UTC) #30
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/cb5cc2c4d0e9f56a7b408d33d264b7ca0c864a18 Cr-Commit-Position: refs/heads/master@{#434477}
4 years ago (2016-11-25 11:09:47 UTC) #32
sof
https://codereview.chromium.org/2487983003/diff/160001/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h File third_party/WebKit/Source/core/frame/csp/SourceListDirective.h (right): https://codereview.chromium.org/2487983003/diff/160001/third_party/WebKit/Source/core/frame/csp/SourceListDirective.h#newcode91 third_party/WebKit/Source/core/frame/csp/SourceListDirective.h:91: static void addSourceToMap(HashMap<String, CSPSource*>&, CSPSource*); HeapHashMap<String, Member<CSPSource>> is what's ...
4 years ago (2016-12-01 16:15:53 UTC) #34
amalika
4 years ago (2016-12-01 17:39:25 UTC) #35
Message was sent while issue was closed.
On 2016/12/01 at 16:15:53, sigbjornf wrote:
>
https://codereview.chromium.org/2487983003/diff/160001/third_party/WebKit/Sou...
> File third_party/WebKit/Source/core/frame/csp/SourceListDirective.h (right):
> 
>
https://codereview.chromium.org/2487983003/diff/160001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/frame/csp/SourceListDirective.h:91: static void
addSourceToMap(HashMap<String, CSPSource*>&, CSPSource*);
> HeapHashMap<String, Member<CSPSource>> is what's preferably used here, as the
map's pointer values are GC references.

Thank you for looking over it! This is very helpful. 

On a side note, we came across quite a strange error. In this CL:
https://codereview.chromium.org/2519103005, win_chroimium_rel_ng was the only
one failing. With SCOPED_TRACE (patch 8), it seems like the test variable
`test.originB` does not hold an expected value. For example, if the intended
value is "https://other-origin.test/", the printed values varies and for example
is "http://example.test/folder/" (which is only ever mentioned in initializing
std::vector for `policiesB`.)
We were worried that these references to heap members in `subsumes` functions
could somehow causing these inconsistencies? 

What seemed to fix the test is switching away from WTF::String() to `const char
*`, but it is not clear why this fixed the issue...

Powered by Google App Engine
This is Rietveld 408576698