ANDROID: force struct blk_mq_alloc_data to be defined in KMI

There were 3 remaining types directly referenced by vendor
hooks that were not fully-defined in the KMI:

struct blk_mq_alloc_data is defined in block/blk-mq.h, however
libabigail is not finding its definition based on the instantiation
of the hooks, so force it to be defined by defining a dummy exported
symbol. Since blk_mq_alloc_data is defined in a subsystem-private
header, create a new vendor_hooks.c file in block/ to define
the dummy symbol.

Bug: 233047575
Bug: 248263460
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I6419caba1c6a159b7a64b9d28e983d753393af86
This commit is contained in:
Todd Kjos
2022-09-21 20:34:48 +00:00
committed by Treehugger Robot
parent af4d4153ca
commit 3dc6e416a1
6 changed files with 31 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ _aarch64_additional_kmi_symbol_lists = [
"android/abi_gki_aarch64_fips140", "android/abi_gki_aarch64_fips140",
"android/abi_gki_aarch64_generic", "android/abi_gki_aarch64_generic",
"android/abi_gki_aarch64_hikey960", "android/abi_gki_aarch64_hikey960",
"android/abi_gki_aarch64_type_visibility",
"android/abi_gki_aarch64_virtual_device", "android/abi_gki_aarch64_virtual_device",
] ]

View File

@@ -0,0 +1,4 @@
[abi_symbol_list]
# for type visibility
GKI_struct_blk_mq_alloc_data

View File

@@ -39,3 +39,4 @@ obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
obj-$(CONFIG_BLK_PM) += blk-pm.o obj-$(CONFIG_BLK_PM) += blk-pm.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
obj-$(CONFIG_ANDROID_VENDOR_HOOKS) += vendor_hooks.o

24
block/vendor_hooks.c Normal file
View File

@@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-2.0-only
/* vendor_hook.c
*
* Copyright 2022 Google LLC
*/
#include "blk.h"
#include "blk-mq-tag.h"
#include "blk-mq.h"
#include <linux/blk-mq.h>
#define CREATE_TRACE_POINTS
#include <trace/hooks/vendor_hooks.h>
#include <linux/tracepoint.h>
#include <trace/hooks/block.h>
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init);
/*
* For type visibility
*/
const struct blk_mq_alloc_data *GKI_struct_blk_mq_alloc_data;
EXPORT_SYMBOL_GPL(GKI_struct_blk_mq_alloc_data);

View File

@@ -11,6 +11,7 @@ Image.gz
ABI_DEFINITION=android/abi_gki_aarch64.xml ABI_DEFINITION=android/abi_gki_aarch64.xml
KMI_SYMBOL_LIST=android/abi_gki_aarch64 KMI_SYMBOL_LIST=android/abi_gki_aarch64
ADDITIONAL_KMI_SYMBOL_LISTS=" ADDITIONAL_KMI_SYMBOL_LISTS="
android/abi_gki_aarch64_type_visibility
android/abi_gki_aarch64_core android/abi_gki_aarch64_core
android/abi_gki_aarch64_fips140 android/abi_gki_aarch64_fips140
android/abi_gki_aarch64_generic android/abi_gki_aarch64_generic

View File

@@ -62,7 +62,6 @@
#include <trace/hooks/iommu.h> #include <trace/hooks/iommu.h>
#include <trace/hooks/thermal.h> #include <trace/hooks/thermal.h>
#include <trace/hooks/ufshcd.h> #include <trace/hooks/ufshcd.h>
#include <trace/hooks/block.h>
#include <trace/hooks/cgroup.h> #include <trace/hooks/cgroup.h>
#include <trace/hooks/workqueue.h> #include <trace/hooks/workqueue.h>
#include <trace/hooks/sys.h> #include <trace/hooks/sys.h>
@@ -270,8 +269,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_insert);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_delete); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_delete);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_replace); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_replace);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_lookup); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_lookup);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds);