I get a shutdown crash in 220.127.116.11pre debug builds after running the testcase from bug 377470 (https://bugzilla.mozilla.org/attachment.cgi?id=261540), stack as described at bug 377470 comment 9, dereferencing a deleted object. So far have not reproduced the crash in an optimized build.
nsHTMLComboboxAccessible::Init() creates the button and list accessibles into its members using GetNextSibling(). The problem is that the GetNextSibling methods uses mNextSibling to check if it should create its sibling or not, but doesn't actually assign it, so any subsequent call to GetNextSibling() will create a new ComboboxListAccessible object. ComboboxListAccessible caches up option accessibles effectively stealing the children of the previous one: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp&rev=18.104.22.168&root=/cvsroot&mark=361#345 which now has an invalid mFirstChild pointer - which will eventually crash when nsAccessible::Shutdown tries to use it.
This should fix it I think. This code have been redesigned on trunk (bug 278034) so this looks like a branch-only bug.
Attachment #270841 - Flags: review?(aaronleventhal)
I can reproduce this crash in Firefox 22.214.171.124 on Linux: TB33713986Z
Severity: normal → critical
Comment on attachment 270841 [details] [diff] [review] Patch rev. 1 Should nsHTMLComboboxAccessible::Shutdown() also manually shutdown the mComboboxTextFieldAccessible and mComboboxButtonAccessible (same as you did for the list)? + mNextSibling = *aNextSibling; I suggest moving both of those before the if, and changing it to: SetNextSibling(accessible);
Attachment #270841 - Flags: review?(aaronleventhal) → review+
(In reply to comment #4) > (From update of attachment 270841 [details] [diff] [review]) > Should nsHTMLComboboxAccessible::Shutdown() also manually shutdown the > mComboboxTextFieldAccessible and mComboboxButtonAccessible Sure. > + mNextSibling = *aNextSibling; > I suggest moving both of those before the if, and changing it to: > SetNextSibling(accessible); This makes me a bit nervous about it: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/accessible/src/base/nsAccessible.cpp&rev=126.96.36.199&root=/cvsroot&mark=370#368 DEAD_END_ACCESSIBLE == 0x1 and the combobox accessible code in general doesn't look like it would behave well with mNextSibling == 0x1. I'd prefer to leave the null-ptr logic in these methods as is for now - I fear for regressions if we mess to much with it.
Attachment #270927 - Flags: review?(aaronleventhal)
Attachment #270927 - Flags: review?(aaronleventhal) → review+
Attachment #270841 - Attachment is obsolete: true
Guessing at security impact. Would a user need to install something to be vulnerable to web content doing what this testcase does, or would simply turning on a screenreader or the like be sufficient?
Whiteboard: [sg:moderate?] critical if unprivileged content can trigger this
Comment on attachment 270927 [details] [diff] [review] Patch rev. 2 approved for 188.8.131.52 and 184.108.40.206, a=dveditz
(In reply to comment #6) Daniel, I think one can trick the AT into creating the right set of a11y nodes from unprivileged script by moving around focus or selection and then remove DOM nodes or restyle elements to cause the Shutdown() to happen. This would setup the necessary state for either accessing a dead node (bug 387252) or to steal the children (this bug) through a call to GetNextSibling(). So it comes down to if one can trick the AT to do a GetNextSibling() on the right node from script. It doesn't seem entirely impossible to me... Aaron? If my guess is right then simply turning on a screenreader or other AT would be sufficient.
MOZILLA_1_8_BRANCH: mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp 220.127.116.11 mozilla/accessible/src/html/nsHTMLSelectAccessible.h 18.104.22.168 MOZILLA_1_8_0_BRANCH: mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp 22.214.171.124.2.2 mozilla/accessible/src/html/nsHTMLSelectAccessible.h 126.96.36.199.4.1 (trunk not affected) -> FIXED
Verified for 188.8.131.52 using Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:184.108.40.206pre) Gecko/20070822 BonEcho/220.127.116.11pre ID:2007082203 with the testcase from comment #1 and verified for 18.104.22.168 using Thunderbird 22.214.171.124 RC with Thunderbrowse - no crash Adding verified keywords
re-adding fixed126.96.36.199 to record when the actual fix happened, even though verification was later due to firedrills.
You need to log in before you can comment on or make changes to this bug.