Age | Commit message (Collapse) | Author |
|
Notable changes:
crypto:
* (SEMVER-MINOR) make FIPS related options always awailable (Vít Ondruch) https://github.com/nodejs/node/pull/36341
errors:
* (SEMVER-MINOR) remove experimental from --enable-source-maps (Benjamin Coe) https://github.com/nodejs/node/pull/37362
PR-URL: https://github.com/nodejs/node/pull/37569
|
|
PR-URL: https://github.com/nodejs/node/pull/37463
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
When a Worker is terminated, its own handle and the public
`MessagePort` are `.ref()`’ed, so that all relevant events,
including the `'exit'` events, end up being received.
However, this is problematic if messages end up being queued
from the Worker between the beginning of the `.terminate()` call
and its completion, and there are no `'message'` event handlers
present at that time. In that situation, currently the messages
would not end up being processed, and since the MessagePort
is still `.ref()`’ed, it would keep the event loop alive
indefinitely.
To fix this:
- Make sure that all messages end up being received by
`drainMessagePort()`, including cases in which the port had
been stopped (i.e. there are no `'message'` listeners) and
cases in which we exceed the limit for messages being processed
in one batch.
- Unref the Worker’s internal ports manually after the Worker
has exited.
Either of these solutions should be solving this on its own,
but I think it makes sense to make sure that both of them
happen during cleanup.
PR-URL: https://github.com/nodejs/node/pull/37319
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
There is no reason to hide FIPS functionality behind build flags.
OpenSSL always provide the information about FIPS availability via
`FIPS_mode()` function.
This makes the user experience more consistent, because the OpenSSL
library is always queried and the `crypto.getFips()` always returns
OpenSSL settings.
Fixes #34903
PR-URL: https://github.com/nodejs/node/pull/36341
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
|
|
Fixes: https://github.com/nodejs/node/issues/37442
PR-URL: https://github.com/nodejs/node/pull/37443
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
|
|
Signed-off-by: Dan Čermák <dcermak@suse.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/37096
Fixes: https://github.com/nodejs/node/issues/29342
Fixes: https://github.com/nodejs/node/issues/29342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
A comment was written before the last line, hiding a check.
PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
The following warnings are disabled:
- C4065 in node_revert.h: there are no security reversions on the master
branch.
- C4003 in base64-inl.h: a macro is used four times, only once without
parameters.
PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
This fixes more C4244 MSVC warnings in the code base.
Refs: https://github.com/nodejs/node/pull/37149
PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/36943
Fixes: https://github.com/nodejs/node/issues/35930
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/36943
Fixes: https://github.com/nodejs/node/issues/35930
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
This patch adds the SnapshotableObject interface. Native objects
supporting serialization can inherit from it, implementing
PrepareForSerialization(), Serialize() and Deserialize()
to control how the native states should be serialized and
deserialized.
See doc: https://docs.google.com/document/d/15bu038I36oILq5t4Qju1sS2nKudVB6NSGWz00oD48Q8/edit
PR-URL: https://github.com/nodejs/node/pull/36943
Fixes: https://github.com/nodejs/node/issues/35930
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
The finalizer normally never gets called while a reference is strong.
However, during environment shutdown all finalizers must get called. In
order to unify the deferring behavior with that of a regular
finalization, we must force the reference to be weak when we call its
finalizer during environment shutdown.
Fixes: https://github.com/nodejs/node/issues/37236
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/37303
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37187
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37297
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
PR-URL: https://github.com/nodejs-private/node-private/pull/253
|
|
This is a security release.
Notable changes:
Vulnerabilities fixed:
- **CVE-2021-22883**: HTTP2 'unknownProtocol' cause Denial of Service by
resource exhaustion
- **CVE-2021-22884**: DNS rebinding in --inspect
- **CVE-2021-23840**: OpenSSL - Integer overflow in CipherUpdate
PR-URL: https://github.com/nodejs-private/node-private/pull/253
|
|
CVE-ID: CVE-2021-22884
Refs: https://hackerone.com/bugs?report_id=1069487
PR-URL: https://github.com/nodejs-private/node-private/pull/244
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37406
|
|
PR-URL: https://github.com/nodejs/node/pull/37406
Notable Changes:
* crypto:
* add keyObject.export() jwk format option (Filip Skokan) https://github.com/nodejs/node/pull/37081
* deps:
* upgrade to libuv 1.41.0 (Colin Ihrig) https://github.com/nodejs/node/pull/37360
* doc:
* add dmabupt to collaborators (Xu Meng) https://github.com/nodejs/node/pull/37377
* refactor fs docs structure (James M Snell) https://github.com/nodejs/node/pull/37170
* fs:
* add fsPromises.watch() (James M Snell) https://github.com/nodejs/node/pull/37179
* use a default callback for fs.close() (James M Snell) https://github.com/nodejs/node/pull/37174
* add AbortSignal support to watch (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/37190
* perf_hooks:
* introduce createHistogram (James M Snell) https://github.com/nodejs/node/pull/37155
* stream:
* improve Readable.from error handling (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/37158
* timers:
* introduce setInterval async iterator (linkgoron) https://github.com/nodejs/node/pull/37153
* tls:
* add ability to get cert/peer cert as X509Certificate object (James M Snell) https://github.com/nodejs/node/pull/37070
|
|
Adds a new `perf_hooks.createHistogram()` API for creating histogram
instances that allow user recording.
Makes Histogram instances cloneable via MessagePort. This allows, for
instance, an event loop delay monitor to be running on the main thread
while the histogram data can be monitored actively from a worker thread.
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/37155
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
|
|
This commit now executes `process.on('unhandledRejection')` in the
async execution context of the concerned `Promise`.
PR-URL: https://github.com/nodejs/node/pull/37281
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
|
|
top level await
Top level await expects that all module script evaluation returns a
Promise. As such, update
ModuleWrap::SyntheticModuleEvaluationStepsCallback to return a
resolved Promise now that V8 has enabled top-level await by default.
Unfortunately I don't have a spec reference that I can point to here
because the Built-in modules proposal isn't yet updated for
top level await.
The corresponding change for Blink is
https://chromium-review.googlesource.com/c/chromium/src/+/2568823.
This will allow a workaround for Node in this V8 bugfix to be removed:
https://chromium-review.googlesource.com/c/v8/v8/+/2673794.
Fixes: https://github.com/nodejs/node/issues/37299
PR-URL: https://github.com/nodejs/node/pull/37300
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
|
|
`Vector::forward()` is supposed to return a `bool`.
PR-URL: https://github.com/nodejs/node/pull/37167
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
Unlike JS-only modules, native add-ons are always associated with a
dynamic shared object from which they are loaded. Being able to
retrieve its absolute path is important to native-only add-ons, i.e.
add-ons that are not themselves being loaded from a JS-only module
located in the same package as the native add-on itself.
Currently, the file name is obtained at environment construction time
from the JS `module.filename`. Nevertheless, the presence of `module`
is not required, because the file name could also be passed in via a
private property added onto `exports` from the `process.dlopen`
binding.
As an attempt at future-proofing, the file name is provided as a URL,
i.e. prefixed with the `file://` protocol.
Fixes: https://github.com/nodejs/node-addon-api/issues/449
PR-URL: https://github.com/nodejs/node/pull/37195
Co-authored-by: Michael Dawson <mdawson@devrus.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
|
|
This commit introduces a mutex field on the ManagedEVPPKey class
intended to be used when multiple threads require access to an OpenSSL
EVP_PKEY object. The motivation for this came from the work being done
to upgrade Node.js to OpenSSL 3.0.
OpenSSL objects, like EVP_PKEY, are not thread safe (see refs for
details). In versions prior to OpenSSL 3.0 this was not noticeable and
did not cause any issues (like incorrect logic or crashes), but with
OpenSSL 3.0 this does cause issues if access to an EVP_PKEY instance is
required from multiple threads without locking.
In OpenSSL 3.0 when the evp_pkey_downgrade function is called, which
downgrades an EVP_PKEY instance to a legacy version, it will clear all
the fields of EVP_PKEY struct except the lock (#13374). But this also
means that keymgmt and keydata will also be cleared, which other parts
of the code base depends on, and those calls will either fail to export
the key (returning null) or crash due to a segment fault.
This same code works with OpenSSL 1.1.1 without locking and I think this
is because there is no downgrade being done in OpenSSL 1.1.1. But even
so, as far as I can tell there are no guarantees that these object are
thread safe in 1.1.1 either and should be protected with a lock.
PR-URL: https://github.com/nodejs/node/pull/36825
Refs: https://github.com/openssl/openssl/pull/13374
Refs: https://github.com/openssl/openssl/pull/13374
Refs: https://github.com/openssl/openssl/issues/2165)
Refs: https://www.openssl.org/blog/blog/2017/02/21/threads
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37212
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
1. Put the v8 binding data class into a header so we can reuse
the class definition during deserialization.
2. Put the v8 binding code into node::v8_utils namespace for
clarity.
3. Move the binding data property initialization into its
constructor so that we can reuse it during deserialization
4. Reorder the v8 binding initialization so that we don't
unnecessarily initialize the properties in a loop
PR-URL: https://github.com/nodejs/node/pull/37112
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.
PR-URL: https://github.com/nodejs/node/pull/37112
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
This fixes a bunch of C4244 ('conversion' conversion from 'type1' to
'type2', possible loss of data) MSVC warnings in the code base.
PR-URL: https://github.com/nodejs/node/pull/37149
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
Add more context around the TODO change required for achieving the
task. When destructuring the isolate and environment_vars from the
environment object, it is leading to recursive dependency and thus not
able to refactor it in a better way.
PR-URL: https://github.com/nodejs/node/pull/37140
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.
PR-URL: https://github.com/nodejs/node/pull/37139
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
"DSA" is not a registered JWK key type.
https://www.iana.org/assignments/jose/jose.xhtml#web-key-types
PR-URL: https://github.com/nodejs/node/pull/37203
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
|
|
So that it's easier to find the corresponding code.
PR-URL: https://github.com/nodejs/node/pull/37114
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
This patch
1. Refactors the bootstrap routine of the main instance so that
when --no-node-snapshot is used,
Environment::InitializeMainContext() will only be called once
(previously it would be called twice, which was harmless for now
but not ideal).
2. Mark the number of BaseObjects in RunBootstrapping() when creating
the Environment from scratch and in InitializeMainContext() when
the Environment is deserialized. Previously the marking was done in
the Environment constructor and InitializeMainContext() respectively
for the cctest which was incorrect because the cctest never uses
an Environment that's not bootstrapped. Also renames the mark
to base_object_created_after_bootstrap to reflect what it's
intended for.
PR-URL: https://github.com/nodejs/node/pull/37113
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
Fixes: https://github.com/nodejs/node/issues/37145
PR-URL: https://github.com/nodejs/node/pull/37146
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
|
|
PR-URL: https://github.com/nodejs/node/pull/37169
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/37070
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
|
|
There was an unexpected and hard-to-spot issue here:
the /sys/kernel/mm/transparent_hugepage/enabled file contains three
entries, and the std::ifstream reader was reading two values on each
loop iteration, resulting in incorrect behaviour.
Fixes: https://github.com/nodejs/node/issues/37064
PR-URL: https://github.com/nodejs/node/pull/37065
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37183
|
|
Notable changes:
crypto:
* (SEMVER-MINOR) add generatePrime/checkPrime (James M Snell) https://github.com/nodejs/node/pull/36997
* (SEMVER-MINOR) experimental (Ed/X)25519/(Ed/X)448 support (James M Snell) https://github.com/nodejs/node/pull/36879
deps:
* upgrade npm to 7.5.0 (Ruy Adorno) https://github.com/nodejs/node/pull/37117
dgram:
* (SEMVER-MINOR) support AbortSignal in createSocket (Nitzan Uziely) https://github.com/nodejs/node/pull/37026
doc:
* add Zijian Liu to collaborators (ZiJian Liu) https://github.com/nodejs/node/pull/37075
esm:
* deprecate legacy main lookup for modules (Guy Bedford) https://github.com/nodejs/node/pull/36918
readline:
* (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33662
* (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33676
PR-URL: https://github.com/nodejs/node/pull/37183
|
|
So that the debugger does not have to hard-code the number of
internal fields of BaseObjects.
PR-URL: https://github.com/nodejs/node/pull/37111
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37083
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
|
|
PR-URL: https://github.com/nodejs/node/pull/37056
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
|
|
Fixes https://github.com/nodejs/node/issues/37055
PR-URL: https://github.com/nodejs/node/pull/37063
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
|
|
Fixes: https://github.com/nodejs/node/issues/37030
PR-URL: https://github.com/nodejs/node/pull/37052
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
|
|
APIs for generating and checking pseudo-random primes
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/36997
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
|
|
PR-URL: https://github.com/nodejs/node/pull/37048
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
|
|
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/36989
Refs: https://github.com/nodejs/node/pull/36652
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
|