ios: Validate exception code buffer size before read. [crashpad/crashpad : main]

6 views
Skip to first unread message

Justin Cohen (Gerrit)

unread,
Feb 15, 2023, 12:12:47 PM2/15/23
to Mark Cogan, Crashpad LUCI CQ, crashp...@chromium.org

Attention is currently required from: Mark Cogan.

View Change

3 comments:

  • Patchset:

  • File snapshot/ios/exception_snapshot_ios_intermediate_dump.cc:

    • Patch Set #2, Line 182: // TODO: rationalize with the macOS implementation.

      I'm not sure what's left to change here. Mac's `ExceptionSnapshotMac::Initialize` sets `exception_` and `codes_` the same way. Mac has some additional logic for EXC_CRASH, EXC_RESOURCE and EXC_GUARD crashes, but we can't catch those on iOS.

      What do you think?

    • Patch Set #2, Line 189: code_count

      This check probably isn't necessary since, but the second one is. Any objections?

To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
Gerrit-Change-Number: 4255568
Gerrit-PatchSet: 2
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
Gerrit-Attention: Mark Cogan <ma...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Feb 2023 17:12:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Mark Mentovai (Gerrit)

unread,
Feb 15, 2023, 12:30:20 PM2/15/23
to Justin Cohen, Mark Cogan, Crashpad LUCI CQ, crashp...@chromium.org

Attention is currently required from: Justin Cohen, Mark Cogan.

View Change

3 comments:

  • File snapshot/ios/exception_snapshot_ios_intermediate_dump.cc:

    • Patch Set #2, Line 182: // TODO: rationalize with the macOS implementation.

      I'm not sure what's left to change here. Mac's `ExceptionSnapshotMac::Initialize` sets `exception_` and `codes_` the same way. Mac has some additional logic for EXC_CRASH, EXC_RESOURCE and EXC_GUARD crashes, but we can't catch those on iOS.

      What do you think?

    • Sounds fine.

    • Patch Set #2, Line 189: code_count

      This check probably isn't necessary since, but the second one is. Any objections?

    • I agree. Although you left out the explanation after “since”, I do see what I think you mean.

      The best way to express this is to turn it into a `DCHECK_GE`.

    • Patch Set #2, Line 191:

            if (code_count >= 2)
      exception_address_ = code[1];

      There’s a strong push to always use braces now in Chrome, and it’s even stronger in Crashpad.

To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
Gerrit-Change-Number: 4255568
Gerrit-PatchSet: 2
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-Attention: Justin Cohen <justi...@chromium.org>
Gerrit-Attention: Mark Cogan <ma...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Feb 2023 17:30:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Justin Cohen <justi...@chromium.org>
Gerrit-MessageType: comment

Justin Cohen (Gerrit)

unread,
Feb 15, 2023, 1:03:02 PM2/15/23
to Mark Mentovai, Mark Cogan, Crashpad LUCI CQ, crashp...@chromium.org

Attention is currently required from: Mark Cogan, Mark Mentovai.

Patch set 3:Commit-Queue +1

View Change

4 comments:

  • Patchset:

  • File snapshot/ios/exception_snapshot_ios_intermediate_dump.cc:

    • > I'm not sure what's left to change here. […]

      removed TODO.

    • > This check probably isn't necessary since, but the second one is. Any objections? […]

      Done

    • Patch Set #2, Line 191:

            if (code_count >= 2)
      exception_address_ = code[1];

      There’s a strong push to always use braces now in Chrome, and it’s even stronger in Crashpad.

    • Done

To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
Gerrit-Change-Number: 4255568
Gerrit-PatchSet: 3
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-Attention: Mark Cogan <ma...@chromium.org>
Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Feb 2023 18:02:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Justin Cohen <justi...@chromium.org>
Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
Gerrit-MessageType: comment

Mark Mentovai (Gerrit)

unread,
Feb 15, 2023, 1:11:14 PM2/15/23
to Justin Cohen, Mark Cogan, Crashpad LUCI CQ, crashp...@chromium.org

Attention is currently required from: Justin Cohen, Mark Cogan.

Patch set 3:Code-Review +1

View Change

    To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crashpad/crashpad
    Gerrit-Branch: main
    Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
    Gerrit-Change-Number: 4255568
    Gerrit-PatchSet: 3
    Gerrit-Owner: Justin Cohen <justi...@chromium.org>
    Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
    Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Justin Cohen <justi...@chromium.org>
    Gerrit-Attention: Mark Cogan <ma...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Feb 2023 18:11:09 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Justin Cohen (Gerrit)

    unread,
    Feb 15, 2023, 1:11:39 PM2/15/23
    to Mark Mentovai, Mark Cogan, Crashpad LUCI CQ, crashp...@chromium.org

    Attention is currently required from: Justin Cohen, Mark Cogan.

    Patch set 3:Commit-Queue +2

    View Change

      To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: crashpad/crashpad
      Gerrit-Branch: main
      Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
      Gerrit-Change-Number: 4255568
      Gerrit-PatchSet: 3
      Gerrit-Owner: Justin Cohen <justi...@chromium.org>
      Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
      Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
      Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
      Gerrit-Attention: Justin Cohen <justi...@chromium.org>
      Gerrit-Attention: Mark Cogan <ma...@chromium.org>
      Gerrit-Comment-Date: Wed, 15 Feb 2023 18:11:33 +0000

      Crashpad LUCI CQ (Gerrit)

      unread,
      Feb 15, 2023, 1:13:50 PM2/15/23
      to Justin Cohen, Mark Mentovai, Mark Cogan, crashp...@chromium.org

      Crashpad LUCI CQ submitted this change.

      View Change

      Approvals: Justin Cohen: Commit Mark Mentovai: Looks good to me
      ios: Validate exception code buffer size before read.

      Bug: 1415371
      Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
      Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4255568
      Reviewed-by: Mark Mentovai <ma...@chromium.org>
      Commit-Queue: Justin Cohen <justi...@chromium.org>
      ---
      M snapshot/BUILD.gn
      M snapshot/ios/exception_snapshot_ios_intermediate_dump.cc
      M snapshot/ios/process_snapshot_ios_intermediate_dump_test.cc
      A snapshot/ios/testdata/crash-c44acfcbccd8c7a8
      4 files changed, 25 insertions(+), 3 deletions(-)


      To view, visit change 4255568. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: crashpad/crashpad
      Gerrit-Branch: main
      Gerrit-Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
      Gerrit-Change-Number: 4255568
      Gerrit-PatchSet: 4
      Gerrit-Owner: Justin Cohen <justi...@chromium.org>
      Gerrit-Reviewer: Crashpad LUCI CQ <crashpa...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
      Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
      Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages