aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/ipc.c
AgeCommit message (Collapse)Author
2017-04-16Handle symlinks as IPC security targetsJerzi Kaminsky
- When policies are allocated, the ipc target path goes through symlink resolution. The result is used as the canonical for matching pids to policies at runtime. In particular, this matches up with the target of the `/proc/<pid>/exe`. - There's a possible race condition if this isn't done correctly, read below. Originally, validate_ipc_target() always tried to resolve its argument for symlinks, and returned a parogram target string if it validates. This created a possible race condition with security implications. The problem is that get_feature_policy() first independently resolved the policy target in order to check whether a policy already exists. If it didn't find any, it called alloc_feature_policy() which called validate_ipc_target() which resolved the policy target again. In the time between the two checks, the symlink could be altered, and a lucky attacker could fool the program into thinking that a policy doesn't exist for a target, and then switch the symlink to point at another file. At the very least this could allow him to create two policies for the same program target, and possibly to bypass security by associating the permissions for one target with another, or force default permissions to apply to a target for which a more specific rule has been configured. So we don't that. Instead, the policy target is resolved once and that result is used for the rest of the lookup/creation process.
2017-02-20Read configs from /etc/sway/security.d/*Drew DeVault
2017-02-20Add * policies and fix bugDrew DeVault
2017-02-20Enforce new IPC policiesDrew DeVault
2017-02-20Add initial support code for new IPC securityDrew DeVault
2016-12-17Change how security config is loadedDrew DeVault
2016-12-02Fix clang issuesDrew DeVault
2016-12-02Enforce IPC security policyDrew DeVault
2016-12-02Add IPC security policy command handlersDrew DeVault