|
@@ -12,6 +12,7 @@
|
|
|
#include <linux/prio_tree.h>
|
|
|
#include <linux/debug_locks.h>
|
|
|
#include <linux/mm_types.h>
|
|
|
+#include <linux/security.h>
|
|
|
|
|
|
struct mempolicy;
|
|
|
struct anon_vma;
|
|
@@ -512,6 +513,21 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
|
|
|
set_page_section(page, pfn_to_section_nr(pfn));
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * If a hint addr is less than mmap_min_addr change hint to be as
|
|
|
+ * low as possible but still greater than mmap_min_addr
|
|
|
+ */
|
|
|
+static inline unsigned long round_hint_to_min(unsigned long hint)
|
|
|
+{
|
|
|
+#ifdef CONFIG_SECURITY
|
|
|
+ hint &= PAGE_MASK;
|
|
|
+ if (((void *)hint != NULL) &&
|
|
|
+ (hint < mmap_min_addr))
|
|
|
+ return PAGE_ALIGN(mmap_min_addr);
|
|
|
+#endif
|
|
|
+ return hint;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Some inline functions in vmstat.h depend on page_zone()
|
|
|
*/
|