From 2ed28105c6c4601aa3918eb4457460634d16f010 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 13 May 2022 13:45:30 +0200 Subject: [PATCH] ANDROID: GKI: update the abi .xml file due to hex_to_bin() changes Commit 616d354fb9e8 ("hex2bin: make the function hex_to_bin constant-time") in 5.10.114 changed the signature of the hex_to_bin() function to fix a key leak attack vector. This is not an abi break as older modules that use the function will still work properly, and the CRC is preserved, but this resolves any issues going forward as well. Leaf changes summary: 1 artifact changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 1 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some sub-type change: [C] 'function int hex_to_bin(char)' at hexdump.c:53:1 has some sub-type changes: parameter 1 of type 'char' changed: type name changed from 'char' to 'unsigned char' type size hasn't changed Fixes: 616d354fb9e8 ("hex2bin: make the function hex_to_bin constant-time") Signed-off-by: Greg Kroah-Hartman Change-Id: I26b2283300369049abc831072df9a5ace3e770d1 --- android/abi_gki_aarch64.xml | 510 ++++++++++++++++++------------------ include/linux/kernel.h | 4 + lib/hexdump.c | 8 + 3 files changed, 267 insertions(+), 255 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 0feea3047152..967ff019d739 100755 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -38786,60 +38786,60 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -43736,7 +43736,7 @@ - + @@ -61850,21 +61850,21 @@ - + - + - + - + - + - + @@ -69033,7 +69033,7 @@ - + @@ -70857,45 +70857,45 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -91726,15 +91726,15 @@ - + - + - + - + @@ -110396,15 +110396,15 @@ - + - + - + - + @@ -112686,33 +112686,33 @@ - + - + - + - + - + - + - + - + - + - + @@ -119482,10 +119482,10 @@ - - - - + + + + @@ -127555,10 +127555,10 @@ - - - - + + + + @@ -128036,9 +128036,9 @@ - - - + + + @@ -128090,9 +128090,9 @@ - - - + + + @@ -129095,12 +129095,12 @@ - - - - - - + + + + + + @@ -129606,26 +129606,26 @@ - - - - + + + + - - - - - - - - + + + + + + + + - - + + @@ -133445,15 +133445,15 @@ - - + + - + @@ -133786,11 +133786,11 @@ - - - - - + + + + + @@ -133815,8 +133815,8 @@ - - + + @@ -133826,8 +133826,8 @@ - - + + @@ -135738,7 +135738,7 @@ - + @@ -136764,15 +136764,15 @@ - - - - - - - - - + + + + + + + + + @@ -140786,71 +140786,71 @@ - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -140861,63 +140861,63 @@ - - - - - + + + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - - + + + + @@ -142097,12 +142097,12 @@ - - - - - - + + + + + + @@ -143204,21 +143204,21 @@ - - - + + + - - + + - - + + - - + + @@ -143228,13 +143228,13 @@ - - - + + + - - + + @@ -145802,9 +145802,9 @@ - - - + + + @@ -146306,15 +146306,15 @@ - - - - + + + + - - - + + + @@ -146338,19 +146338,19 @@ - - - + + + - - - - + + + + @@ -146363,13 +146363,13 @@ - - - + + + - - + + @@ -146387,9 +146387,9 @@ - - - + + + @@ -146404,22 +146404,22 @@ - - - - - - + + + + + + - - - + + + - - - + + + @@ -146449,9 +146449,9 @@ - - - + + + @@ -146464,8 +146464,8 @@ - - + + diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f5392d96d688..c333dc6fb1ac 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -635,7 +635,11 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte) return buf; } +#ifdef __GENKSYMS__ +extern int hex_to_bin(char ch); +#else extern int hex_to_bin(unsigned char ch); +#endif extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); extern char *bin2hex(char *dst, const void *src, size_t count); diff --git a/lib/hexdump.c b/lib/hexdump.c index 06833d404398..07cda1a13e09 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c @@ -43,7 +43,15 @@ EXPORT_SYMBOL(hex_asc_upper); * uppercase and lowercase letters, so we use (ch & 0xdf), which converts * lowercase to uppercase */ +/* + * perserve abi due to 15b78a8e38e8 ("hex2bin: make the function hex_to_bin + * constant-time" + */ +#ifdef __GENKSYMS__ +int hex_to_bin(char ch) +#else int hex_to_bin(unsigned char ch) +#endif { unsigned char cu = ch & 0xdf; return -1 +