Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b14ffb02 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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 <mmarek@suse.cz> from the SLES kernel

Bug: 151154716
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I1449735b836399e9b356608727092334daf5c36b
parent 071fbc06
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <linux/mm_event.h>
#include <linux/task_io_accounting.h>
#include <linux/rseq.h>
#include <linux/android_kabi.h>

/* 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.
+5 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <linux/sched/jobctl.h>
#include <linux/sched/task.h>
#include <linux/cred.h>
#include <linux/android_kabi.h>

/*
 * 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;

/*