Bug 1660901 - ignore AT_NO_AUTOMOUNT in fstatat system call. r=jld

Per the manpage "Both stat() and lstat() act as though AT_NO_AUTOMOUNT
was set.", so don't bail if it's set in a call to fstatat.

Differential Revision: https://phabricator.services.mozilla.com/D89121
This commit is contained in:
Julien Cristau 2020-09-06 20:20:39 +00:00
Родитель 76a83d0a21
Коммит ae8cb5feaf
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -254,9 +254,10 @@ class SandboxPolicyCommon : public SandboxPolicyBase {
fd, path, buf, flags);
return BlockedSyscallTrap(aArgs, nullptr);
}
if ((flags & ~AT_SYMLINK_NOFOLLOW) != 0) {
if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT)) != 0) {
SANDBOX_LOG_ERROR("unsupported flags %d in fstatat(%d, \"%s\", %p, %d)",
(flags & ~AT_SYMLINK_NOFOLLOW), fd, path, buf, flags);
(flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT)), fd,
path, buf, flags);
return BlockedSyscallTrap(aArgs, nullptr);
}
return (flags & AT_SYMLINK_NOFOLLOW) == 0 ? broker->Stat(path, buf)