From 6e6898e23cab9d266e230e7e0460d97a0d716181 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 4 Dec 2021 11:49:18 +0100 Subject: [PATCH] ANDROID: GKI: update abi_gki_aarch64.xml due to bpf changes in 5.10.83 Commit 33fe044f6a9e ("bpf: Fix toctou on read-only map's constant scalar tracking") in 5.10.83, changes a field in struct bpf_map from a u64 into an atomic64_t which is the same size, in order to fix a security problem (CVE-2021-4001). This causes libabigail to properly detect that a change happened, but no "real" ABI break happened here due to the structure size being the same and no module ever accessing this field directly. Fix this up by updating the .xml file and adding a GENKSYMS check on the structure to preserve the CRC change. Leaf changes summary: 1 artifact changed (1 filtered out) Changed leaf types summary: 1 (1 filtered out) leaf types changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 'struct bpf_map at bpf.h:146:1' changed: type size hasn't changed there are data member changes: type 'typedef u64' of 'bpf_map::writecnt' changed: typedef name changed from u64 to atomic64_t at types.h:175:1 underlying type 'typedef __u64' at int-ll64.h:31:1 changed: entity changed from 'typedef __u64' to 'struct {s64 counter;}' at types.h:173:1 type size hasn't changed 4682 impacted interfaces Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: If9ab94646ed404244e1f108044dd7efc5f6a36f9 --- android/abi_gki_aarch64.xml | 440 ++++++++++++++++++------------------ include/linux/bpf.h | 7 + 2 files changed, 227 insertions(+), 220 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 6589da9a79fc..70cce623bbad 100755 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -9615,174 +9615,174 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -14188,21 +14188,21 @@ - + - + - + - + - + - + @@ -14988,21 +14988,21 @@ - + - + - + - + - + - + @@ -25128,15 +25128,15 @@ - + - + - + - + @@ -32517,24 +32517,24 @@ - + - + - + - + - + - + - + @@ -40196,7 +40196,7 @@ - + @@ -48140,9 +48140,9 @@ - + - + @@ -49386,15 +49386,15 @@ - + - + - + - + @@ -54106,15 +54106,15 @@ - + - + - + - + @@ -55819,24 +55819,24 @@ - + - + - + - + - + - + - + @@ -60567,12 +60567,12 @@ - + - + - + @@ -65441,9 +65441,9 @@ - + - + @@ -67056,9 +67056,9 @@ - + - + @@ -69158,7 +69158,7 @@ - + @@ -75158,15 +75158,15 @@ - + - + - + - + @@ -75263,36 +75263,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -75759,12 +75759,12 @@ - + - + - + @@ -79269,12 +79269,12 @@ - + - + - + @@ -83465,24 +83465,24 @@ - + - + - + - + - + - + - + @@ -88436,12 +88436,12 @@ - + - + - + @@ -88488,7 +88488,7 @@ - + @@ -93568,30 +93568,30 @@ - + - + - + - + - + - + - + - + - + @@ -94285,12 +94285,12 @@ - + - + - + @@ -99712,24 +99712,24 @@ - + - + - + - + - + - + - + @@ -103058,7 +103058,7 @@ - + @@ -106227,33 +106227,33 @@ - + - + - + - + - + - + - + - + - + - + @@ -106263,7 +106263,7 @@ - + @@ -109016,12 +109016,12 @@ - + - + - + @@ -118639,18 +118639,18 @@ - - - + + + - - + + - - - + + + @@ -119100,21 +119100,21 @@ - - - - + + + + - - - - + + + + - - - + + + @@ -125661,10 +125661,10 @@ - - - - + + + + @@ -133382,34 +133382,34 @@ - - - + + + - - - - - + + + + + - - + + - - - - + + + + - - + + @@ -139542,10 +139542,10 @@ - - - - + + + + @@ -141222,9 +141222,9 @@ - - - + + + @@ -141322,8 +141322,8 @@ - - + + diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 4f8b7c17d063..ba9e5824b5da 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -177,7 +177,14 @@ struct bpf_map { atomic64_t usercnt; struct work_struct work; struct mutex freeze_mutex; +#ifdef __GENKSYMS__ + /* Preserve the CRC change that commit 33fe044f6a9e ("bpf: Fix toctou on + * read-only map's constant scalar tracking") caused. + */ + u64 writecnt; +#else atomic64_t writecnt; +#endif }; static inline bool map_value_has_spin_lock(const struct bpf_map *map)