The vulnerability CVE-2024-22017 occurs because libuv's io_uring operations do not respect privilege changes from setuid() if io_uring was initialized before the setuid() call. The libuv commit c8c9a1a9024b1b8d8ed693920570984176a5049f fixes this by modifying uv__io_uring_submit to check for EUID/EGID changes and re-initialize io_uring if necessary. Therefore, the unpatched uv__io_uring_submit is the primary vulnerable function as it executes I/O operations with stale, elevated privileges. uv_loop_init is also relevant as it's involved in the initial setup of the io_uring context that retains these privileges. The Node.js process would call process.setuid(), and subsequent I/O operations (like file system access) managed by libuv could then exploit this vulnerability if io_uring was active and initialized pre-setuid.