Map VM file drop paths to avoid spoofing host paths
Not all paths in a VM can be mapped to a path in the host. Paths in crostini homedir and /mnt/chromeos are fine. E.g. /mnt/chromeos/MyFiles/file => <cyrptohome>/MyFiles/file. But /etc/mime.types is not accessible to the host and cannot be mapped to a valid host path, so we will map it as 'vmfile:termina:/etc/mime.types'. If the drop target is the crostini container, we will do the reverse mapping and provide file:///etc/mime.types, but if we fail to do the reverse mapping for the drop target (e.g. drop target is arc or Plugin VM), we will clear the path from the drop data. Since chrome accesses OSExchangeData directly without allowing exo to do any reverse mapping, chrome will attempt to use a path such as file:///vmfile:termina:/etc/mime.types which is intended to fail. Bug: 1144138 Bug: 1146319 Change-Id: I91c62b5183f054311cba2ef474dda0f12766db83 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546677Reviewed-by:Jason Lin <lxj@google.com> Reviewed-by:
Mitsuru Oshima <oshima@chromium.org> Commit-Queue: Joel Hockey <joelhockey@chromium.org> Cr-Commit-Position: refs/heads/master@{#829159}
Showing
Please register or sign in to comment