worker: fix nullptr deref after MessagePort deser failure#25076
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
worker: fix nullptr deref after MessagePort deser failure#25076addaleax wants to merge 1 commit intonodejs:masterfrom
addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector.
richardlau
reviewed
Dec 16, 2018
| for (MessagePort* port : ports) { | ||
| // This will eventually release the MessagePort object itself. | ||
| port->Close(); | ||
| if (port != nullptr) |
Member
There was a problem hiding this comment.
Does the enclosing for loop need to loop through all ports or just up to (but not including since ports[i] == nullptr) i?
Member
Author
There was a problem hiding this comment.
@richardlau Yes, I think that should work too … should we optimize here? This effectively only occurs during .terminate(), and I don’t think it’s a typical case to pass more than one MessagePort per Message anyway?
Member
There was a problem hiding this comment.
¯\_(ツ)_/¯ I'll leave it to your judgement.
richardlau
approved these changes
Dec 16, 2018
jasnell
approved these changes
Dec 17, 2018
gireeshpunathil
approved these changes
Dec 17, 2018
This was referenced Dec 17, 2018
Member
Contributor
|
Landed in e1ab457. |
danbev
pushed a commit
that referenced
this pull request
Dec 19, 2018
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
MylesBorins
pushed a commit
that referenced
this pull request
Dec 25, 2018
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Merged
refack
pushed a commit
to refack/node
that referenced
this pull request
Jan 14, 2019
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: nodejs#25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
BethGriggs
pushed a commit
that referenced
this pull request
Apr 17, 2019
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
BethGriggs
pushed a commit
that referenced
this pull request
Apr 28, 2019
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Merged
BethGriggs
pushed a commit
that referenced
this pull request
Jul 2, 2019
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
BethGriggs
pushed a commit
that referenced
this pull request
Jul 17, 2019
This would previously always have crashed when deserializing a `MessagePort` fails, because there was always at least one `nullptr` entry in the vector. PR-URL: #25076 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
BethGriggs
added a commit
that referenced
this pull request
Jul 17, 2019
Merged
BethGriggs
added a commit
that referenced
this pull request
Jul 26, 2019
Notable changes: - **deps**: upgrade openssl sources to 1.1.1c (Sam Roberts) [#28212](#28212) - **stream**: do not unconditionally call `\_read()` on `resume()` (Anna Henningsen) [#26965](#26965) - **worker**: fix nullptr deref after MessagePort deser failure (Anna Henningsen) [#25076](#25076) PR-URL: #28731
BethGriggs
added a commit
that referenced
this pull request
Jul 30, 2019
Notable changes: - **deps**: upgrade openssl sources to 1.1.1c (Sam Roberts) [#28212](#28212) - **stream**: do not unconditionally call `\_read()` on `resume()` (Anna Henningsen) [#26965](#26965) - **worker**: fix nullptr deref after MessagePort deser failure (Anna Henningsen) [#25076](#25076) PR-URL: #28731
BethGriggs
added a commit
that referenced
this pull request
Jul 31, 2019
Notable changes: - **deps**: upgrade openssl sources to 1.1.1c (Sam Roberts) [#28212](#28212) - **stream**: do not unconditionally call `\_read()` on `resume()` (Anna Henningsen) [#26965](#26965) - **worker**: fix nullptr deref after MessagePort deser failure (Anna Henningsen) [#25076](#25076) PR-URL: #28731
BethGriggs
added a commit
that referenced
this pull request
Jul 31, 2019
Notable changes: - **deps**: upgrade openssl sources to 1.1.1c (Sam Roberts) [#28212](#28212) - **stream**: do not unconditionally call `\_read()` on `resume()` (Anna Henningsen) [#26965](#26965) - **worker**: fix nullptr deref after MessagePort deser failure (Anna Henningsen) [#25076](#25076) PR-URL: #28731
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would previously always have crashed when deserializing
a
MessagePortfails, because there was always at least onenullptrentry in the vector.(Caught by @gireeshpunathil in #25061)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes