News for hackers. Stuff that matters.
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by emmelaich on Wednesday December 05, 2018 @04:38AM (#18606858)
You'd have to be a privileged user to create such high uid user.

And it's very unlikely to happen by accident, right? So can't get too excited about this.

Bit of trivia - one some older Unixes (HP-UX) the uid -1 was special - was always unprivileged 'nobody' and was equal to 65535.

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by mschuster91 on Wednesday December 05, 2018 @05:59AM (#18607233)
> You'd have to be a privileged user to create such high uid user.

Or use a broken / misconfigured AD/LDAP to sync uid/gid across a pool of machines.

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by userbinator on Wednesday December 05, 2018 @07:40AM (#18607690)
...which implies already having high privileges. (How do users with such high UIDs come into existence?)
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by jaxtellerSoA on Wednesday December 05, 2018 @08:46AM (#18608093)
>which implies already having high privileges. (How do users with such high UIDs come into existence?)

I am not so sure about that. I work at a smallish, place and by default my AD account has UID of 945004649. Still under the INT_MAX but not that far off. Our domain controller is running Windows 2012 R2, and nothing was changed or touched regarding UID's, everything was left at the default. We just create users and get whatever UID AD assigns.

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by LinuxBender on Thursday December 06, 2018 @10:54AM (#18619044)
This could happen anywhere. If you know that dynamically created users are in range {x} and AD/LDAP users are in range {y}, then a good sysadmin would choose a very high range for batch creations of specific types of accounts. This is fairly common practice. Modern Linux and Windows can support millions of UID's, so it is perfectly reasonable to say, "We are going to use range {y} for this project then nuke that entire range when we are done".
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by pixl97 on Wednesday December 05, 2018 @02:03PM (#18611355)
Active directory integration into Linux. Default numbers in the config files are very large.
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by jabl on Wednesday December 05, 2018 @09:12AM (#18608293)
Others pointed out that nobody was (uint16_t) -2, or 65534.

But, it turns out this value is, in fact, special in current day Linux as well. It's the default value of the special 'overflow' uid, can be seen/set at /proc/sys/fs/overflowuid.

Apart from some legacy stuff using 16-bit uid's, today it's mostly used for two things

1) In NFS, if mapping a user fails, then it gets assigned the overflowuid.

2) In containers with user namespaces, unmapped users again get the overflowuid.

For more details, see https://lwn.net/Articles/695478/

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by emmelaich on Thursday December 06, 2018 @12:11AM (#18615602)
Very interesting, thanks.
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by JdeBP on Wednesday December 05, 2018 @05:31AM (#18607093)
Incorrect; nobody was 65534.
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by emmelaich on Wednesday December 05, 2018 @05:42AM (#18607147)
D'oh! I knew I'd get it wrong.

Thanks for the correction.

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by kijin on Wednesday December 05, 2018 @05:33AM (#18607098)
Was the special treatment of -1 intended by the developers, or did somebody mix up signed -1 with unsigned 65535?
Re:PolicyKit: Users with UID greater than INT_MAX can execut... by jabl on Wednesday December 05, 2018 @09:17AM (#18608329)
In POSIX, many functions return -1 to indicate errors. So I guess the value (uid_t) -1 was reserved to avoid confusion. Also some functions (chown()) allow specifying (uid_t) -1 or (gid_) -1 to mark an omitted argument.

See https://en.wikipedia.org/wiki/User_identifier#Special_values

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by emmelaich on Wednesday December 05, 2018 @06:03AM (#18607247)
See above - it was -2 or 65534.

I think -2 is just easier to type and stands out more.

Re:PolicyKit: Users with UID greater than INT_MAX can execut... by JdeBP on Wednesday December 05, 2018 @09:57AM (#18608699)