Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 12 Nov 2018 17:51:27 +0100
From: Jiří Moravec <jim.lkml@...il.com>
To: lkrg-users@...ts.openwall.com
Subject: error: inlining failed in call to always_inline ‘p_module_core|p_core_text_size’: function body not available

Still failing :-(

$ LC_ALL=POSIX P_KVER=4.19.1-x6 make clean all

make -C /lib/modules/4.19.1-x6/build M=/usr/src/devel/projects/lkrg/lkrg-0.5 clean
make[1]: Entering directory '/usr/src/devel/4.19.1-x6/build64'
CLEAN   /usr/src/devel/projects/lkrg/lkrg-0.5/.tmp_versions
make[1]: Leaving directory '/usr/src/devel/4.19.1-x6/build64'
rm -f Module.markers modules.order
rm -f /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/client/kmod/Module.markers
rm -f /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/client/kmod/modules.order
rm -f -rf output
make -C /lib/modules/4.19.1-x6/build M=/usr/src/devel/projects/lkrg/lkrg-0.5 modules CONFIG_DEBUG_SECTION_MISMATCH=y
make[1]: Entering directory '/usr/src/devel/4.19.1-x6/build64'
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/ksyms/p_resolve_ksym.o
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/hashing/p_lkrg_fast_hash.o
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/comm_channel/p_comm_channel.o
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/wrap/p_struct_wrap.o
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/integrity_timer/p_integrity_timer.o
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/integrity_timer/p_integrity_timer.c: In function ‘p_check_integrity’:
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/integrity_timer/p_integrity_timer.c:157:15: note: byref variable will be forcibly initialized
p_cpu_info p_tmp_cpu_info;
^~~~~~~~~~~~~~
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/integrity_timer/.tmp_p_integrity_timer.o: warning: objtool: p_cmp_bytes()+0x1aa: return with modified stack frame
CC [M]  /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.o
In file included from /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/../../p_lkrg_main.h:84,
from /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.c:22:
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.c: In function ‘p_count_modules_from_module_list’:
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/../../modules/wrap/p_struct_wrap.h:28:14: error: inlining failed in call to always_inline ‘p_module_core’: function body not available
inline void *p_module_core(struct module *p_mod);
^~~~~~~~~~~~~
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.c:133:12: note: called from here
if (!p_module_core(p_mod) || !p_core_text_size(p_mod))
^~~~~~~~~~~~~~~~~~~~
In file included from /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/../../p_lkrg_main.h:84,
from /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.c:22:
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/../../modules/wrap/p_struct_wrap.h:30:21: error: inlining failed in call to always_inline ‘p_core_text_size’: function body not available
inline unsigned int p_core_text_size(struct module *p_mod);
^~~~~~~~~~~~~~~~
/usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.c:133:37: note: called from here
if (!p_module_core(p_mod) || !p_core_text_size(p_mod))
^~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [../scripts/Makefile.build:306: /usr/src/devel/projects/lkrg/lkrg-0.5/src/modules/kmod/p_kmod.o] Chyba 1
make[3]: *** [/usr/src/devel/4.19.1-x6/Makefile:1518: _module_/usr/src/devel/projects/lkrg/lkrg-0.5] Chyba 2
make[2]: *** [Makefile:147: sub-make] Error 2
make[1]: *** [Makefile:24: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/devel/4.19.1-x6/build64'
make: *** [Makefile:78: all] Error 2


Only workaround of this problem, which I found, was redefining these functions as 'static inline' as I already posted in https://forums.gentoo.org/viewtopic-p-8277898.html:

diff -Nupr a/Makefile b/Makefile
--- a/Makefile	2018-11-03 20:45:22.889400502 +0100
+++ b/Makefile	2018-11-03 20:49:06.501418164 +0100
@@ -16,7 +16,6 @@ obj-m += p_lkrg.o
 p_lkrg-objs += src/modules/ksyms/p_resolve_ksym.o \
                src/modules/hashing/p_lkrg_fast_hash.o \
                src/modules/comm_channel/p_comm_channel.o \
-               src/modules/wrap/p_struct_wrap.o \
                src/modules/integrity_timer/p_integrity_timer.o \
                src/modules/kmod/p_kmod.o \
                src/modules/database/CPU.o \
diff -Nupr a/src/modules/wrap/p_struct_wrap.c b/src/modules/wrap/p_struct_wrap.c
--- a/src/modules/wrap/p_struct_wrap.c	2018-01-14 21:15:47.000000000 +0100
+++ b/src/modules/wrap/p_struct_wrap.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,123 +0,0 @@
-/*
- * pi3's Linux kernel Runtime Guard
- *
- * Component:
- *  - Kernel's modules module wrapping access to some critical structures
- *
- * Notes:
- *  - Wrapping some of the critical structures in the system e.g.:
- *   -> k[g/u]id_t
- *   -> accesing 'struct module' structure
- *
- * Timeline:
- *  - Created: 11.IX.2017
- *
- * Author:
- *  - Adam 'pi3' Zabrocki (http://pi3.com.pl)
- *
- */
-
-#include "../../p_lkrg_main.h"
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
-
-inline void p_set_uid(kuid_t *p_arg, unsigned int p_val) {
-   p_arg->val = p_val;
-}
-
-inline unsigned int p_get_uid(const kuid_t *p_from) {
-   return p_from->val;
-}
-
-inline void p_set_gid(kgid_t *p_arg, unsigned int p_val) {
-   p_arg->val = p_val;
-}
-
-inline unsigned int p_get_gid(const kgid_t *p_from) {
-   return p_from->val;
-}
-
-#else
-
-#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
-
-inline void p_set_uid(kuid_t *p_arg, unsigned int p_val) {
-   p_arg->val = p_val;
-}
-
-inline unsigned int p_get_uid(const kuid_t *p_from) {
-   return p_from->val;
-}
-
-inline void p_set_gid(kgid_t *p_arg, unsigned int p_val) {
-   p_arg->val = p_val;
-}
-
-inline unsigned int p_get_gid(const kgid_t *p_from) {
-   return p_from->val;
-}
-
-#else
-
-inline void p_set_uid(kuid_t *p_arg, unsigned int p_val) {
-   *p_arg = p_val;
-}
-
-inline unsigned int p_get_uid(const kuid_t *p_from) {
-   return *p_from;
-}
-
-inline void p_set_gid(kgid_t *p_arg, unsigned int p_val) {
-   *p_arg = p_val;
-}
-
-inline unsigned int p_get_gid(const kgid_t *p_from) {
-   return *p_from;
-}
-
-#endif
-
-#endif
-
-
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 6)
-
-
-inline void *p_module_core(struct module *p_mod) {
-   return p_mod->core_layout.base;
-}
-
-inline unsigned int p_core_size(struct module *p_mod) {
-   return p_mod->core_layout.size;
-}
-
-inline unsigned int p_core_text_size(struct module *p_mod) {
-   return p_mod->core_layout.text_size;
-}
-
-inline unsigned int p_init_text_size(struct module *p_mod) {
-   return p_mod->init_layout.text_size;
-}
-
-
-#else
-
-inline void *p_module_core(struct module *p_mod) {
-   return p_mod->module_core;
-}
-
-inline unsigned int p_init_text_size(struct module *p_mod) {
-   return p_mod->init_text_size;
-}
-
-inline unsigned int p_core_text_size(struct module *p_mod) {
-   return p_mod->core_text_size;
-}
-
-inline unsigned int p_core_size(struct module *p_mod) {
-   return p_mod->core_size;
-}
-
-
-#endif
diff -Nupr a/src/modules/wrap/p_struct_wrap.h b/src/modules/wrap/p_struct_wrap.h
--- a/src/modules/wrap/p_struct_wrap.h	2018-01-14 21:15:47.000000000 +0100
+++ b/src/modules/wrap/p_struct_wrap.h	2018-11-03 20:49:06.502418165 +0100
@@ -20,14 +20,40 @@
 #ifndef P_LKRG_WRAPPER_H
 #define P_LKRG_WRAPPER_H
 
-inline void p_set_uid(kuid_t *p_arg, unsigned int p_val);
-inline unsigned int p_get_uid(const kuid_t *p_from);
-inline void p_set_gid(kgid_t *p_arg, unsigned int p_val);
-inline unsigned int p_get_gid(const kgid_t *p_from);
-
-inline void *p_module_core(struct module *p_mod);
-inline unsigned int p_core_size(struct module *p_mod);
-inline unsigned int p_core_text_size(struct module *p_mod);
-inline unsigned int p_init_text_size(struct module *p_mod);
+static inline void p_set_uid(kuid_t *p_arg, unsigned int p_val) {
+   p_arg->val = p_val;
+}
+
+static inline unsigned int p_get_uid(const kuid_t *p_from) {
+   return p_from->val;
+}
+
+static inline void p_set_gid(kgid_t *p_arg, unsigned int p_val) {
+   p_arg->val = p_val;
+}
+
+static inline unsigned int p_get_gid(const kgid_t *p_from) {
+   return p_from->val;
+}
+
+
+
+static inline void *p_module_core(struct module *p_mod) {
+   return p_mod->core_layout.base;
+}
+
+static inline unsigned int p_core_size(struct module *p_mod) {
+   return p_mod->core_layout.size;
+}
+
+static inline unsigned int p_core_text_size(struct module *p_mod) {
+   return p_mod->core_layout.text_size;
+}
+
+static inline unsigned int p_init_text_size(struct module *p_mod) {
+   return p_mod->init_layout.text_size;
+}
+
+
 
 #endif

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.