From 4965ad067b76c7365552b68411299cfc55f16667 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jul 2024 15:17:23 +0000 Subject: [PATCH] ANDROID: Fix abi issues in struct sk_buff In commit 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use"), struct sk_buff dropped an unneeded union structure. This did not change the actual structure size or layout at all, but the abi checker didn't like it. So trick it by putting some __GENKSYMS__ markers in to preserve the abi correctly. Bug: 335584858 Fixes: 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use") Change-Id: I78ca54f9df3e03cccebc326babf1d84ccb5dc781 Signed-off-by: Greg Kroah-Hartman --- android/abi_gki_aarch64.stg | 21 +-------------------- include/linux/skbuff.h | 7 +++++++ net/ipv4/inet_fragment.c | 2 ++ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 4c5ad5163610..3779f8437f76 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -41288,11 +41288,6 @@ member { id: 0x3e4f626d type_id: 0x7613f9a7 } -member { - id: 0x3e5d0376 - type_id: 0x765a5eef - offset: 192 -} member { id: 0x3e670f18 type_id: 0x76b2536c @@ -111885,11 +111880,6 @@ member { type_id: 0x18bd6530 offset: 4992 } -member { - id: 0x0e850e04 - name: "ip_defrag_offset" - type_id: 0x6720d32f -} member { id: 0xbc6a844a name: "ip_epilogue" @@ -218986,15 +218976,6 @@ struct_union { member_id: 0xa70d7362 } } -struct_union { - id: 0x765a5eef - kind: UNION - definition { - bytesize: 8 - member_id: 0x828c89b5 - member_id: 0x0e850e04 - } -} struct_union { id: 0x7689fdd5 kind: UNION @@ -258615,7 +258596,7 @@ struct_union { definition { bytesize: 248 member_id: 0x34366909 - member_id: 0x3e5d0376 + member_id: 0x828c817c member_id: 0x318fd08b member_id: 0x53e7b9ea member_id: 0x345f6930 diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a9e8875e3394..b7520dd30e4a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -872,7 +872,14 @@ struct sk_buff { struct llist_node ll_node; }; +#ifdef __GENKSYMS__ + union { + struct sock *sk; + int ip_defrag_offset; + }; +#else struct sock *sk; +#endif union { ktime_t tstamp; diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 834cdc57755f..63968d081d96 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -24,7 +24,9 @@ #include #include +#ifndef __GENKSYMS__ #include "../core/sock_destructor.h" +#endif /* Use skb->cb to track consecutive/adjacent fragments coming at * the end of the queue. Nodes in the rb-tree queue will