Skip to content

Commit

Permalink
Merge pull request #7826 from douzzer/20240802-linuxkm-kernel-6v11
Browse files Browse the repository at this point in the history
20240802-linuxkm-kernel-6v11
  • Loading branch information
dgarske authored Aug 2, 2024
2 parents b12a773 + 19ea0b2 commit 35b45aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions linuxkm/linuxkm_wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,13 @@

const unsigned char *_ctype;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
typeof(kmalloc_noprof) *kmalloc_noprof;
typeof(krealloc_noprof) *krealloc_noprof;
typeof(kzalloc_noprof) *kzalloc_noprof;
typeof(__kvmalloc_node_noprof) *__kvmalloc_node_noprof;
typeof(__kmalloc_cache_noprof) *__kmalloc_cache_noprof;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
typeof(kmalloc_noprof) *kmalloc_noprof;
typeof(krealloc_noprof) *krealloc_noprof;
typeof(kzalloc_noprof) *kzalloc_noprof;
Expand Down Expand Up @@ -685,7 +691,14 @@

#define _ctype (wolfssl_linuxkm_get_pie_redirect_table()->_ctype)

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
/* see include/linux/alloc_tag.h and include/linux/slab.h */
#define kmalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_noprof)
#define krealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->krealloc_noprof)
#define kzalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kzalloc_noprof)
#define __kvmalloc_node_noprof (wolfssl_linuxkm_get_pie_redirect_table()->__kvmalloc_node_noprof)
#define __kmalloc_cache_noprof (wolfssl_linuxkm_get_pie_redirect_table()->__kmalloc_cache_noprof)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
/* see include/linux/alloc_tag.h and include/linux/slab.h */
#define kmalloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->kmalloc_noprof)
#define krealloc_noprof (wolfssl_linuxkm_get_pie_redirect_table()->krealloc_noprof)
Expand Down
8 changes: 7 additions & 1 deletion linuxkm/module_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,13 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {

wolfssl_linuxkm_pie_redirect_table._ctype = _ctype;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
wolfssl_linuxkm_pie_redirect_table.kmalloc_noprof = kmalloc_noprof;
wolfssl_linuxkm_pie_redirect_table.krealloc_noprof = krealloc_noprof;
wolfssl_linuxkm_pie_redirect_table.kzalloc_noprof = kzalloc_noprof;
wolfssl_linuxkm_pie_redirect_table.__kvmalloc_node_noprof = __kvmalloc_node_noprof;
wolfssl_linuxkm_pie_redirect_table.__kmalloc_cache_noprof = __kmalloc_cache_noprof;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
wolfssl_linuxkm_pie_redirect_table.kmalloc_noprof = kmalloc_noprof;
wolfssl_linuxkm_pie_redirect_table.krealloc_noprof = krealloc_noprof;
wolfssl_linuxkm_pie_redirect_table.kzalloc_noprof = kzalloc_noprof;
Expand Down

0 comments on commit 35b45aa

Please sign in to comment.