Skip to content

x86 memory domain configuration not always applied correctly on context switch when partitions are added #13918

@andrewboie

Description

@andrewboie

Scenario:

  1. Supervisor thread X modifies the memory domain that it belongs to with k_mem_domain_add_partition(), to add access to region A
  2. Context switches to User thread Y which belongs to the same domain as thread X
  3. Thread Y attempts to access region A and faults

Unlike k_mem_domain_remove_partition(), which invokes _arch_mem_domain_partition_remove() if the caller is in the same domain being worked on, k_mem_domain_add_partition() does not call into arch code at all when partitions are added, and there isn't an arch-level API for this even if we wanted to.

x86 doesn't touch the page tables on context switch if the incoming and outgoing threads are in the same memory domain.

This does not seem to be a problem on ARM or ARC.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions