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

net: Fix TOCTOU race condition in unix_conf_op #2413

Merged
merged 1 commit into from
May 28, 2024

Conversation

avagin
Copy link
Member

@avagin avagin commented May 25, 2024

The unix_conf_op function reads the size of the sysctl entry array twice. gcc thinks that it can lead to a time-of-check to time-of-use (TOCTOU) race condition if the array size changes between the two reads.

Fixes #2398

@avagin avagin requested a review from rst0git May 25, 2024 05:18
@rst0git
Copy link
Member

rst0git commented May 26, 2024

@avagin Would you be able to add a "Signed-off-by" line in the commit message?

The unix_conf_op function reads the size of the sysctl entry array
twice. gcc thinks that it can lead to a time-of-check to time-of-use
(TOCTOU) race condition if the array size changes between the two reads.

Fixes checkpoint-restore#2398

Signed-off-by: Andrei Vagin <avagin@gmail.com>
@avagin
Copy link
Member Author

avagin commented May 28, 2024

@avagin Would you be able to add a "Signed-off-by" line in the commit message?

Done. Thanks.

Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rst0git rst0git merged commit b384afa into checkpoint-restore:criu-dev May 28, 2024
33 of 39 checks passed
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

Successfully merging this pull request may close these issues.

gcc format-truncation warnings on Ubuntu 24.04
2 participants