]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: compose mount.<type> helpers paths more carefully
authorKarel Zak <kzak@redhat.com>
Thu, 26 Sep 2013 12:45:14 +0000 (14:45 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 26 Sep 2013 12:58:20 +0000 (14:58 +0200)
commit51e3530cdcb1d4f3ab91ae953ebc5adcdc5f9239
tree42d4268961c58984efbb05071b6307ada0f3e4db
parente4d394fa365d7e8b53076f96410b0e0cff1ae4c5
libmount: compose mount.<type> helpers paths more carefully

The [u]mount helper path is "/sbin/mount.<type>", the <type> should not
be possible to interpret like a path, for example:

  # mkdir /sbin/mount.fake
  # mount -t fake/../../../home/user/foo.sh

Anyway, this is *not mount(8) security issue*, because:

  - non-root users don't have permissions to specify -t on mount(8)
    command line
  - /sbin is not writable for regular users

This patch makes libmount more robust for situations when the library
is used by incompetent developers who don't sanitize user's input.

Reported-by: "Horsfall, Matthew" <mhorsfal@akamai.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c