diff --git a/fs/namei.c b/fs/namei.c index 2ea15d043412..66e0fe262a89 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3523,6 +3523,8 @@ struct dentry *vfs_tmpfile(struct user_namespace *mnt_userns, child = d_alloc(dentry, &slash_name); if (unlikely(!child)) goto out_err; + if (!IS_POSIXACL(dir)) + mode &= ~current_umask(); error = dir->i_op->tmpfile(mnt_userns, dir, child, mode); if (error) goto out_err;