suid 标识位,可执行程序文件以所有者的身份被执行
1039进程sh
root@generic:/system/bin # cat /proc/1039/status
cat /proc/1039/status
Name: sh
State: S (sleeping)
Tgid: 1039
Pid: 1039
PPid: 1033
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwxr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
shell 1042 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1042/status
cat /proc/1042/status
Name: test_while
State: R (running)
Tgid: 1042
Pid: 1042
PPid: 1039
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
4755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-xr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1073 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1073/status
cat /proc/1073/status
Name: test_while
State: R (running)
Tgid: 1073
Pid: 1073
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 2000 2000 2000
6755情况
root@generic:/system/bin # ls -all | grep test_while
ls -all | grep test_while
-rwsr-sr-x root root 109420 2015-06-23 22:37 test_while
root@generic:/system/bin # ps | grep test_while
ps | grep test_while
root 1085 1039 272 68 00000000 0000823c R ./test_while
root@generic:/system/bin # cat /proc/1085/status
cat /proc/1085/status
Name: test_while
State: R (running)
Tgid: 1085
Pid: 1085
PPid: 1039
TracerPid: 0
Uid: 2000 0 0 0
Gid: 2000 0 0 0
调用setuid(0)情况
root@generic:/system/bin # cat /proc/1229/status
cat /proc/1229/status
Name: test_while_setuid
State: R (running)
Tgid: 1229
Pid: 1229
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 2000 0 0 0
调用setuid(0),setgid(0) 情况
root@generic:/system/bin # cat /proc/1260/status
cat /proc/1260/status
Name: test_while_setu
State: R (running)
Tgid: 1260
Pid: 1260
PPid: 1039
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0