fusermount: bail out on transient config read failure
authorJann Horn <jannh@google.com>
Fri, 13 Jul 2018 22:50:50 +0000 (15:50 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Sat, 21 Jul 2018 11:17:49 +0000 (12:17 +0100)
commit7c49d3cb74b215fcd527dbd9e1884fcc5b0cd469
tree956624bdb4a1f58b3bcea39db55f3fca5a24893e
parent520f09be3c2d351722c33daf7389d6ac4716be98
fusermount: bail out on transient config read failure

If an attacker wishes to use the default configuration instead of the
system's actual configuration, they can attempt to trigger a failure in
read_conf(). This only permits increasing mount_max if it is lower than the
default, so it's not particularly interesting. Still, this should probably
be prevented robustly; bail out if funny stuff happens when we're trying to
read the config.

Note that the classic attack trick of opening so many files that the
system-wide limit is reached won't work here - because fusermount only
drops the fsuid, not the euid, the process is running with euid=0 and
CAP_SYS_ADMIN, so it bypasses the number-of-globally-open-files check in
get_empty_filp() (unless you're inside a user namespace).
util/fusermount.c