From b14ffb0250b8ee00abd790ff616cfed7da8916f6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 Mar 2020 18:39:57 +0100 Subject: [PATCH] ANDROID: GKI: sched.h: add Android ABI padding to some structures Try to mitigate potential future driver core api changes by adding a pointer to struct signal_struct, struct sched_entity, struct sched_rt_entity, and struct task_struct. Based on a patch from Michal Marek from the SLES kernel Bug: 151154716 Signed-off-by: Greg Kroah-Hartman Change-Id: I1449735b836399e9b356608727092334daf5c36b --- include/linux/sched.h | 20 ++++++++++++++++++++ include/linux/sched/signal.h | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h index 7f7784b60c3d..1dc5077da58e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -29,6 +29,7 @@ #include #include #include +#include /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context; @@ -486,6 +487,11 @@ struct sched_entity { */ struct sched_avg avg; #endif + + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); }; struct sched_rt_entity { @@ -504,6 +510,11 @@ struct sched_rt_entity { /* rq "owned" by this entity/group: */ struct rt_rq *my_q; #endif + + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); } __randomize_layout; struct sched_dl_entity { @@ -1282,6 +1293,15 @@ struct task_struct { void *security; #endif + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); + ANDROID_KABI_RESERVE(5); + ANDROID_KABI_RESERVE(6); + ANDROID_KABI_RESERVE(7); + ANDROID_KABI_RESERVE(8); + /* * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct. diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 660d78c9af6c..9c456c7b43a2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -8,6 +8,7 @@ #include #include #include +#include /* * Types defining task->signal and task->sighand and APIs using them: @@ -232,6 +233,10 @@ struct signal_struct { struct mutex cred_guard_mutex; /* guard against foreign influences on * credential calculations * (notably. ptrace) */ + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); } __randomize_layout; /*