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

make setproctitle()'s /proc/pid/stat parsing safe #4299

Merged
merged 1 commit into from Apr 11, 2023

Conversation

tych0
Copy link
Member

@tych0 tych0 commented Apr 10, 2023

it turns out that our parsing of /proc/pid/stat was not safe in general (though probably safe for lxc, since our executable names do not contain spaces).

Let's fix this by looking backwards through the file for ), and then continuing on from there.

This was reported to me by Solar Designer, who pointed me to this thread: https://twitter.com/solardiz/status/1634204168545001473

Indeed, this is a lot of tap dancing to work around the kernel's 16 character executable limit. Perhaps I'll send a kernel patch to raise that limit next.

@lxc-jenkins
Copy link

Testsuite passed

it turns out that our parsing of /proc/pid/stat was not safe in general
(though probably safe for lxc, since our executable names do not contain
spaces).

Let's fix this by looking backwards through the file for ), and then
continuing on from there.

This was reported to me by Solar Designer, who pointed me to this thread:
https://twitter.com/solardiz/status/1634204168545001473

Indeed, this is a lot of tap dancing to work around the kernel's 16
character executable limit. Perhaps I'll send a kernel patch to raise that
limit next.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
@lxc-jenkins
Copy link

Testsuite passed

@brauner brauner merged commit e2d10d6 into lxc:master Apr 11, 2023
11 checks passed
fengjixuchui added a commit to fengjixuchui/lxc that referenced this pull request Apr 11, 2023
Merge pull request lxc#4299 from tych0/make-setproctitle-safe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants