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

Segmentation fault with djxl #781

Closed
PeterHorvath10 opened this issue Oct 27, 2021 · 0 comments · Fixed by #782
Closed

Segmentation fault with djxl #781

PeterHorvath10 opened this issue Oct 27, 2021 · 0 comments · Fixed by #782

Comments

@PeterHorvath10
Copy link

PeterHorvath10 commented Oct 27, 2021

Describe the bug
Hi, this 8 byte input file (found by fuzzing)
SIGSEGV.PC.555555573116.STACK.140516608b.CODE.128.ADDR.0.INSTR.movslq_0x8(%rdx),%rdi.fuzz.verified.txt causes a segmentation fault when trying to decode with djxl.

To Reproduce
command to reproduce the issue:
djxl 'SIGSEGV.PC.555555573116.STACK.140516608b.CODE.128.ADDR.0.INSTR.movslq_0x8(%rdx),%rdi.fuzz.verified.txt' --allow_partial_files --allow_more_progressive_steps

Expected behavior
The decoder should produce an error message without segmentation fault.

Screenshots
ASAN outputs for different djxl versions:
Capture
Capture

Environment

  • OS: Ubuntu 20.04
  • Compiler version: clang 10.0.0
  • CPU type: x86_64
  • cjxl/djxl version string: djxl [v0.7.0 35ca355 asan [AVX3,AVX2,SSE4,Scalar]]
  • cjxl/djxl version string: djxl [v0.7.0 835aa02 asan [AVX3,AVX2,SSE4,Scalar]]

Additional context
The file was found using fuzzing (honggfuzz).

deymo added a commit to deymo/libjxl that referenced this issue Oct 27, 2021
`djxl` tool has a flag `--allow_partial_files` that allows decoding
partial files. When a partial file with no frames, or at least no
frames that should be displayed is passed the program would access
members of `back()` pointer on an empty std::vector, causing a segfault.

Fixes libjxl#781.
deymo added a commit that referenced this issue Oct 27, 2021
`djxl` tool has a flag `--allow_partial_files` that allows decoding
partial files. When a partial file with no frames, or at least no
frames that should be displayed is passed the program would access
members of `back()` pointer on an empty std::vector, causing a segfault.

Fixes #781.
deymo added a commit to deymo/libjxl that referenced this issue Oct 27, 2021
`djxl` tool has a flag `--allow_partial_files` that allows decoding
partial files. When a partial file with no frames, or at least no
frames that should be displayed is passed the program would access
members of `back()` pointer on an empty std::vector, causing a segfault.

Fixes libjxl#781.
(cherry picked from commit 6378502)
(cherry picked from PR libjxl#782)
deymo added a commit that referenced this issue Oct 27, 2021
`djxl` tool has a flag `--allow_partial_files` that allows decoding
partial files. When a partial file with no frames, or at least no
frames that should be displayed is passed the program would access
members of `back()` pointer on an empty std::vector, causing a segfault.

Fixes #781.
(cherry picked from commit 6378502)
(cherry picked from PR #782)
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 a pull request may close this issue.

1 participant