vvfat: Check that updated filenames are valid
commitc79e243ed67683d6d06692bd7040f7394da178b0
authorKevin Wolf <kwolf@redhat.com>
Tue, 23 Jun 2020 17:55:33 +0000 (23 19:55 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 3 Jul 2020 07:37:03 +0000 (3 09:37 +0200)
tree40a87f1b1b42f363d799a3bcfbf0803f9b50188b
parentf10802d2c9fd8bfd92c70f465da1a5992445157f
vvfat: Check that updated filenames are valid

FAT allows only a restricted set of characters in file names, and for
some of the illegal characters, it's actually important that we catch
them: If filenames can contain '/', the guest can construct filenames
containing "../" and escape from the assigned vvfat directory. The same
problem could arise if ".." was ever accepted as a literal filename.

Fix this by adding a check that all filenames are valid in
check_directory_consistency().

Reported-by: Nathan Huckleberry <nhuck15@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200623175534.38286-2-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vvfat.c