Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

some uid's in /proc/pid/loginuid are strange

Tags:

linux

unix

procfs

i'm analysing the procfs in unix/linux and some loginuid of processes are really strange. Some pid's have as loginuid a big number: 4294967295. Are they daemons or system events or whats the matter?

# cat /proc/11071/loginuid
4294967295
like image 933
Oni1 Avatar asked Apr 07 '14 13:04

Oni1


People also ask

Which filesystem is the proc directory mounted to?

The proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures. It is commonly mounted at /proc.

What is the proc filesystem in Linux?

Proc file system (procfs) is virtual file system created on fly when system boots and is dissolved at time of system shut down. It contains useful information about the processes that are currently running, it is regarded as control and information center for kernel.

What is proc stat?

The /proc/stat file holds various pieces of information about the kernel activity and is available on every Linux system.

What is proc self exe?

Function proc_self::exe[−][src]Returns a File of the currently running executable. Akin to fd::File::open("/proc/self/exe") on Linux.


2 Answers

4294967295 is just (unsigned long) -1. -1 means that loginuid was not set. This is normal behavior for processes that were not spawned by any login process (e.g. for daemons). loginuid is -1 by default; pam_loginuid module changes it to your user id whenever you login (in a tty/in DM/via ssh), and this value is preserved by child processes.

like image 53
tiandrey Avatar answered Oct 13 '22 00:10

tiandrey


I am gravedigging, but I stumped on this and I have infos to share.

  1. kernel support

loginuid support required the kernel compiled with CONFIG_AUDITSYSCALL

To check:

zgrep CONFIG_AUDITSYSCALL /boot/config* /proc/config.gz

  1. kernel bugs

At the moment, I can check on two centos hosts. Both of them have 64 bit kernels compiled with CONFIG_AUDITSYSCALL=y

I am logged as a normal user in bash.

centos 5.11, kernel 2.6.18-419.el5

cat /proc/$$/loginuid

4294967295

centos 6.10, kernel 2.6.32-754.28.1.el6

cat /proc/$$/loginuid

503

like image 37
Massimo Avatar answered Oct 13 '22 00:10

Massimo