Skip to content

Commit 6512635

Browse files
authored
Merge pull request #9025 from douzzer/20250721-wolfssl_linuxkm_pie_redirect_table-direct
20250721-wolfssl_linuxkm_pie_redirect_table-direct
2 parents c7bc6e8 + 6043274 commit 6512635

File tree

3 files changed

+106
-74
lines changed

3 files changed

+106
-74
lines changed

linuxkm/Kbuild

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ $(obj)/wolfcrypt/test/test.o: ccflags-y += -DNO_MAIN_DRIVER -DWOLFSSL_NO_OPTIONS
101101
$(obj)/wolfcrypt/src/aes.o: ccflags-y = $(WOLFSSL_CFLAGS) $(WOLFSSL_CFLAGS_YES_VECTOR_INSNS)
102102

103103
ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
104+
# note, we need -fno-stack-protector to avoid references to
105+
# "__stack_chk_fail" from the wolfCrypt container.
104106
PIE_FLAGS := -fPIE -fno-stack-protector -fno-toplevel-reorder
105107
PIE_SUPPORT_FLAGS := -DUSE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE
106108
ifeq "$(KERNEL_ARCH_X86)" "yes"
@@ -121,7 +123,8 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
121123
endif
122124
$(WOLFCRYPT_PIE_FILES): ccflags-y += $(PIE_SUPPORT_FLAGS) $(PIE_FLAGS)
123125
$(WOLFCRYPT_PIE_FILES): ccflags-remove-y += -pg
124-
# disabling retpoline generation leads to profuse warnings without this:
126+
# using inline retpolines leads to "unannotated intra-function call"
127+
# warnings from objtool without this:
125128
$(WOLFCRYPT_PIE_FILES): OBJECT_FILES_NON_STANDARD := y
126129
$(obj)/linuxkm/module_hooks.o: ccflags-y += $(PIE_SUPPORT_FLAGS)
127130
endif

linuxkm/linuxkm_wc_port.h

Lines changed: 98 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -867,136 +867,165 @@
867867
};
868868

869869
extern const struct wolfssl_linuxkm_pie_redirect_table *wolfssl_linuxkm_get_pie_redirect_table(void);
870+
extern struct wolfssl_linuxkm_pie_redirect_table wolfssl_linuxkm_pie_redirect_table;
871+
872+
873+
#if defined(WC_LKM_INDIRECT_SYM)
874+
/* keep user-supplied override definition. */
875+
#elif defined(WC_LKM_INDIRECT_SYM_BY_FUNC_ONLY) || \
876+
defined(WC_LKM_INDIRECT_SYM_BY_DIRECT_TABLE_READ)
877+
/* keep user-supplied override method. */
878+
#elif defined(CONFIG_X86)
879+
#define WC_LKM_INDIRECT_SYM_BY_DIRECT_TABLE_READ
880+
#elif defined(CONFIG_ARM64)
881+
/* direct access to wolfssl_linuxkm_pie_redirect_table.x on aarch64
882+
* produces GOT relocations, e.g. R_AARCH64_LD64_GOT_LO12_NC.
883+
*/
884+
#define WC_LKM_INDIRECT_SYM_BY_FUNC_ONLY
885+
#else
886+
/* for other archs, by default use the safe way. */
887+
#define WC_LKM_INDIRECT_SYM_BY_FUNC_ONLY
888+
#endif
889+
890+
#if defined(WC_LKM_INDIRECT_SYM)
891+
/* keep user-supplied override definition. */
892+
#elif defined(WC_LKM_INDIRECT_SYM_BY_FUNC_ONLY)
893+
#define WC_LKM_INDIRECT_SYM(x) (wolfssl_linuxkm_get_pie_redirect_table()->x)
894+
#elif defined(WC_LKM_INDIRECT_SYM_BY_DIRECT_TABLE_READ)
895+
#define WC_LKM_INDIRECT_SYM(x) (wolfssl_linuxkm_pie_redirect_table.x)
896+
#else
897+
#error no WC_LKM_INDIRECT_SYM method defined.
898+
#endif
870899

871900
#ifdef __PIE__
872901

873902
#ifndef __ARCH_MEMCMP_NO_REDIRECT
874-
#define memcmp (wolfssl_linuxkm_get_pie_redirect_table()->memcmp)
903+
#define memcmp WC_LKM_INDIRECT_SYM(memcmp)
875904
#endif
876905
#ifndef __ARCH_MEMCPY_NO_REDIRECT
877-
#define memcpy (wolfssl_linuxkm_get_pie_redirect_table()->memcpy)
906+
#define memcpy WC_LKM_INDIRECT_SYM(memcpy)
878907
#endif
879908
#ifndef __ARCH_MEMSET_NO_REDIRECT
880-
#define memset (wolfssl_linuxkm_get_pie_redirect_table()->memset)
909+
#define memset WC_LKM_INDIRECT_SYM(memset)
881910
#endif
882911
#ifndef __ARCH_MEMMOVE_NO_REDIRECT
883-
#define memmove (wolfssl_linuxkm_get_pie_redirect_table()->memmove)
912+
#define memmove WC_LKM_INDIRECT_SYM(memmove)
884913
#endif
885914
#ifndef __ARCH_STRCMP_NO_REDIRECT
886-
#define strcmp (wolfssl_linuxkm_get_pie_redirect_table()->strcmp)
915+
#define strcmp WC_LKM_INDIRECT_SYM(strcmp)
887916
#endif
888917
#ifndef __ARCH_STRNCMP_NO_REDIRECT
889-
#define strncmp (wolfssl_linuxkm_get_pie_redirect_table()->strncmp)
918+
#define strncmp WC_LKM_INDIRECT_SYM(strncmp)
890919
#endif
891920
#ifndef __ARCH_STRCASECMP_NO_REDIRECT
892-
#define strcasecmp (wolfssl_linuxkm_get_pie_redirect_table()->strcasecmp)
921+
#define strcasecmp WC_LKM_INDIRECT_SYM(strcasecmp)
893922
#endif
894923
#ifndef __ARCH_STRNCASECMP_NO_REDIRECT
895-
#define strncasecmp (wolfssl_linuxkm_get_pie_redirect_table()->strncasecmp)
924+
#define strncasecmp WC_LKM_INDIRECT_SYM(strncasecmp)
896925
#endif
897926
#ifndef __ARCH_STRLEN_NO_REDIRECT
898-
#define strlen (wolfssl_linuxkm_get_pie_redirect_table()->strlen)
927+
#define strlen WC_LKM_INDIRECT_SYM(strlen)
899928
#endif
900929
#ifndef __ARCH_STRSTR_NO_REDIRECT
901-
#define strstr (wolfssl_linuxkm_get_pie_redirect_table()->strstr)
930+
#define strstr WC_LKM_INDIRECT_SYM(strstr)
902931
#endif
903932
#ifndef __ARCH_STRNCPY_NO_REDIRECT
904-
#define strncpy (wolfssl_linuxkm_get_pie_redirect_table()->strncpy)
933+
#define strncpy WC_LKM_INDIRECT_SYM(strncpy)
905934
#endif
906935
#ifndef __ARCH_STRNCAT_NO_REDIRECT
907-
#define strncat (wolfssl_linuxkm_get_pie_redirect_table()->strncat)
936+
#define strncat WC_LKM_INDIRECT_SYM(strncat)
908937
#endif
909-
#define kstrtoll (wolfssl_linuxkm_get_pie_redirect_table()->kstrtoll)
938+
#define kstrtoll WC_LKM_INDIRECT_SYM(kstrtoll)
910939

911940
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) || \
912941
(defined(RHEL_MAJOR) && \
913942
((RHEL_MAJOR > 9) || ((RHEL_MAJOR == 9) && (RHEL_MINOR >= 5))))
914-
#define _printk (wolfssl_linuxkm_get_pie_redirect_table()->_printk)
943+
#define _printk WC_LKM_INDIRECT_SYM(_printk)
915944
#else
916-
#define printk (wolfssl_linuxkm_get_pie_redirect_table()->printk)
945+
#define printk WC_LKM_INDIRECT_SYM(printk)
917946
#endif
918947

919948
#ifdef CONFIG_FORTIFY_SOURCE
920-
#define __warn_printk (wolfssl_linuxkm_get_pie_redirect_table()->__warn_printk)
949+
#define __warn_printk WC_LKM_INDIRECT_SYM(__warn_printk)
921950
#endif
922951

923-
#define snprintf (wolfssl_linuxkm_get_pie_redirect_table()->snprintf)
952+
#define snprintf WC_LKM_INDIRECT_SYM(snprintf)
924953

925-
#define _ctype (wolfssl_linuxkm_get_pie_redirect_table()->_ctype)
954+
#define _ctype WC_LKM_INDIRECT_SYM(_ctype)
926955

927956
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
928957
/* see include/linux/alloc_tag.h and include/linux/slab.h */
929-
#define kmalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_noprof)
930-
#define krealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->krealloc_noprof)
931-
#define kzalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kzalloc_noprof)
932-
#define __kvmalloc_node_noprof (wolfssl_linuxkm_get_pie_redirect_table()->__kvmalloc_node_noprof)
933-
#define __kmalloc_cache_noprof (wolfssl_linuxkm_get_pie_redirect_table()->__kmalloc_cache_noprof)
934-
#define kvrealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kvrealloc_noprof)
958+
#define kmalloc_noprof WC_LKM_INDIRECT_SYM(kmalloc_noprof)
959+
#define krealloc_noprof WC_LKM_INDIRECT_SYM(krealloc_noprof)
960+
#define kzalloc_noprof WC_LKM_INDIRECT_SYM(kzalloc_noprof)
961+
#define __kvmalloc_node_noprof WC_LKM_INDIRECT_SYM(__kvmalloc_node_noprof)
962+
#define __kmalloc_cache_noprof WC_LKM_INDIRECT_SYM(__kmalloc_cache_noprof)
963+
#define kvrealloc_noprof WC_LKM_INDIRECT_SYM(kvrealloc_noprof)
935964
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
936965
/* see include/linux/alloc_tag.h and include/linux/slab.h */
937-
#define kmalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_noprof)
938-
#define krealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->krealloc_noprof)
939-
#define kzalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kzalloc_noprof)
940-
#define kvmalloc_node_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kvmalloc_node_noprof)
941-
#define kmalloc_trace_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_trace_noprof)
942-
#define kvrealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kvrealloc_noprof)
966+
#define kmalloc_noprof WC_LKM_INDIRECT_SYM(kmalloc_noprof)
967+
#define krealloc_noprof WC_LKM_INDIRECT_SYM(krealloc_noprof)
968+
#define kzalloc_noprof WC_LKM_INDIRECT_SYM(kzalloc_noprof)
969+
#define kvmalloc_node_noprof WC_LKM_INDIRECT_SYM(kvmalloc_node_noprof)
970+
#define kmalloc_trace_noprof WC_LKM_INDIRECT_SYM(kmalloc_trace_noprof)
971+
#define kvrealloc_noprof WC_LKM_INDIRECT_SYM(kvrealloc_noprof)
943972
#else /* <6.10.0 */
944-
#define kmalloc (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc)
945-
#define krealloc (wolfssl_linuxkm_get_pie_redirect_table()->krealloc)
973+
#define kmalloc WC_LKM_INDIRECT_SYM(kmalloc)
974+
#define krealloc WC_LKM_INDIRECT_SYM(krealloc)
946975
#define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO)
947976
#ifdef HAVE_KVMALLOC
948-
#define kvmalloc_node (wolfssl_linuxkm_get_pie_redirect_table()->kvmalloc_node)
977+
#define kvmalloc_node WC_LKM_INDIRECT_SYM(kvmalloc_node)
949978
#endif
950979
#ifdef HAVE_KVREALLOC
951-
#define kvrealloc (wolfssl_linuxkm_get_pie_redirect_table()->kvrealloc)
980+
#define kvrealloc WC_LKM_INDIRECT_SYM(kvrealloc)
952981
#endif
953982
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || \
954983
(defined(RHEL_MAJOR) && \
955984
((RHEL_MAJOR > 9) || ((RHEL_MAJOR == 9) && (RHEL_MINOR >= 5))))
956-
#define kmalloc_trace (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_trace)
985+
#define kmalloc_trace WC_LKM_INDIRECT_SYM(kmalloc_trace)
957986
#else
958-
#define kmem_cache_alloc_trace (wolfssl_linuxkm_get_pie_redirect_table()->kmem_cache_alloc_trace)
959-
#define kmalloc_order_trace (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_order_trace)
987+
#define kmem_cache_alloc_trace WC_LKM_INDIRECT_SYM(kmem_cache_alloc_trace)
988+
#define kmalloc_order_trace WC_LKM_INDIRECT_SYM(kmalloc_order_trace)
960989
#endif
961990
#endif /* <6.10.0 */
962991

963-
#define kfree (wolfssl_linuxkm_get_pie_redirect_table()->kfree)
992+
#define kfree WC_LKM_INDIRECT_SYM(kfree)
964993
#ifdef HAVE_KVMALLOC
965-
#define kvfree (wolfssl_linuxkm_get_pie_redirect_table()->kvfree)
994+
#define kvfree WC_LKM_INDIRECT_SYM(kvfree)
966995
#endif
967-
#define ksize (wolfssl_linuxkm_get_pie_redirect_table()->ksize)
996+
#define ksize WC_LKM_INDIRECT_SYM(ksize)
968997

969-
#define get_random_bytes (wolfssl_linuxkm_get_pie_redirect_table()->get_random_bytes)
998+
#define get_random_bytes WC_LKM_INDIRECT_SYM(get_random_bytes)
970999
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
971-
#define getnstimeofday (wolfssl_linuxkm_get_pie_redirect_table()->getnstimeofday)
1000+
#define getnstimeofday WC_LKM_INDIRECT_SYM(getnstimeofday)
9721001
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
973-
#define current_kernel_time64 (wolfssl_linuxkm_get_pie_redirect_table()->current_kernel_time64)
1002+
#define current_kernel_time64 WC_LKM_INDIRECT_SYM(current_kernel_time64)
9741003
#else
975-
#define ktime_get_coarse_real_ts64 (wolfssl_linuxkm_get_pie_redirect_table()->ktime_get_coarse_real_ts64)
1004+
#define ktime_get_coarse_real_ts64 WC_LKM_INDIRECT_SYM(ktime_get_coarse_real_ts64)
9761005
#endif
9771006

9781007
#undef get_current
979-
#define get_current (wolfssl_linuxkm_get_pie_redirect_table()->get_current)
1008+
#define get_current WC_LKM_INDIRECT_SYM(get_current)
9801009

9811010
#if defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) && defined(CONFIG_X86)
982-
#define allocate_wolfcrypt_linuxkm_fpu_states (wolfssl_linuxkm_get_pie_redirect_table()->allocate_wolfcrypt_linuxkm_fpu_states)
983-
#define can_save_vector_registers_x86 (wolfssl_linuxkm_get_pie_redirect_table()->can_save_vector_registers_x86)
984-
#define free_wolfcrypt_linuxkm_fpu_states (wolfssl_linuxkm_get_pie_redirect_table()->free_wolfcrypt_linuxkm_fpu_states)
985-
#define restore_vector_registers_x86 (wolfssl_linuxkm_get_pie_redirect_table()->restore_vector_registers_x86)
986-
#define save_vector_registers_x86 (wolfssl_linuxkm_get_pie_redirect_table()->save_vector_registers_x86)
1011+
#define allocate_wolfcrypt_linuxkm_fpu_states WC_LKM_INDIRECT_SYM(allocate_wolfcrypt_linuxkm_fpu_states)
1012+
#define can_save_vector_registers_x86 WC_LKM_INDIRECT_SYM(can_save_vector_registers_x86)
1013+
#define free_wolfcrypt_linuxkm_fpu_states WC_LKM_INDIRECT_SYM(free_wolfcrypt_linuxkm_fpu_states)
1014+
#define restore_vector_registers_x86 WC_LKM_INDIRECT_SYM(restore_vector_registers_x86)
1015+
#define save_vector_registers_x86 WC_LKM_INDIRECT_SYM(save_vector_registers_x86)
9871016
#elif defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS)
9881017
#error WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS is set for an unsupported architecture.
9891018
#endif /* WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS */
9901019

991-
#define __mutex_init (wolfssl_linuxkm_get_pie_redirect_table()->__mutex_init)
1020+
#define __mutex_init WC_LKM_INDIRECT_SYM(__mutex_init)
9921021
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
993-
#define mutex_lock_nested (wolfssl_linuxkm_get_pie_redirect_table()->mutex_lock_nested)
1022+
#define mutex_lock_nested WC_LKM_INDIRECT_SYM(mutex_lock_nested)
9941023
#else
995-
#define mutex_lock (wolfssl_linuxkm_get_pie_redirect_table()->mutex_lock)
1024+
#define mutex_lock WC_LKM_INDIRECT_SYM(mutex_lock)
9961025
#endif
997-
#define mutex_unlock (wolfssl_linuxkm_get_pie_redirect_table()->mutex_unlock)
1026+
#define mutex_unlock WC_LKM_INDIRECT_SYM(mutex_unlock)
9981027
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
999-
#define mutex_destroy (wolfssl_linuxkm_get_pie_redirect_table()->mutex_destroy)
1028+
#define mutex_destroy WC_LKM_INDIRECT_SYM(mutex_destroy)
10001029
#endif
10011030

10021031
/* per linux/ctype.h, tolower() and toupper() are macros bound to static inlines
@@ -1009,45 +1038,45 @@
10091038
#define toupper(c) (isupper(c) ? (c) : ((c) - ('a'-'A')))
10101039

10111040
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_CERTS)
1012-
#define GetCA (wolfssl_linuxkm_get_pie_redirect_table()->GetCA)
1041+
#define GetCA WC_LKM_INDIRECT_SYM(GetCA)
10131042
#ifndef NO_SKID
1014-
#define GetCAByName (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByName)
1043+
#define GetCAByName WC_LKM_INDIRECT_SYM(GetCAByName)
10151044
#ifdef HAVE_OCSP
1016-
#define GetCAByKeyHash (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByKeyHash)
1045+
#define GetCAByKeyHash WC_LKM_INDIRECT_SYM(GetCAByKeyHash)
10171046
#endif /* HAVE_OCSP */
10181047
#endif /* NO_SKID */
10191048
#ifdef WOLFSSL_AKID_NAME
1020-
#define GetCAByAKID (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByAKID)
1049+
#define GetCAByAKID WC_LKM_INDIRECT_SYM(GetCAByAKID)
10211050
#endif
10221051

10231052
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1024-
#define wolfSSL_X509_NAME_add_entry_by_NID (wolfssl_linuxkm_get_pie_redirect_table()->wolfSSL_X509_NAME_add_entry_by_NID)
1025-
#define wolfSSL_X509_NAME_free (wolfssl_linuxkm_get_pie_redirect_table()->wolfSSL_X509_NAME_free)
1026-
#define wolfSSL_X509_NAME_new_ex (wolfssl_linuxkm_get_pie_redirect_table()->wolfSSL_X509_NAME_new_ex)
1053+
#define wolfSSL_X509_NAME_add_entry_by_NID WC_LKM_INDIRECT_SYM(wolfSSL_X509_NAME_add_entry_by_NID)
1054+
#define wolfSSL_X509_NAME_free WC_LKM_INDIRECT_SYM(wolfSSL_X509_NAME_free)
1055+
#define wolfSSL_X509_NAME_new_ex WC_LKM_INDIRECT_SYM(wolfSSL_X509_NAME_new_ex)
10271056
#endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
10281057

10291058
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
10301059

10311060
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
1032-
#define dump_stack (wolfssl_linuxkm_get_pie_redirect_table()->dump_stack)
1061+
#define dump_stack WC_LKM_INDIRECT_SYM(dump_stack)
10331062
#endif
10341063

10351064
#undef preempt_count /* just in case -- not a macro on x86. */
1036-
#define preempt_count (wolfssl_linuxkm_get_pie_redirect_table()->preempt_count)
1065+
#define preempt_count WC_LKM_INDIRECT_SYM(preempt_count)
10371066

10381067
#ifndef WOLFSSL_LINUXKM_USE_MUTEXES
10391068
#ifndef _raw_spin_lock_irqsave
1040-
#define _raw_spin_lock_irqsave (wolfssl_linuxkm_get_pie_redirect_table()->_raw_spin_lock_irqsave)
1069+
#define _raw_spin_lock_irqsave WC_LKM_INDIRECT_SYM(_raw_spin_lock_irqsave)
10411070
#endif
10421071
#ifndef _raw_spin_trylock
1043-
#define _raw_spin_trylock (wolfssl_linuxkm_get_pie_redirect_table()->_raw_spin_trylock)
1072+
#define _raw_spin_trylock WC_LKM_INDIRECT_SYM(_raw_spin_trylock)
10441073
#endif
10451074
#ifndef _raw_spin_unlock_irqrestore
1046-
#define _raw_spin_unlock_irqrestore (wolfssl_linuxkm_get_pie_redirect_table()->_raw_spin_unlock_irqrestore)
1075+
#define _raw_spin_unlock_irqrestore WC_LKM_INDIRECT_SYM(_raw_spin_unlock_irqrestore)
10471076
#endif
10481077
#endif
10491078

1050-
#define _cond_resched (wolfssl_linuxkm_get_pie_redirect_table()->_cond_resched)
1079+
#define _cond_resched WC_LKM_INDIRECT_SYM(_cond_resched)
10511080

10521081
/* this is defined in linux/spinlock.h as an inline that calls the unshimmed
10531082
* raw_spin_unlock_irqrestore(). use a macro here to supersede it.
@@ -1190,7 +1219,7 @@
11901219
*/
11911220
static __always_inline int wc_LockMutex(wolfSSL_Mutex *m)
11921221
{
1193-
return (wolfssl_linuxkm_get_pie_redirect_table()->wc_lkm_LockMutex)(m);
1222+
return WC_LKM_INDIRECT_SYM(wc_lkm_LockMutex)(m);
11941223
}
11951224

11961225
#else /* !__PIE__ */

wolfcrypt/src/wc_port.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4628,13 +4628,13 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
46284628
noinstr void my__alt_cb_patch_nops(struct alt_instr *alt, __le32 *origptr,
46294629
__le32 *updptr, int nr_inst)
46304630
{
4631-
return (wolfssl_linuxkm_get_pie_redirect_table()->
4632-
alt_cb_patch_nops)(alt, origptr, updptr, nr_inst);
4631+
return WC_LKM_INDIRECT_SYM(alt_cb_patch_nops)
4632+
(alt, origptr, updptr, nr_inst);
46334633
}
46344634

46354635
void my__queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
46364636
{
4637-
return (wolfssl_linuxkm_get_pie_redirect_table()->
4638-
queued_spin_lock_slowpath)(lock, val);
4637+
return WC_LKM_INDIRECT_SYM(queued_spin_lock_slowpath)
4638+
(lock, val);
46394639
}
46404640
#endif

0 commit comments

Comments
 (0)