fs: Treat foreign mounts as nosuid
[cascardo/linux.git] / security / selinux / hooks.c
index a86d537..1554175 100644 (file)
@@ -2259,7 +2259,7 @@ static int check_nnp_nosuid(const struct linux_binprm *bprm,
                            const struct task_security_struct *new_tsec)
 {
        int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS);
-       int nosuid = (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID);
+       int nosuid = !mnt_may_suid(bprm->file->f_path.mnt);
        int rc;
 
        if (!nnp && !nosuid)