angler-fishThe Vulnerability History Project

x86/ioperm: Share I/O bitmap if identical

      The I/O bitmap is duplicated on fork. That's wasting memory and slows down
fork. There is no point to do so. As long as the bitmap is not modified it
can be shared between threads and processes.

Add a refcount and just share it on fork. If a task modifies the bitmap
then it has to do the duplication if and only if it is shared.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
    
commit 4804e382c117ce213cd5c43512cf4b1d71bb2650
+5
+39 -9
+6 -33
expand_less