dm-crypt: use __bio_add_page to add single page to clone bio
[linux-block.git] / kernel / stackleak.c
index c2c33d2202e9a16546e5cd6b49aeccdc116cd218..34c9d81eea9409410fb289f19108bb7fb8488810 100644 (file)
@@ -70,6 +70,18 @@ late_initcall(stackleak_sysctls_init);
 #define skip_erasing() false
 #endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */
 
+#ifndef __stackleak_poison
+static __always_inline void __stackleak_poison(unsigned long erase_low,
+                                              unsigned long erase_high,
+                                              unsigned long poison)
+{
+       while (erase_low < erase_high) {
+               *(unsigned long *)erase_low = poison;
+               erase_low += sizeof(unsigned long);
+       }
+}
+#endif
+
 static __always_inline void __stackleak_erase(bool on_task_stack)
 {
        const unsigned long task_stack_low = stackleak_task_low_bound(current);
@@ -101,10 +113,7 @@ static __always_inline void __stackleak_erase(bool on_task_stack)
        else
                erase_high = task_stack_high;
 
-       while (erase_low < erase_high) {
-               *(unsigned long *)erase_low = STACKLEAK_POISON;
-               erase_low += sizeof(unsigned long);
-       }
+       __stackleak_poison(erase_low, erase_high, STACKLEAK_POISON);
 
        /* Reset the 'lowest_stack' value for the next syscall */
        current->lowest_stack = task_stack_high;