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

Potential Crash Risk in libiscsi Synchronous Operations #436

Open
raywang-dev opened this issue Dec 25, 2024 · 0 comments
Open

Potential Crash Risk in libiscsi Synchronous Operations #436

raywang-dev opened this issue Dec 25, 2024 · 0 comments

Comments

@raywang-dev
Copy link
Contributor

The commit 75a46d2 introduced a timeout mechanism for event_loop, but this patch can lead to stack corruption caused by leftover PDUs when exiting due to a timeout (refer to: PR #434).

Although a fix was provided in this commit, it overlooked a specific scenario: if a reconnection is triggered during event_loop and succeeds, the PDUs from the old_iscsi instance may be reallocated. This resets the scsi_timeout for those PDUs, potentially causing their timeout to exceed the timeout of the event_loop. Consequently, when the event_loop times out and exits, invoking iscsi_timeout_scan may still leave residual PDUs, thus reintroducing the issue described in PR #434.

Currently, I don't have a robust solution for this issue. A straightforward but heavy-handed approach would be to cancel all PDUs when event_loop times out. However, this could interfere with some internally generated asynchronous PDUs in libiscsi, such as login PDUs.

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

1 participant