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

Fix _ostree_ensure_fsverity reporting of supports in early exit #3244

Merged
merged 1 commit into from
May 15, 2024

Conversation

alexlarsson
Copy link
Member

If supported_out is passed to _ostree_ensure_fsverity and we successfully exit early, for example because the file is a symlink, then *supported_out is not initialized.

This is problematic in the case of ostree_sysroot_update_post_copy(), because it passes in an uninitialized supported, and on successfull return of _ostree_ensure_fsverity() it assumes that it is iniialized.

In case supported happened to be initialized to non-zero it will take this branch:

  if (!supported)
    break; /* If not supported, skip rest */

Which means all further objects will not get fs-verity enabled.

If supported_out is passed to _ostree_ensure_fsverity and we
successfully exit early, for example because the file is a symlink, then
*supported_out is not initialized.

This is problematic in the case of ostree_sysroot_update_post_copy(),
because it passes in an uninitialized supported, and on successfull
return of _ostree_ensure_fsverity() it assumes that it is iniialized.

In case supported happened to be initialized to non-zero it will take
this branch:

      if (!supported)
        break; /* If not supported, skip rest */

Which means *all* further objects will not get fs-verity enabled.
@cgwalters
Copy link
Member

Ug, another one rust would have caught.

This looks sane to me.

@alexlarsson
Copy link
Member Author

I tested the problematic automotive issues against this, and it fixed it.

@jmarrero jmarrero enabled auto-merge May 15, 2024 16:25
@jmarrero jmarrero merged commit 664116f into ostreedev:main May 15, 2024
25 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.

None yet

3 participants