From b34f70f7bf6c8fb68ad2f9255500bd82534beffc 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 Leaf changes summary: 3 artifacts changed Changed leaf types summary: 3 leaf types changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 'struct sched_entity at sched.h:444:1' changed: type size changed from 3584 to 4096 (in bits) 4 data member insertions: 'u64 sched_entity::android_kabi_reserved1', at offset 3584 (in bits) at sched.h:481:1 'u64 sched_entity::android_kabi_reserved2', at offset 3648 (in bits) at sched.h:482:1 'u64 sched_entity::android_kabi_reserved3', at offset 3712 (in bits) at sched.h:483:1 'u64 sched_entity::android_kabi_reserved4', at offset 3776 (in bits) at sched.h:484:1 1435 impacted interfaces: 'struct sched_rt_entity at sched.h:481:1' changed: type size changed from 384 to 640 (in bits) 4 data member insertions: 'u64 sched_rt_entity::android_kabi_reserved1', at offset 384 (in bits) at sched.h:504:1 'u64 sched_rt_entity::android_kabi_reserved2', at offset 448 (in bits) at sched.h:505:1 'u64 sched_rt_entity::android_kabi_reserved3', at offset 512 (in bits) at sched.h:506:1 'u64 sched_rt_entity::android_kabi_reserved4', at offset 576 (in bits) at sched.h:507:1 1435 impacted interfaces: 'struct task_struct at sched.h:624:1' changed: type size changed from 28672 to 30208 (in bits) 8 data member insertions: 'u64 task_struct::android_kabi_reserved1', at offset 20992 (in bits) at sched.h:1294:1 'u64 task_struct::android_kabi_reserved2', at offset 21056 (in bits) at sched.h:1295:1 'u64 task_struct::android_kabi_reserved3', at offset 21120 (in bits) at sched.h:1296:1 'u64 task_struct::android_kabi_reserved4', at offset 21184 (in bits) at sched.h:1297:1 'u64 task_struct::android_kabi_reserved5', at offset 21248 (in bits) at sched.h:1298:1 'u64 task_struct::android_kabi_reserved6', at offset 21312 (in bits) at sched.h:1299:1 'u64 task_struct::android_kabi_reserved7', at offset 21376 (in bits) at sched.h:1300:1 'u64 task_struct::android_kabi_reserved8', at offset 21440 (in bits) at sched.h:1301:1 there are data member changes: 1435 impacted interfaces: Bug: 151154716 Signed-off-by: Greg Kroah-Hartman Change-Id: I1449735b836399e9b356608727092334daf5c36b --- abi_gki_aarch64.xml | 1150 ++++++++++++++++++---------------- include/linux/sched.h | 20 + include/linux/sched/signal.h | 5 + 3 files changed, 630 insertions(+), 545 deletions(-) diff --git a/abi_gki_aarch64.xml b/abi_gki_aarch64.xml index ad88d86c7ebb..44aabfbad6b3 100644 --- a/abi_gki_aarch64.xml +++ b/abi_gki_aarch64.xml @@ -3306,546 +3306,570 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - + + - + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - + + - + - + - - + + - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + - + - - + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + + + + - + - + - + - + - + - - - - + - + + + + - - - - + - + - - - - - - - - + + - + - + - + - + - + + + + - - - - + - + + + + - + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + - + + + + - + - + + + + + + + + + + + + + - + - + - + + + + + + + - + - - - - - - - - + + - + - - - - - + + - - - - - - - - - - + - - - - + - + - - - - - + + - + - - - - + - + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3887,255 +3911,279 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -4278,60 +4326,60 @@ - + - + - + - + - + - - + + + + + + + + + + - - - - - - - - - + - + - + - + - + - + - + - + - + - + @@ -4533,15 +4581,15 @@ - + - + - + - + @@ -4585,9 +4633,9 @@ - + - + @@ -6551,12 +6599,12 @@ - + - + - + @@ -12408,210 +12456,222 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + @@ -13137,7 +13197,7 @@ - + @@ -25935,7 +25995,7 @@ - + @@ -28334,7 +28394,7 @@ - + @@ -29172,7 +29232,7 @@ - + @@ -29909,7 +29969,7 @@ - + @@ -31758,12 +31818,12 @@ - + - + - + @@ -62598,7 +62658,7 @@ - + @@ -71660,7 +71720,7 @@ - + @@ -73790,7 +73850,7 @@ - + @@ -73830,7 +73890,7 @@ - + @@ -74491,7 +74551,7 @@ - + diff --git a/include/linux/sched.h b/include/linux/sched.h index 0a73fb7116f5..688fa0c92ffc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -31,6 +31,7 @@ #include #include #include +#include /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context; @@ -476,6 +477,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 { @@ -494,6 +500,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 { @@ -1280,6 +1291,15 @@ struct task_struct { unsigned long prev_lowest_stack; #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 88050259c466..f7d3466b4259 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -10,6 +10,7 @@ #include #include #include +#include /* * Types defining task->signal and task->sighand and APIs using them: @@ -225,6 +226,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; /*