lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 28 Nov 2009 10:40:30 -0500
From:	Mike Frysinger <>
To:	David Howells <>,
	Paul Mundt <>,
	Bernd Schmidt <>,
	Jie Zhang <>
Cc:	Linux kernel mailing list <>,
	uclinux-dist-devel <>
Subject: avoiding duplicate icache flushing of shared maps on nommu

when working with FDPIC, there are many shared maps of read only text
regions (the C library, applet packages like busybox, ...) between
applications.  but the current mm/nommu.c:do_mmap_pgoff() function
will issue an icache flush whenever a vma is added to a mm instead of
only doing it when the map is initially created.  am i missing
something obvious here, or would a change like below be OK ?  this
easily cuts the number of icache flushes during boot by 50% if not

(yes, this now does the icache flush while holding the
nommu_region_sem, but i'm interested if the _idea_ is OK)

--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1409,14 +1409,14 @@ unsigned long do_mmap_pgoff(struct file *file,

    current->mm->total_vm += len >> PAGE_SHIFT;

+   if (prot & PROT_EXEC)
+       flush_icache_range(result, result + len);
    add_vma_to_mm(current->mm, vma);


-   if (prot & PROT_EXEC)
-       flush_icache_range(result, result + len);
    kleave(" = %lx", result);
    return result;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists