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

out_s3: fix NULL dereference when upload_id is unset #3841

Merged

Conversation

atheriel
Copy link
Contributor

When upload_id is not set in create_multipart_upload() (which can occur in some failure modes seen in #3838), subsequent retries will segfault when checking this ID in complete_multipart_upload().

This PR simply checks that the upload ID has been set and returns the usual error code instead of crashing if not. I don't have a way to reproduce the errors that could lead to this state, unfortunately.

Discussed in #3838.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

Documentation

  • [N/A] Documentation required for this feature

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@PettitWesley PettitWesley self-assigned this Jul 26, 2021
@atheriel atheriel force-pushed the fix-segfault-with-unset-upload-id branch from 2103743 to 4af07e4 Compare July 27, 2021 03:34
When upload_id is not set in create_multipart_upload() (which can occur
in some failure modes), subsequent retries will segfault when checking
this ID in complete_multipart_upload().

This commit simply checks that the upload ID has been set and returns
the usual error code instead of crashing if not. It also logs an error
message for the user.

Discussed in fluent#3838.

Signed-off-by: Aaron Jacobs <aaron.jacobs@crescendotechnology.com>
@atheriel atheriel force-pushed the fix-segfault-with-unset-upload-id branch from 4af07e4 to 398cd06 Compare July 27, 2021 03:36
@PettitWesley
Copy link
Contributor

@atheriel this looks good. Please:

  1. rebase (so that I can merge it, the rules are very strict here)
  2. submit a PR for the same commit against the 1.8 branch so we can get this out in the 1.8 series

@nokute78
Copy link
Collaborator

nokute78 commented Aug 3, 2021

@PettitWesley FYI.

rebase (so that I can merge it, the rules are very strict here)

The configuration was changed. We can merge PR without it.

@PettitWesley PettitWesley merged commit a2e1c47 into fluent:master Aug 4, 2021
@PettitWesley
Copy link
Contributor

@atheriel please also still submit the same commit against 1.8

@atheriel atheriel deleted the fix-segfault-with-unset-upload-id branch August 18, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants