From 56596148ae7233a5c2959ab413d7329ac5002827 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 5.10.71 in struct sock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts commit 627dc3c79c3b ("ANDROID: Fix up KABI breakage in 5.10.71 in struct sock") 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 Signed-off-by: Greg Kroah-Hartman --- 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 3e563fe1c89f..a48f8d420208 100644 --- a/build.config.allmodconfig +++ b/build.config.allmodconfig @@ -8,12 +8,6 @@ function update_config() { -d TEST_KMOD \ -d CPU_BIG_ENDIAN \ -d DYNAMIC_FTRACE \ - -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 a55ab1b481f5..d50823df426c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -481,6 +481,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; @@ -524,7 +529,11 @@ struct sock { #endif 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);