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

selinux: allow read /proc/<pid>/cmdline #10339

Merged
merged 1 commit into from Jul 20, 2016
Merged

Conversation

tchaikov
Copy link
Contributor

we read /proc//cmdline to figure out who is terminating us.

Fixes: http://tracker.ceph.com/issues/16675
Signed-off-by: Kefu Chai kchai@redhat.com

we read /proc/<pid>/cmdline to figure out who is terminating us.

Fixes: http://tracker.ceph.com/issues/16675
Signed-off-by: Kefu Chai <kchai@redhat.com>
@b-ranto
Copy link
Contributor

b-ranto commented Jul 19, 2016

lgtm. I'm just wondering whether it wouldn't be safer to just read where the /proc//exe points to instead (i.e. readlink on /proc//exe)?

@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 19, 2016

@b-ranto i am posting a PR #10345, which needs to read /proc/<pid>/cmdline. if we want the cmdline instead of argv[0], maybe we do need to do so?

@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 19, 2016

i will hold this PR until someone nah or yah #10345 or timeout =).

@b-ranto
Copy link
Contributor

b-ranto commented Jul 19, 2016

Hmm, now that I think about it -- those bits won't work if the daemons are killed by root? The ceph user can't read /proc/<pid>/ of a process owned by root.

@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 19, 2016

in that case, we will fail when trying to open /proc/<pid>/cmdline, and <unknown> will be printed instead in the log.

@b-ranto
Copy link
Contributor

b-ranto commented Jul 19, 2016

ah, ok, makes sense.

@ktdreyer
Copy link
Member

@tchaikov when you say "we" read cmdline, does that "we" mean "teuthology's code" or "ceph's code" ?

@ktdreyer
Copy link
Member

Whoops, I read #8964 and it's clearer now that it is Ceph itself doing this. Thanks :)

@tchaikov tchaikov merged commit 28819d3 into ceph:master Jul 20, 2016
@tchaikov tchaikov deleted the wip-16675 branch July 20, 2016 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants