ANDROID: GKI: mm: add Android ABI padding to some structures

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
This commit is contained in:
Greg Kroah-Hartman
2020-03-10 18:42:05 +01:00
parent 5a7d5998b9
commit 9dc35e84f8
2 changed files with 12 additions and 0 deletions

View 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 {

View 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 {