Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 6461d28674160e6ef7c13209e81506d4efc09f9d)
+++ kernel/generic/src/mm/as.c	(revision ae7f6fb75347ada51aca1b40d5c46352dda49257)
@@ -871,4 +871,9 @@
 
 	/*
+	 * Set the new flags.
+	 */
+	area->flags = flags;
+
+	/*
 	 * Map pages back in with new flags. This step is kept separate
 	 * so that there's no instant when the memory area could be
