Files
Icarus Sparry 3668fb5f7b Ensure state_dir is a directory and owned by root
As the state_dir (normally /var/lib/swupd) contains things like the
downloaded bundles, it is important that there is no access to
non-root users who could potentially explot races to replace files
between them being checked and them being installed.

Ensure that the state_dir is root owned, and mode 0700, as well as the
critical directories below it.

Note that a proper fix would involve using chdir to move into the
directory and only use relative paths. This would prevent faulty
permissions higher up the directory tree being exploited. It *might*
be possible to use openat(2) to prevent this exploitation.

Add a test to ensure that the enforcement is taking place.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-08-17 15:28:06 -07:00
..