From c057264c4ba7ddf9d775c013fcb1cecb910bf2b9 Mon Sep 17 00:00:00 2001 From: Dan Duval Date: Tue, 17 May 2016 19:54:41 -0400 Subject: [PATCH] fix kABI breakage from "unix: properly account for FDs passed over unix sockets" Orabug: 23330739 Orabug: 23330739 Signed-off-by: Dan Duval Commit 67af13e958a0de5dc4191d31e96dcf4240ea96d2, "unix: properly account for FDs passed over unix sockets", added an element "unix_inflight" to struct user_struct. This broke kABI. Even worse, the element was added in the middle of the structure, changing the offsets of all the other existing elements that ended up after "unix_inflight". This commit wraps the new element in "#ifndef __GENKSYMS__" so that the kABI checker won't see it. It also moves the element to the end of the structure, so that existing binary third-party modules won't be affected if they simply access existing elements via pointers. A search of the kernel source hints that this structure won't be accessed via the expected kinds of third-party modules (e.g., drivers) at all, so this change should be fairly safe (cherry picked from commit b3f5d5cd4fa654c63389b683976f2df7b25b6ceb) Signed-off-by: Dan Duval --- include/linux/sched.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 9128b4e9f541..85531c0583bc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -802,7 +802,6 @@ struct user_struct { unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */ #endif unsigned long locked_shm; /* How many pages of mlocked shm ? */ - unsigned long unix_inflight; /* How many files in flight in unix sockets */ #ifdef CONFIG_KEYS struct key *uid_keyring; /* UID specific keyring */ @@ -816,6 +815,9 @@ struct user_struct { #ifdef CONFIG_PERF_EVENTS atomic_long_t locked_vm; #endif +#ifndef __GENKSYMS__ + unsigned long unix_inflight; /* How many files in flight in unix sockets */ +#endif }; extern int uids_sysfs_init(void); -- 2.49.0