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

repo: NUL terminate readlinkat result #3281

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

cgwalters
Copy link
Member

Coverity was correctly complaining about this.

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters cgwalters enabled auto-merge July 29, 2024 19:43
@cgwalters
Copy link
Member Author

[2024-07-29T20:17:00.672Z] Jul 29 20:16:54 qemu0 kola-runext-itest-payload-link.sh[2604]: error: Writing content object: invalid data size for b8/2d4be21c54d26d7042b759c186b18e3e8e508d1ff43d9ee47e8fc6e9bef471.payload-link

Hmm...

Motivated by changing this code.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters force-pushed the fix-readlinkat-payload-link branch from 92b1c4d to 45af3fb Compare July 29, 2024 21:11
@github-actions github-actions bot added the area/prepare-root Issue relates to ostree-prepare-root label Jul 29, 2024
@cgwalters
Copy link
Member Author

Hah of course, I put the -1 inside the sizeof expression...

  • Fixed that
  • Added a unit test to more quickly debug payload-link issues in the future
  • Added the found/expected size to the error

Coverity was correctly complaining about this.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters force-pushed the fix-readlinkat-payload-link branch from 45af3fb to f08cea9 Compare July 29, 2024 21:14
@github-actions github-actions bot removed the area/prepare-root Issue relates to ostree-prepare-root label Jul 29, 2024
@jlebon
Copy link
Member

jlebon commented Aug 9, 2024

/test fcos-e2e

CI was failing on openshift/os#1551 which should be fixed now.

@cgwalters cgwalters merged commit 28c184f into ostreedev:main Aug 9, 2024
24 of 25 checks passed
@jmarrero
Copy link
Member

New hit with this patch:

1. Defect type: OVERRUN
16. libostree-2024.7/src/libostree/ostree-repo-commit.c:823:7: overrun-buffer-arg: Overrunning array "target_checksum" of 65 bytes by passing it to a function which accesses it at byte offset 258 using argument "size" (which evaluates to 259). [Note: The source code implementation of the function has been overridden by a builtin model.] 

@cgwalters
Copy link
Member Author

➡️ #3284

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.

4 participants