[PATCH 1/5] Add ability for socket communication
nhorman at tuxdriver.com
Thu Dec 29 08:00:49 PST 2016
On Tue, Dec 27, 2016 at 10:44:56PM +0100, Veronika Kabatova wrote:
> This will be used with user interface and also can be used as API for
> users to create their own scripts on top of. The socket communication
> can be used for receiving data about IRQs-to-CPUs assignments and setup,
> as well as setting some options during runtime.
> Socket address: /var/run/irqbalance.sock
I like the idea of what you are adding, but some initial comments:
1) Setting a fixed socket address limits people to a single irqbalance instance.
I know of a few cases in which multiple irqbalances may be run on different cpu
sets, and this would be in conflict with a single socket address. Suggest that
you use abstract namespace mode of AF_LOCAL using the irqbalance pid and a
standard string to create a unique path for each instance.
2) Security is an issue here. You've not restricted socket access at all,
meaning any user on the system can modify irqbalance behavior. Suggest that you
use SCM_CREDENTIALS socket option to limit access to root.
More information about the irqbalance