OSDN Git Service

ANDROID: GKI: mm: add Android ABI padding to some structures
authorGreg Kroah-Hartman <gregkh@google.com>
Tue, 10 Mar 2020 17:42:05 +0000 (18:42 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 1 May 2020 13:18:12 +0000 (15:18 +0200)
Try to mitigate potential future driver core api changes by adding a
padding to stuct vm_area_struct and struct zone.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I81702aa833f419928e0e32e9609722b98592c171

include/linux/mm_types.h
include/linux/mmzone.h

index 3f6ab00..718ba2e 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/uprobes.h>
 #include <linux/page-flags-layout.h>
 #include <linux/workqueue.h>
+#include <linux/android_kabi.h>
 
 #include <asm/mmu.h>
 
@@ -335,6 +336,11 @@ struct vm_area_struct {
        struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
 #endif
        struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
+
+       ANDROID_KABI_RESERVE(1);
+       ANDROID_KABI_RESERVE(2);
+       ANDROID_KABI_RESERVE(3);
+       ANDROID_KABI_RESERVE(4);
 } __randomize_layout;
 
 struct core_thread {
index 57f5772..b4f3370 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/pageblock-flags.h>
 #include <linux/page-flags-layout.h>
 #include <linux/atomic.h>
+#include <linux/android_kabi.h>
 #include <asm/page.h>
 
 /* Free memory management - zoned buddy allocator.  */
@@ -519,6 +520,11 @@ struct zone {
        /* Zone statistics */
        atomic_long_t           vm_stat[NR_VM_ZONE_STAT_ITEMS];
        atomic_long_t           vm_numa_stat[NR_VM_NUMA_STAT_ITEMS];
+
+       ANDROID_KABI_RESERVE(1);
+       ANDROID_KABI_RESERVE(2);
+       ANDROID_KABI_RESERVE(3);
+       ANDROID_KABI_RESERVE(4);
 } ____cacheline_internodealigned_in_smp;
 
 enum pgdat_flags {