sway-patched-tray-menu/sway
Jerzi Kaminsky 2ad8850398 Handle symlinks as IPC security targets
- 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-16 17:09:53 +03:00
..
commands Handle symlinks as IPC security targets 2017-04-16 17:09:53 +03:00
border.c Impliment i3-style marks 2017-04-03 11:48:37 -06:00
CMakeLists.txt Revise IPC security configuration 2017-02-19 02:56:59 -05:00
commands.c Disambiguate get_*_policy() and get_*_policy_mask() 2017-04-16 17:09:53 +03:00
config.c Impliment i3-style marks 2017-04-03 11:48:37 -06:00
container.c Impliment i3-style marks 2017-04-03 11:48:37 -06:00
criteria.c Added designated initaliser, to prevent any possible problem with 2017-04-07 00:34:33 +12:00
debug_log.c Added Awesome/Monad type "auto" layouts 2016-12-29 20:31:30 +01:00
extensions.c Disambiguate get_*_policy() and get_*_policy_mask() 2017-04-16 17:09:53 +03:00
focus.c prevent dereference of freed workspace 2016-10-02 22:03:52 -05:00
handlers.c Disambiguate get_*_policy() and get_*_policy_mask() 2017-04-16 17:09:53 +03:00
input.c UnGNUify the codebase 2017-03-10 23:41:24 -05:00
input_state.c Reorganize includes 2016-09-01 08:18:37 -04:00
ipc-json.c Remain compat with libinput < 1.7.0 2017-04-14 02:30:41 +03:00
ipc-server.c Disambiguate get_*_policy() and get_*_policy_mask() 2017-04-16 17:09:53 +03:00
layout.c Prevent "move next" and "move prev" commands from crashing 2017-03-19 16:58:39 +02:00
main.c Implement more thourough nvidia config check 2017-04-12 10:04:44 -04:00
output.c Add output wrapping 2017-01-13 16:06:10 -08:00
security.c Add validate_ipc_target() 2017-04-16 17:09:53 +03:00
sway-bar.5.txt Fix style in sway-bar(5) manpage 2017-04-14 02:30:41 +03:00
sway-input.5.txt Add left_handed support for input devices 2016-10-25 22:06:23 +02:00
sway-security.7.txt Allow also 444 for security file mode 2017-03-16 15:12:22 +00:00
sway.1.txt Downgrade nvidia proprietary driver warning 2017-04-12 10:04:44 -04:00
sway.5.txt Improve criteria handling 2017-04-05 22:07:23 -06:00
workspace.c UnGNUify the codebase 2017-03-10 23:41:24 -05:00