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

Uninitialized member of class FSReqWrapSync #56667

Open
wooffie opened this issue Jan 20, 2025 · 1 comment
Open

Uninitialized member of class FSReqWrapSync #56667

wooffie opened this issue Jan 20, 2025 · 1 comment

Comments

@wooffie
Copy link

wooffie commented Jan 20, 2025

Version

20.18.0

Platform

any

Subsystem

src/node_file

What steps will reproduce the bug?

Constructor of FSReqWrapSync don't init uv_fs_t req field. It may cause reading uninitiated pointers in this struct.

https://github.com/nodejs/node/blob/da5f7aca6ac1fac2b7840dc11c0ef8e740cfc414/src/node_file.h#L460C1-L463C58

How often does it reproduce? Is there a required condition?

Construct FSReqWrapSync -> Destruct FSReqWrapSync

Destructor calls uv_fs_req_cleanup, that has NULL checks, but its passed, cause pointers are uninitiated

What is the expected behavior? Why is that the expected behavior?

In constructor assign field req as nullptr

What do you see instead?

Uninit field of object

Additional information

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reporter: Burkov Egor (eburkov@rvision.ru).

Organization: R-Vision (support@rvision.ru).

@theanarkh
Copy link
Contributor

uv_fs_xxx will init the uv_fs_t struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants