Skip to content

quincy: rgw: Add missing empty checks to the split string in is_string_in_set(). - #56348

Merged
cbodley merged 1 commit into
ceph:quincyfrom
cbodley:wip-65002-quincy
Apr 23, 2024
Merged

cbodley merged 1 commit into
ceph:quincyfrom
cbodley:wip-65002-quincy

Conversation

@cbodley

@cbodley cbodley commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

In certain cases, where a user misconfigures a CORS rule, the entirety
of the string can be token characters (or, at least, the string before
and after a given token is all token characters), but != "*". If the
misconfigured string includes "*" we'll try to split the string and we
assume that we can pop the list of string elements when "*" isn't
first/last, but get_str_list() won't return anything for token-only
substrings and thus 'ssplit' will have fewer elements than would be
expected for a correct rule. In the case of an empty list, front() has
undefined behaviour; in our experience, it often results in a huge
allocation attempt because the code tries to copy the string into a
local variable 'sl'.

An example of this misconfiguration (and thus a reproduction case) is
configuring an origin of " *".

Signed-off-by: Matt Benjamin <[email protected]>
(cherry picked from commit 64803e1)
@cbodley cbodley added this to the quincy milestone Mar 20, 2024
@guits

guits commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

jenkins test api

@guits

guits commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

jenkins test make check

@guits

guits commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

jenkins test docs

@yuriw

yuriw commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

@yuriw

yuriw commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

@yuriw yuriw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-by: Casey Bodley [email protected]

@yuriw

yuriw commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

jenkins test windows

@yuriw

yuriw commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

@cbodley

cbodley commented Apr 23, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@yuriw

yuriw commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

yuriw added a commit to yuriw/ceph that referenced this pull request Apr 23, 2024
* refs/pull/56348/head:
	rgw: Add missing empty checks to the split string in is_string_in_set().
@cbodley cbodley removed the needs-qa label Apr 23, 2024
@cbodley
cbodley merged commit ae65ee8 into ceph:quincy Apr 23, 2024
@cbodley
cbodley deleted the wip-65002-quincy branch April 23, 2024 16:21
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.

4 participants