aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/permit.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-04-16Move get_feature_policy to sway/security.cJerzi Kaminsky
2017-04-16Rename get_policy to get_feature_policyJerzi Kaminsky
2017-02-20Read configs from /etc/sway/security.d/*Drew DeVault
2017-02-20Add initial support code for new IPC securityDrew DeVault
2016-12-17Change how security config is loadedDrew DeVault
2016-12-15Handle allocation failures in security codeDrew DeVault
Note that such errors are generally going to be fatal
2016-12-02Add ipc connection feature policy controlsDrew DeVault
2016-12-02Add support for command policies in config fileDrew DeVault
2016-12-01Implement permit and reject commandsDrew DeVault