Skip to content

Commit 63bc405

Browse files
santigimenoruyadorno
authored andcommitted
src: remove uv__node_patch_is_using_io_uring
As now the `SQPOLL` ring used in the libuv io_uring implementation is disabled by default. Also modify `UvMightBeUsingIoUring()` to just handle the case where `Node.js` is dynamically linked to a `libuv` version which has the `SQPOLL` ring enabled. PR-URL: #55114 Refs: https://github.com/libuv/libuv/releases/tag/v1.49.0 Refs: https://github.com/libuv/libuv/releases/tag/v1.49.1 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 26861ea commit 63bc405

File tree

2 files changed

+5
-66
lines changed

2 files changed

+5
-66
lines changed

src/node_credentials.cc

+5-23
Original file line numberDiff line numberDiff line change
@@ -228,31 +228,13 @@ static gid_t gid_by_name(Isolate* isolate, Local<Value> value) {
228228
}
229229
}
230230

231-
#ifdef __linux__
232-
extern "C" {
233-
int uv__node_patch_is_using_io_uring(void);
234-
235-
int uv__node_patch_is_using_io_uring(void) __attribute__((weak));
236-
237-
typedef int (*is_using_io_uring_fn)(void);
238-
}
239-
#endif // __linux__
240-
241231
static bool UvMightBeUsingIoUring() {
242232
#ifdef __linux__
243-
// Support for io_uring is only included in libuv 1.45.0 and later, and only
244-
// on Linux (and Android, but there it is always disabled). The patch that we
245-
// apply to libuv to work around the io_uring security issue adds a function
246-
// that tells us whether io_uring is being used. If that function is not
247-
// present, we assume that we are dynamically linking against an unpatched
248-
// version.
249-
static std::atomic<is_using_io_uring_fn> check =
250-
uv__node_patch_is_using_io_uring;
251-
if (check == nullptr) {
252-
check = reinterpret_cast<is_using_io_uring_fn>(
253-
dlsym(RTLD_DEFAULT, "uv__node_patch_is_using_io_uring"));
254-
}
255-
return uv_version() >= 0x012d00u && (check == nullptr || (*check)());
233+
// Support for io_uring is only included in libuv 1.45.0 and later. Starting
234+
// with 1.49.0 is disabled by default. Check the version in case Node.js is
235+
// dynamically to an io_uring-enabled version of libuv.
236+
unsigned int version = uv_version();
237+
return version >= 0x012d00u && version < 0x013100u;
256238
#else
257239
return false;
258240
#endif

test/parallel/test-process-setuid-io-uring.js

-43
This file was deleted.

0 commit comments

Comments
 (0)