Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: account for OpenSSL unexpected version #54038

Merged

Conversation

codebytere
Copy link
Member

Refs #53456

Fixes a crash present in Electron after ingesting the above PR. This happened because the logic to parse for an OpenSSL version didn't account for OpenSSL_version returning a value that doesn't match the expected pattern of OpenSSL 1.1.0i 14 Aug 2018. In Electron's case, OpenSSL_version returns just BoringSSL, which in combination with the search logic not accounting for the delimiter not being present caused an out-of-bounds crash:

out_of_range was thrown in -fno-exceptions mode with message "basic_string"

This fixes that by checking for the null terminator and returning 0.0.0 when the target delimiter isn't present.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 25, 2024
@richardlau richardlau added commit-queue Add this label to land a pull request using GitHub Actions. request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 25, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 25, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test?

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a comment to avoid confusion for future readers.

src/node_metadata.cc Show resolved Hide resolved
@joyeecheung
Copy link
Member

Can you add a test?

I don’t think this is testable with the existing CI configuration - this needs a new build config for the version string definition so needs a new CI job IIUC. It’s a separate question whether we should add a job to test linking to BoringSSL in the CI - this is not strictly supported and the best we can do is just accepting patches when others are willing to maintain it.

src/node_metadata.cc Outdated Show resolved Hide resolved
@codebytere codebytere added request-ci Add this label to start a Jenkins CI on a PR. and removed needs-ci PRs that need a full CI run. labels Jul 29, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 29, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.52%. Comparing base (b32732b) to head (89a2088).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54038      +/-   ##
==========================================
+ Coverage   94.50%   94.52%   +0.01%     
==========================================
  Files         314      314              
  Lines      121090   121090              
  Branches    23696    23705       +9     
==========================================
+ Hits       114442   114457      +15     
+ Misses       6443     6431      -12     
+ Partials      205      202       -3     

see 4 files with indirect coverage changes

@codebytere codebytere added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 29, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 29, 2024
@nodejs-github-bot
Copy link
Collaborator

@codebytere codebytere added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 31, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 31, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54038
✔  Done loading data for nodejs/node/pull/54038
----------------------------------- PR info ------------------------------------
Title      src: account for OpenSSL unexpected version (#54038)
Author     Shelley Vohr <shelley.vohr@gmail.com> (@codebytere)
Branch     codebytere:fix-potential-out-of-range -> nodejs:main
Labels     c++
Commits    1
 - src: account for OpenSSL unexpected version
Committers 1
 - Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54038
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54038
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - src: account for OpenSSL unexpected version
   ℹ  This PR was created on Thu, 25 Jul 2024 10:19:07 GMT
   ✔  Approvals: 7
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/54038#pullrequestreview-2199072126
   ✔  - Joyee Cheung (@joyeecheung) (TSC): https://github.com/nodejs/node/pull/54038#pullrequestreview-2199377802
   ✔  - Mohammed Keyvanzadeh (@VoltrexKeyva): https://github.com/nodejs/node/pull/54038#pullrequestreview-2199472184
   ✔  - Franziska Hinkelmann (@fhinkel): https://github.com/nodejs/node/pull/54038#pullrequestreview-2201735359
   ✔  - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/54038#pullrequestreview-2201952056
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/54038#pullrequestreview-2202033617
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/54038#pullrequestreview-2203222758
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-07-29T10:32:35Z: https://ci.nodejs.org/job/node-test-pull-request/60718/
- Querying data for job/node-test-pull-request/60718/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/10182407884

@joyeecheung joyeecheung added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jul 31, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 31, 2024
@nodejs-github-bot nodejs-github-bot merged commit 67bc6a4 into nodejs:main Jul 31, 2024
62 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 67bc6a4

targos pushed a commit that referenced this pull request Aug 14, 2024
PR-URL: #54038
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Aug 19, 2024
targos pushed a commit that referenced this pull request Sep 21, 2024
PR-URL: #54038
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants