Skip to content

Conversation

halaney
Copy link
Contributor

@halaney halaney commented Jul 22, 2025

The following can be seen when doing a Process::Status():

strconv.ParseInt: parsing "2976972800": value out of range

We're treating the uid/gid fields as if they're int32's when parsing, but they're uint32's. A large enough uid/gid can kick us over the edge.

Handle it as a uint32 and add a test around it.

This is similar to what
aace5e9 ("Groups in /proc/PID/status has type uint32.") did for Groups.

The following can be seen when doing a Process::Status():

    strconv.ParseInt: parsing "2976972800": value out of range

We're treating the uid/gid fields as if they're int32's when parsing,
but they're uint32's. A large enough uid/gid can kick us over the edge.

Handle it as a uint32 and add a test around it.

This is similar to what
aace5e9 ("Groups in /proc/PID/status has type uint32.") did for Groups.

Signed-off-by: Andrew Halaney <ahalaney@netflix.com>
Copy link
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

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

Good catch! Indeed, those should be uint32.

@shirou shirou merged commit 2079fce into shirou:master Jul 26, 2025
50 checks passed
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.

2 participants