ANDROID: GKI: kobject.h: add Android ABI padding to some structures

Try to mitigate potential future driver core api changes by adding a
padding to struct kobject, struct kobj_type, and struct kset.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3c28826dc314c7f1b5c9bb167be82089d53768bb
This commit is contained in:
Greg Kroah-Hartman 2020-05-02 09:40:34 +02:00
parent b865a7fed3
commit 08b2c8d881

View File

@ -27,6 +27,7 @@
#include <linux/atomic.h>
#include <linux/workqueue.h>
#include <linux/uidgid.h>
#include <linux/android_kabi.h>
#define UEVENT_HELPER_PATH_LEN 256
#define UEVENT_NUM_ENVP 64 /* number of env pointers */
@ -78,6 +79,11 @@ struct kobject {
unsigned int state_add_uevent_sent:1;
unsigned int state_remove_uevent_sent:1;
unsigned int uevent_suppress:1;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
extern __printf(2, 3)
@ -143,6 +149,11 @@ struct kobj_type {
const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
const void *(*namespace)(struct kobject *kobj);
void (*get_ownership)(struct kobject *kobj, kuid_t *uid, kgid_t *gid);
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
struct kobj_uevent_env {
@ -194,6 +205,11 @@ struct kset {
spinlock_t list_lock;
struct kobject kobj;
const struct kset_uevent_ops *uevent_ops;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
} __randomize_layout;
extern void kset_init(struct kset *kset);