Commit 7337f929 authored by Christophe Leroy's avatar Christophe Leroy Committed by Luis Chamberlain

module: Rename debug_align() as strict_align()

debug_align() was added by commit 84e1c6bb ("x86: Add RO/NX
protection for loadable kernel modules")

At that time the config item was CONFIG_DEBUG_SET_MODULE_RONX.

But nowadays it has changed to CONFIG_STRICT_MODULE_RWX and
debug_align() is confusing because it has nothing to do with
DEBUG.

Rename it strict_align()
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent ef505058
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
* only when CONFIG_STRICT_MODULE_RWX=y * only when CONFIG_STRICT_MODULE_RWX=y
*/ */
#ifdef CONFIG_STRICT_MODULE_RWX #ifdef CONFIG_STRICT_MODULE_RWX
# define debug_align(X) PAGE_ALIGN(X) # define strict_align(X) PAGE_ALIGN(X)
#else #else
# define debug_align(X) (X) # define strict_align(X) (X)
#endif #endif
extern struct mutex module_mutex; extern struct mutex module_mutex;
......
...@@ -139,7 +139,7 @@ void layout_symtab(struct module *mod, struct load_info *info) ...@@ -139,7 +139,7 @@ void layout_symtab(struct module *mod, struct load_info *info)
mod->core_layout.size += strtab_size; mod->core_layout.size += strtab_size;
info->core_typeoffs = mod->core_layout.size; info->core_typeoffs = mod->core_layout.size;
mod->core_layout.size += ndst * sizeof(char); mod->core_layout.size += ndst * sizeof(char);
mod->core_layout.size = debug_align(mod->core_layout.size); mod->core_layout.size = strict_align(mod->core_layout.size);
/* Put string table section at end of init part of module. */ /* Put string table section at end of init part of module. */
strsect->sh_flags |= SHF_ALLOC; strsect->sh_flags |= SHF_ALLOC;
...@@ -154,7 +154,7 @@ void layout_symtab(struct module *mod, struct load_info *info) ...@@ -154,7 +154,7 @@ void layout_symtab(struct module *mod, struct load_info *info)
mod->init_layout.size += sizeof(struct mod_kallsyms); mod->init_layout.size += sizeof(struct mod_kallsyms);
info->init_typeoffs = mod->init_layout.size; info->init_typeoffs = mod->init_layout.size;
mod->init_layout.size += nsrc * sizeof(char); mod->init_layout.size += nsrc * sizeof(char);
mod->init_layout.size = debug_align(mod->init_layout.size); mod->init_layout.size = strict_align(mod->init_layout.size);
} }
/* /*
......
...@@ -1447,19 +1447,19 @@ static void layout_sections(struct module *mod, struct load_info *info) ...@@ -1447,19 +1447,19 @@ static void layout_sections(struct module *mod, struct load_info *info)
} }
switch (m) { switch (m) {
case 0: /* executable */ case 0: /* executable */
mod->core_layout.size = debug_align(mod->core_layout.size); mod->core_layout.size = strict_align(mod->core_layout.size);
mod->core_layout.text_size = mod->core_layout.size; mod->core_layout.text_size = mod->core_layout.size;
break; break;
case 1: /* RO: text and ro-data */ case 1: /* RO: text and ro-data */
mod->core_layout.size = debug_align(mod->core_layout.size); mod->core_layout.size = strict_align(mod->core_layout.size);
mod->core_layout.ro_size = mod->core_layout.size; mod->core_layout.ro_size = mod->core_layout.size;
break; break;
case 2: /* RO after init */ case 2: /* RO after init */
mod->core_layout.size = debug_align(mod->core_layout.size); mod->core_layout.size = strict_align(mod->core_layout.size);
mod->core_layout.ro_after_init_size = mod->core_layout.size; mod->core_layout.ro_after_init_size = mod->core_layout.size;
break; break;
case 4: /* whole core */ case 4: /* whole core */
mod->core_layout.size = debug_align(mod->core_layout.size); mod->core_layout.size = strict_align(mod->core_layout.size);
break; break;
} }
} }
...@@ -1481,11 +1481,11 @@ static void layout_sections(struct module *mod, struct load_info *info) ...@@ -1481,11 +1481,11 @@ static void layout_sections(struct module *mod, struct load_info *info)
} }
switch (m) { switch (m) {
case 0: /* executable */ case 0: /* executable */
mod->init_layout.size = debug_align(mod->init_layout.size); mod->init_layout.size = strict_align(mod->init_layout.size);
mod->init_layout.text_size = mod->init_layout.size; mod->init_layout.text_size = mod->init_layout.size;
break; break;
case 1: /* RO: text and ro-data */ case 1: /* RO: text and ro-data */
mod->init_layout.size = debug_align(mod->init_layout.size); mod->init_layout.size = strict_align(mod->init_layout.size);
mod->init_layout.ro_size = mod->init_layout.size; mod->init_layout.ro_size = mod->init_layout.size;
break; break;
case 2: case 2:
...@@ -1496,7 +1496,7 @@ static void layout_sections(struct module *mod, struct load_info *info) ...@@ -1496,7 +1496,7 @@ static void layout_sections(struct module *mod, struct load_info *info)
mod->init_layout.ro_after_init_size = mod->init_layout.ro_size; mod->init_layout.ro_after_init_size = mod->init_layout.ro_size;
break; break;
case 4: /* whole init */ case 4: /* whole init */
mod->init_layout.size = debug_align(mod->init_layout.size); mod->init_layout.size = strict_align(mod->init_layout.size);
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment