]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fix kABI breakage from "unix: properly account for FDs passed over unix sockets"
authorDan Duval <dan.duval@oracle.com>
Tue, 17 May 2016 23:54:41 +0000 (19:54 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:43:21 +0000 (15:43 -0700)
Orabug: 23330739

Orabug: 23330739

Signed-off-by: Dan Duval <dan.duval@oracle.com>
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 <dan.duval@oracle.com>
include/linux/sched.h

index 9128b4e9f541821ff53c22ceeac7d305e207dfa5..85531c0583bc98b1282ba9042291a2676f28109b 100644 (file)
@@ -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);