ANDROID: introduce CONFIG_GKI_NET_XFRM_HACKS

(without this net tests fail, CONFIG_GKI_HACKS_TO_FIX
 doesn't work, as it causes compilation failures due
 to enabling tons of other things)

Bug: 252915518
Test: TreeHugger, manually with uml net nests
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9dae7f6be3828a1bdb71560dd9126ebed5cda9e5
This commit is contained in:
Maciej Żenczykowski 2022-10-10 18:23:34 -07:00
parent 6c3a056db6
commit ccbe77622c
4 changed files with 9 additions and 3 deletions

View file

@ -235,6 +235,11 @@ config GKI_HIDDEN_DMA_CONFIGS
Dummy config option used to enable the hidden DMA configs,
required by various SoC platforms.
config GKI_NET_XFRM_HACKS
bool "XFRM changes required by Android"
help
Android Networking tests fail without this.
# Atrocities needed for
# a) building GKI modules in separate tree, or
# b) building drivers that are not modularizable
@ -244,6 +249,7 @@ config GKI_HIDDEN_DMA_CONFIGS
#
config GKI_HACKS_TO_FIX
bool "GKI Dummy config options"
select GKI_NET_XFRM_HACKS
select GKI_HIDDEN_CRYPTO_CONFIGS
select GKI_HIDDEN_DRM_CONFIGS
select GKI_HIDDEN_MCP251XFD_CONFIGS

View file

@ -237,7 +237,7 @@ static struct xfrm_algo_desc aalg_list[] = {
.uinfo = {
.auth = {
.icv_truncbits = IS_ENABLED(CONFIG_GKI_HACKS_TO_FIX) ? 128 : 96,
.icv_truncbits = IS_ENABLED(CONFIG_GKI_NET_XFRM_HACKS) ? 128 : 96,
.icv_fullbits = 256,
}
},

View file

@ -2443,7 +2443,7 @@ int xfrm_user_policy(struct sock *sk, int optname, sockptr_t optval, int optlen)
return PTR_ERR(data);
/* Use the 64-bit / untranslated format on Android, even for compat */
if (!IS_ENABLED(CONFIG_GKI_HACKS_TO_FIX) || IS_ENABLED(CONFIG_XFRM_USER_COMPAT)) {
if (!IS_ENABLED(CONFIG_GKI_NET_XFRM_HACKS) || IS_ENABLED(CONFIG_XFRM_USER_COMPAT)) {
if (in_compat_syscall()) {
struct xfrm_translator *xtr = xfrm_get_translator();

View file

@ -3008,7 +3008,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
return -EPERM;
/* Use the 64-bit / untranslated format on Android, even for compat */
if (!IS_ENABLED(CONFIG_GKI_HACKS_TO_FIX) || IS_ENABLED(CONFIG_XFRM_USER_COMPAT)) {
if (!IS_ENABLED(CONFIG_GKI_NET_XFRM_HACKS) || IS_ENABLED(CONFIG_XFRM_USER_COMPAT)) {
if (in_compat_syscall()) {
struct xfrm_translator *xtr = xfrm_get_translator();