Repository navigation
rgw: stop crashing when an admin tries to assume a nonexistent role - #67863
Conversation
An admin user sending an AssumeRole request for a role that doesn't exist would crash rgw. The permission check failed but got overridden because the caller was an admin, and the code that ran next blindly assumed the role had already been loaded. Fixed by loading the role directly instead of hoping it was done earlier. Signed-off-by: Matthew N. Heler <[email protected]>
| auto [ret, r] = getRoleInfo(dpp, req.getRoleARN(), y); | ||
| if (ret < 0) { | ||
| response.retCode = ret; |
There was a problem hiding this comment.
it's unfortunate that we have to load the role twice, but the second should at least be served by the metadata cache
when fixing this issue elsewhere, the strategy was to move the fallible parts into a RGWOp::init_processing() override which can return errors before the call to verify_permission(). #50648 shows one example of this
i had looked into this for AssumeRole in the past, but the fact that sts has its own Request/Response abstractions separate from RGWOp makes it hard to do
|
FYI, pr testing is in progress... |
Pr testing completed and approved by @ivancich, More details in : https://tracker.ceph.com/issues/76011. |
An admin user sending an AssumeRole request for a role that doesn't exist would crash rgw. The permission check failed but got overridden because the caller was an admin, and the code that ran next blindly assumed the role had already been loaded. Fixed by loading the role directly instead of hoping it was done earlier.
To reproduce:
Fixes: https://tracker.ceph.com/issues/75569
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.