staticinline vm_flags_t arch_calc_vm_flag_bits(struct file *file, unsignedlong flags)
{ /* * Only allow MTE on anonymous mappings as these are guaranteed to be * backed by tags-capable memory. The vm_flags may be overridden by a * filesystem supporting MTE (RAM-based).
*/ if (system_supports_mte()) { if (flags & (MAP_ANONYMOUS | MAP_HUGETLB)) return VM_MTE_ALLOWED; if (shmem_file(file) || is_file_hugepages(file)) return VM_MTE_ALLOWED;
}
staticinlinebool arch_validate_flags(vm_flags_t vm_flags)
{ if (system_supports_mte()) { /* * only allow VM_MTE if VM_MTE_ALLOWED has been set * previously
*/ if ((vm_flags & VM_MTE) && !(vm_flags & VM_MTE_ALLOWED)) returnfalse;
}
if (system_supports_gcs() && (vm_flags & VM_SHADOW_STACK)) { /* An executable GCS isn't a good idea. */ if (vm_flags & VM_EXEC) returnfalse;
/* The memory management core should prevent this */
VM_WARN_ON(vm_flags & VM_SHARED);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.