New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 605502 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

ASSERTION FAILED: tagName.namespaceURI() == starAtom

Project Member Reported by ClusterFuzz, Apr 21 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6509784567644160

Fuzzer: mbarbella_js_mutation_layout
Job Type: linux_debug_content_shell_drt
Platform Id: linux

Crash Type: ASSERT
Crash Address: 
Crash State:
  ASSERTION FAILED: tagName.namespaceURI() == starAtom
  void blink::SelectorDataList::collectElementsByTagName<blink::SingleElementSelec
  void blink::SelectorDataList::execute<blink::SingleElementSelectorQueryTrait>
  

Minimized Testcase (0.16 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97W56PqbHulAAGasXsgaQyO7m3dNWto0KsCSeMNtGKbfMTEeJkwWUSt0mfygcIbjzLDYKOM56UpL7MbgdoAn6j8_cOIRW08T_tU6evkXZDrz-PtJYQcNChDkvAYNKg0H-KKTKTdJVQqtbWkTRx2xfjOn3QbOA
<!DOCTYPE html>
  <script>
    shouldNotThrow = function(_a)
    {
            eval(_a);
    }
        shouldNotThrow("document.querySelector('|pre')");
    </script>


Filer: ssamanoori

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Components: Blink>DOM
Labels: findit-for-crash Te-Logged ToolsTestsFindItCorrectResult M-50
Owner: ch.du...@samsung.com
Status: Assigned (was: Available)
	Regression information is not available. The result is the blame information.

Author: esprehn@chromium.org
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/f4137a79185d3a1f1a3912f4c514af96d552f292
Time: Thu Apr 30 05:53:42 2015
The CL last changed line 211 of file SelectorQuery.cpp, which is stack frame 0.

Author: ch.dumez@samsung.com
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/045e36c399e19c04b2730116d27209eabc5d18c2
Time: Thu Jan 30 07:29:25 2014
The CL last changed line 513 of file SelectorQuery.cpp, which is stack frame 1.

Author: ch.dumez@samsung.com
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/655b10a168e2b474875203f254284ee01df5fcf6
Time: Fri Jan 24 01:31:06 2014
The CL last changed line 174 of file SelectorQuery.cpp, which is stack frame 2.

Author: dglazkov@chromium.org
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/8f02c2991f869a49c551ce152f71beca0719e35c
Time: Mon Feb 18 06:44:13 2013
The CL last changed line 551 of file SelectorQuery.cpp, which is stack frame 3.

Author: ch.dumez@samsung.com
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/a06a5247fcca7362965eec152b506c4fc5f9f8cb
Time: Fri Jan 24 22:20:51 2014
The CL last changed line 1219 of file ContainerNode.cpp, which is stack frame 4.

Author: ch.dumez@samsung.com
Component: chromium
Changelist: https://chromium.googlesource.com/chromium/src//+/5c7073f703c22db5fecd83d866693a4fe0d30618
Time: Fri Apr 25 22:57:34 2014
The CL last changed line 68 of file ParentNode.h, which is stack frame 5.

Suspected Component: chromium
==================================
Above is the only CL from findit and the changes made to file "SelectorQuery.cpp" from the frame #1 is more related to it. 

ch.dumez@ :Could you please look into this issue if it is related to your change,else please route this issue to an appropriate dev person.

Thanks,
Cc: dominicc@chromium.org
Owner: esprehn@chromium.org
I guess esprehn's change is more relevant; I think it added the assertion.
Cc: meade@chromium.org esprehn@chromium.org
Components: -Blink>DOM Blink>CSS
Owner: r...@opera.com
rune@ I think you regressed this in https://codereview.chromium.org/1616423003 where you removed the check for selectorsNeedNamespaceResolution. I think we used to throw an exception. Safari does match when you do querySelector("|body"), and firefox always returns null. What does the spec say? In either case we shouldn't hit the assert. :)
Labels: -Stability-Memory-AddressSanitizer -Restrict-View-EditIssue
No reason to restrict this, it's a correctness bug not a security issue.

Comment 5 by r...@opera.com, Apr 28 2016

We should not throw an exception as "|body" is a valid selector. However, we should not match the html body element as that is in the html namespace and "|body" means it should body elements without a namespace. I'll have a look.

Comment 6 by r...@opera.com, Apr 28 2016

Gecko correctly outputs: "2 1" for the demo below:

<!DOCTYPE html>
<body>
<script>
    document.body.appendChild(document.createElementNS("", "body"));
    console.log(document.querySelectorAll('body').length);
    console.log(document.querySelectorAll('|body').length);
</script>

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0e4bdb8bdd9f2eb306b1ffc29e881c0cc258794

commit f0e4bdb8bdd9f2eb306b1ffc29e881c0cc258794
Author: rune <rune@opera.com>
Date: Thu Apr 28 17:46:35 2016

querySelector* fast-path missing namespace check for no namespace.

querySelector* does not allow selectors with namespaces, yet selectors
with no namespace are still allowed. Check for empty namespace before
hitting the fast path for tag names.

R=esprehn@chromium.org
BUG= 605502 

Review-Url: https://codereview.chromium.org/1932673002
Cr-Commit-Position: refs/heads/master@{#390417}

[add] https://crrev.com/f0e4bdb8bdd9f2eb306b1ffc29e881c0cc258794/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors-expected.txt
[add] https://crrev.com/f0e4bdb8bdd9f2eb306b1ffc29e881c0cc258794/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors.html
[modify] https://crrev.com/f0e4bdb8bdd9f2eb306b1ffc29e881c0cc258794/third_party/WebKit/Source/core/dom/SelectorQuery.cpp

Comment 8 by r...@opera.com, Apr 28 2016

Status: Fixed (was: Assigned)
Project Member

Comment 9 by ClusterFuzz, Apr 29 2016

ClusterFuzz has detected this issue as fixed in range 390399:390423.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6509784567644160

Fuzzer: mbarbella_js_mutation_layout
Job Type: linux_debug_content_shell_drt
Platform Id: linux

Crash Type: ASSERT
Crash Address: 
Crash State:
  ASSERTION FAILED: tagName.namespaceURI() == starAtom
  void blink::SelectorDataList::collectElementsByTagName<blink::SingleElementSelec
  void blink::SelectorDataList::execute<blink::SingleElementSelectorQueryTrait>
  
Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_debug_content_shell_drt&range=390399:390423

Minimized Testcase (0.16 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97W56PqbHulAAGasXsgaQyO7m3dNWto0KsCSeMNtGKbfMTEeJkwWUSt0mfygcIbjzLDYKOM56UpL7MbgdoAn6j8_cOIRW08T_tU6evkXZDrz-PtJYQcNChDkvAYNKg0H-KKTKTdJVQqtbWkTRx2xfjOn3QbOA
<!DOCTYPE html>
  <script>
    shouldNotThrow = function(_a)
    {
            eval(_a);
    }
        shouldNotThrow("document.querySelector('|pre')");
    </script>


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.

Sign in to add a comment