Revert "ANDROID: eliminate 'CONFIG_GKI_NET_XFRM_HACKS'"

This partially reverts commit 1cf1608b4a.

(https://android-review.googlesource.com/c/kernel/common/+/3216798
 on android-mainline from before 6.12 branch)

We still need this to support XFRM on 32-bit userspace on aarch64,
the Android way to do this involves not doing compat translation.

Bug: 163141236
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I18db5f1b75b09b254b751bb5eb2843815b88899e
This commit is contained in:
Maciej Żenczykowski
2025-02-07 12:01:42 -08:00
parent f3e061e0fc
commit c09b5fd7e6
3 changed files with 10 additions and 2 deletions
+6
View File
@@ -261,6 +261,11 @@ config GKI_TASK_STRUCT_VENDOR_SIZE_MAX
task_struct dynamically when the GKI_DYNAMIC_TASK_STRUCT_SIZE
option is enabled.
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
@@ -270,6 +275,7 @@ config GKI_TASK_STRUCT_VENDOR_SIZE_MAX
#
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
+2 -1
View File
@@ -2685,7 +2685,8 @@ int xfrm_user_policy(struct sock *sk, int optname, sockptr_t optval, int optlen)
if (IS_ERR(data))
return PTR_ERR(data);
if (in_compat_syscall()) {
/* Use the 64-bit / untranslated format on Android, even for compat */
if (!IS_ENABLED(CONFIG_GKI_NET_XFRM_HACKS) && in_compat_syscall()) {
struct xfrm_translator *xtr = xfrm_get_translator();
if (!xtr) {
+2 -1
View File
@@ -3268,7 +3268,8 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
if (!netlink_net_capable(skb, CAP_NET_ADMIN))
return -EPERM;
if (in_compat_syscall()) {
/* Use the 64-bit / untranslated format on Android, even for compat */
if (!IS_ENABLED(CONFIG_GKI_NET_XFRM_HACKS) && in_compat_syscall()) {
struct xfrm_translator *xtr = xfrm_get_translator();
if (!xtr)