Skip to content

tentacle: rgw: Check if HTTP_X_AMZ_COPY_SOURCE header is empty#66027

Open
cbodley wants to merge 1 commit intoceph:tentaclefrom
cbodley:wip-73607-tentacle
Open

tentacle: rgw: Check if HTTP_X_AMZ_COPY_SOURCE header is empty#66027
cbodley wants to merge 1 commit intoceph:tentaclefrom
cbodley:wip-73607-tentacle

Conversation

@cbodley
Copy link
Copy Markdown
Contributor

@cbodley cbodley commented Oct 22, 2025

backport tracker: https://tracker.ceph.com/issues/73607


backport of #65159
parent tracker: https://tracker.ceph.com/issues/72669

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

The issue was that the `HTTP_X_AMZ_COPY_SOURCE` header could be present but empty (i.e., an empty string rather than NULL). The  code only checked if the pointer was not NULL, but didn't verify that the string had content. When an empty string was passed to RGWCopyObj::parse_copy_location(), it would eventually try to access name_str[0] on an empty string, causing a crash.

Fixes: https://tracker.ceph.com/issues/72669

Signed-off-by: Suyash Dongre <suyashd999@gmail.com>
(cherry picked from commit bef59f1)
@cbodley cbodley requested a review from a team as a code owner October 22, 2025 12:48
@cbodley cbodley added this to the tentacle milestone Oct 22, 2025
@cbodley cbodley added the rgw label Oct 22, 2025
@mrwormhole
Copy link
Copy Markdown

I have a question around this? name_str could be full of whitespaces eg. " " during empty() check? any possibility to do boost::trim() before empty() check?

@adamemerson
Copy link
Copy Markdown
Contributor

Removing needs-qa until we have notifiaction/multisite fixes backported to tentacle.

@adamemerson
Copy link
Copy Markdown
Contributor

jenkins test make check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants