[Question] mprotect() can't clear PROT_MTE

From: Yang Shi

Date: Wed Oct 29 2025 - 18:41:22 EST


Hi Catalin,

Our customers have usecase to untag memory w/o unmapping it, but mprotect can't do it. It seems like an intended behavior because I saw MTE doc explicitly says PROT_MTE flags can't be cleared by mprotect().
But I don't see why mprotect() can't do it if I don't miss anything. So I'd like to know why it behaves in this way.

unmap + mmap or mmap(MAP_FIXED) can do the trick, but it is not feasible for anonymous mapping because unamp will wipe all the data.

Thanks,
Yang