MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present
[deliverable/linux.git] / arch / mips / kernel / segment.c
index 87bc74a5a518c5fca349104a6257a2ea6242710c..2703f218202e167ffda5b1ff0ac7f2a41ca8df7c 100644 (file)
@@ -26,17 +26,20 @@ static void build_segment_config(char *str, unsigned int cfg)
 
        /*
         * Access modes MK, MSK and MUSK are mapped segments. Therefore
-        * there is no direct physical address mapping.
+        * there is no direct physical address mapping unless it becomes
+        * unmapped uncached at error level due to EU.
         */
-       if ((am == 0) || (am > 3)) {
+       if ((am == 0) || (am > 3) || (cfg & MIPS_SEGCFG_EU))
                str += sprintf(str, "         %03lx",
                        ((cfg & MIPS_SEGCFG_PA) >> MIPS_SEGCFG_PA_SHIFT));
+       else
+               str += sprintf(str, "         UND");
+
+       if ((am == 0) || (am > 3))
                str += sprintf(str, "         %01ld",
                        ((cfg & MIPS_SEGCFG_C) >> MIPS_SEGCFG_C_SHIFT));
-       } else {
-               str += sprintf(str, "         UND");
+       else
                str += sprintf(str, "         U");
-       }
 
        /* Exception configuration. */
        str += sprintf(str, "       %01ld\n",
This page took 0.023775 seconds and 5 git commands to generate.