]> Pileus Git - ~andy/linux/blobdiff - kernel/exit.c
stackprotector: use canary at end of stack to indicate overruns at oops time
[~andy/linux] / kernel / exit.c
index 8f6185e69b691265746f81a1ca4ce9de9fd8a640..fb8de6cbf2c78dd6435239213594f1cdc9a4e28b 100644 (file)
@@ -899,12 +899,9 @@ static void check_stack_usage(void)
 {
        static DEFINE_SPINLOCK(low_water_lock);
        static int lowest_to_date = THREAD_SIZE;
-       unsigned long *n = end_of_stack(current);
        unsigned long free;
 
-       while (*n == 0)
-               n++;
-       free = (unsigned long)n - (unsigned long)end_of_stack(current);
+       free = stack_not_used(current);
 
        if (free >= lowest_to_date)
                return;