We now understand that it's the kernel (the OS) that sets up resource limits per process and tracks usage, even killing the process if necessary—if it attempts to exceed a resource's hard limit. This raises the question: is there a way one can change the soft and hard resource-limit values? We've already seen it in fact: ulimit. More than that, though, the deeper question is: are we allowed to set any hard/soft limits?
The kernel has certain preset rules regarding the changing of a resource limit. Querying or setting a process's resource limits can only be done by the calling process upon itself or upon a process that it owns; more correctly, for any other process besides itself, the process must ...