I'm using Linux POSIX mqueue implementation, and I have a problem. For current kernel, the max message size is 1MB, but I need to have no limit.
man mq_overview
says that if the process is privileged (a process that has CAP_SYS_RESOURCE
capability) it has no limits.
I thought that a process executed by root was already privileged, but I'm still getting "message too long" error (my message has 2MB).
How can I add CAP_SYS_RESOURCE
capability to the process?
It means effective-set and permitted-set. It means the capabilities will be put in the permitted set ( p ), and all permitted capabilities will be copied into the effective set ( e ).
Process Capability for Non-Normal Data To calculate the process capability, it is necessary to understand the process data shapes, whether it is normal or non-normal, if it is non-normal data we must see that process is in control or not if it is not in control; then it cannot be predicted for process capability.
Where cap_setuid() arranges for the right effective capability to be raised in order to perform the system call, and also arranges to preserve the availability of permitted capabilities after the uid has changed. Following this call all effective capabilities are lowered.
CapBnd: With the bounding set it's possible to restrict the capabilities a process may ever receive. Only capabilities that are present in the bounding set will be allowed in the inheritable and permitted sets. CapAmb: The ambient capability set applies to all non-SUID binaries without file capabilities.
I don't know if it is possible to set it to a running process (I guess not) but you can grant the CAP_SYS_RESOURCE capability to an executable file using # setcap 'CAP_SYS_RESOURCE=+ep' /path/to/executable
(as super user).
In this example the +ep
turns down into raise the CAP_SYS_RESOURCE
capibility to be permitted and effective. However the man pages capabilities(7)
and setcap(8)
are useful sources for further information.
you can change the ceiling on the maximum message size on this file /proc/sys/fs/mqueue/msgsize_max I hope it works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With