Skip to content

pacific: ceph-crash: drop privleges to run as "ceph" user, rather than root (CVE-2022-3650)#48804

Merged
yuriw merged 6 commits intoceph:pacificfrom
tserong:wip-57996-pacific
Feb 16, 2023
Merged

pacific: ceph-crash: drop privleges to run as "ceph" user, rather than root (CVE-2022-3650)#48804
yuriw merged 6 commits intoceph:pacificfrom
tserong:wip-57996-pacific

Conversation

@tserong
Copy link
Member

@tserong tserong commented Nov 9, 2022

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


backport of #48713
parent tracker: https://tracker.ceph.com/issues/57967

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

guits added 2 commits November 9, 2022 13:57
This reverts commit 432c766.

unused but required:

```
Traceback (most recent call last):
File "/usr/bin/ceph-crash", line 102, in <module>
main()
File "/usr/bin/ceph-crash", line 98, in main
time.sleep(args.delay * 60)
TypeError: handler() takes exactly 1 argument (2 given)
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 02e8e7d)
ceph-crash.in:21:1: E302 expected 2 blank lines, found 1
ceph-crash.in:32:80: E501 line too long (86 > 79 characters)
ceph-crash.in:82:1: E302 expected 2 blank lines, found 1
ceph-crash.in:86:1: E302 expected 2 blank lines, found 1

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 0aee769)
@tserong tserong added this to the pacific milestone Nov 9, 2022
@tserong tserong requested a review from dmick November 9, 2022 03:01
@tserong
Copy link
Member Author

tserong commented Nov 9, 2022

Additional trivial cleanup commits avoid cherry-pick conflicts

Popen.communicate() returns a tuple (stdout, stderr), and stderr
will be of type bytes, hence the need to decode it before checking
if it's an empty string or not.

Fixes: a77b47e
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 4591554)
If privileges cannot be dropped, log an error and exit.  This commit
also catches and logs exceptions when scraping the crash path, without
which ceph-crash would just exit if it encountered an error.

Fixes: CVE-2022-3650
Fixes: https://tracker.ceph.com/issues/57967
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 130c962)
@tserong
Copy link
Member Author

tserong commented Nov 9, 2022

jenkins test api

1 similar comment
@tserong
Copy link
Member Author

tserong commented Nov 10, 2022

jenkins test api

Copy link
Member

@ljflores ljflores left a comment

Choose a reason for hiding this comment

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

@ljflores ljflores added the DNM label Dec 6, 2022
Fixes: https://tracker.ceph.com/issues/58098
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 93c0456)
This is to aid in debugging in case crashes aren't posted as expected
(see https://tracker.ceph.com/issues/58098 for discussion).

Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit d139f6d)
@tserong tserong requested a review from a team as a code owner January 27, 2023 11:27
@tserong tserong requested a review from ljflores January 27, 2023 11:28
@yuriw yuriw merged commit 06dc7ab into ceph:pacific Feb 16, 2023
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.

5 participants