From 02e8f2ba3776545018b272d76d1ffa180049c9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 11 Oct 2021 10:42:27 -0700 Subject: [PATCH] ANDROID: Different fix for KABI breakage in 4.19.209 in struct sock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts commit ddf077f140f12e6f0c7de3bd45cc4b1ea4ce4875. Then fixes things up in such a way that BUILD_CONFIG=build/build.config.net_test for kernel_test still works. Bug: 202712021 Signed-off-by: Maciej Żenczykowski Change-Id: I40e24d7924fcffc23a2b8cc5ad50049808aa9455 --- build.config.allmodconfig | 6 ------ include/net/sock.h | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.config.allmodconfig b/build.config.allmodconfig index dd01f6a34425..103d1cdf4edc 100644 --- a/build.config.allmodconfig +++ b/build.config.allmodconfig @@ -7,12 +7,6 @@ function update_config() { -d CPU_BIG_ENDIAN \ -d STM \ -d TEST_MEMCAT_P \ - -d DEBUG_SPINLOCK \ - -d DEBUG_LOCK_ALLOC \ - -d LOCK_STAT \ - -d DEBUG_WW_MUTEX_SLOWPATH \ - -d DEBUG_LOCK_ALLOC \ - -d PROVE_LOCKING \ -e UNWINDER_FRAME_POINTER \ (cd ${OUT_DIR} && \ diff --git a/include/net/sock.h b/include/net/sock.h index 7d619a898ccb..79dde11135d4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -472,6 +472,11 @@ struct sock { u32 sk_ack_backlog; u32 sk_max_ack_backlog; kuid_t sk_uid; +#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC) + spinlock_t sk_peer_lock; +#else + /* sk_peer_lock is in the ANDROID_KABI_RESERVE(1) field below */ +#endif struct pid *sk_peer_pid; const struct cred *sk_peer_cred; @@ -512,7 +517,11 @@ struct sock { struct sock_reuseport __rcu *sk_reuseport_cb; struct rcu_head sk_rcu; +#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC) + ANDROID_KABI_RESERVE(1); +#else ANDROID_KABI_USE(1, spinlock_t sk_peer_lock); +#endif ANDROID_KABI_RESERVE(2); ANDROID_KABI_RESERVE(3); ANDROID_KABI_RESERVE(4);