Skip to contentSkip to conversation

Changing argv[0] under Linux.

DISCUSSION Jon Burgess 2 participants 2 messages Jan 16, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Raúl

That's good, but I would like to avoid to mount procfs:
what if the mount point '/proc' doesn't exist?
If you create it, you must mount root rw and remount ro again,

Surely that is an admin problem to make sure that /mount exists on the root fs. When your messing with something as fundamental as init you should be able to insist on this.

It is easy to do a mount() system call, the rootfs can be ro.

Quoted 2 lines

What if /proc/self/exe is not part form procfs,
but from some evil user ;))

Would the user not need root privilegdes to mess with /proc? Is there any good reason why init should not be executable by root only?

Jon

#1 lore raw

Hi Jon :)

Quoted 1 line

It is easy to do a mount() system call, the rootfs can be ro.

Yes, but you still need a mountpoint. Lot of worries for
something as trivial and useless as changing the ps identity ;))

Quoted 3 lines
Quoted 2 lines

What if /proc/self/exe is not part form procfs,
but from some evil user ;))

Would the user not need root privilegdes to mess with /proc?

/proc/self/exe doesn't need to be in procfs... If proc is not
mounted... Anyway it was just an example. The degree of evil-user intrusion in a machine for doing something like that is quite high. There are simpler ways of attacking a machine if you can forge /proc/self/exe :))

Quoted 2 lines

Is there any good reason why init should not be executable by root only?

My init refuses to run if not called by the superuser ;) because
I think the same as you and anyway my init doesn't need a shutdown command, it works with a keycombo that root controls.

Raúl