Page 1 of 1

Posted: Mon 11 Mar 2013, 19:15
by greengeek
SFR wrote:Basically it's a nice looking one-liner, which multiplies itself (or rather its own process) ad infinitum, what makes system completely freezed.
Sadly, Puppy isn't immune for that kind of attack..!
It's very handy for me to know that I need to take care to avoid such risks. I'm always keen to tinker and "have a bash" so I would've dived in and locked up my system for sure... :-) Wiki suggests this as a means of prevention:
As a fork bomb's mode of operation is entirely encapsulated by creating new processes, one way of preventing a fork bomb from severely affecting the entire system is to limit the maximum number of processes that a single user may own.
I wonder if this might be possible on Puppy.

BTW - My reason for wanting these scripts to help with mouse movement is to allow an inexperienced or physically challenged user to easily select between a limited number of mousepointer_position_choices. That way they can have some degree of functionality by having a "mouseclick" button, but no actual ability to move the mouse anywhere I don't want it to go.

Posted: Mon 11 Mar 2013, 19:55
by SFR
greengeek wrote:
SFR wrote:infinite loop, but deprived of deadly "fork" mechanism) can be utilized as well:

Code: Select all

:(){ echo "Loop..."; sleep 1; :; };:
But of course this is not a good idea to have something like that in your code, so consider this as a "tip of the day".
Do you mean that it's not a good idea because it's so easy to get it wrong (and include a recursive fork by mistake)?
That too, but primarily, because 'while...' or 'until...' are most simple/common/readable methods.
But it may be useful, for example, if you'd like to deliberately obfuscate the code.
greengeek wrote:Wiki suggests this as a means of prevention:
As a fork bomb's mode of operation is entirely encapsulated by creating new processes, one way of preventing a fork bomb from severely affecting the entire system is to limit the maximum number of processes that a single user may own.
I wonder if this might be possible on Puppy.
Hard to say...
# ulimit -a | grep "max user processes"
max user processes (-u) 30948
#
shows that max. number of processes is limited, but it doesn't seem to work (maybe it doesn't affect root account?).

Greetings!

Posted: Tue 16 Jul 2013, 19:33
by greengeek
This thread morphed into an expanded topic tracing the development of SFRs "OneSwitch" pet for disabled users. New thread can be found here:
http://murga-linux.com/puppy/viewtopic.php?t=87418

Posted: Mon 17 Aug 2015, 18:37
by greengeek
SFR wrote:Hard to say...
# ulimit -a | grep "max user processes"
max user processes (-u) 30948
#
shows that max. number of processes is limited, but it doesn't seem to work (maybe it doesn't affect root account?).
Greetings!
On a different thread "scientist" has been trying the following:
This works and prevents root user from starting more than 50 processes.

Code: Select all

root   hard    nproc           50
I haven't tried it yet but thought I would post it.
The other thread is:
http://www.murga-linux.com/puppy/viewtopic.php?t=100634

Posted: Wed 26 Aug 2015, 13:15
by L18L
greengeek wrote:On a different thread "scientist" has been trying the following:
This works and prevents root user from starting more than 50 processes.

Code: Select all

root   hard    nproc           50
I haven't tried it yet but thought I would post it.
I have tried it:

Code: Select all

# root   hard    nproc           50
bash: root: command not found
# 
:wink: