aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 529efae9f481..f57dd63186e6 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1149,6 +1149,8 @@ static size_t module_flags_taint(struct module *mod, char *buf)
1149 buf[l++] = 'C'; 1149 buf[l++] = 'C';
1150 if (mod->taints & (1 << TAINT_UNSIGNED_MODULE)) 1150 if (mod->taints & (1 << TAINT_UNSIGNED_MODULE))
1151 buf[l++] = 'E'; 1151 buf[l++] = 'E';
1152 if (mod->taints & (1 << TAINT_LIVEPATCH))
1153 buf[l++] = 'K';
1152 /* 1154 /*
1153 * TAINT_FORCED_RMMOD: could be added. 1155 * TAINT_FORCED_RMMOD: could be added.
1154 * TAINT_CPU_OUT_OF_SPEC, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't 1156 * TAINT_CPU_OUT_OF_SPEC, TAINT_MACHINE_CHECK, TAINT_BAD_PAGE don't
@@ -2792,14 +2794,17 @@ static int copy_chunked_from_user(void *dst, const void __user *usrc, unsigned l
2792} 2794}
2793 2795
2794#ifdef CONFIG_LIVEPATCH 2796#ifdef CONFIG_LIVEPATCH
2795static int find_livepatch_modinfo(struct module *mod, struct load_info *info) 2797static int check_modinfo_livepatch(struct module *mod, struct load_info *info)
2796{ 2798{
2797 mod->klp = get_modinfo(info, "livepatch") ? true : false; 2799 if (get_modinfo(info, "livepatch")) {
2800 mod->klp = true;
2801 add_taint_module(mod, TAINT_LIVEPATCH, LOCKDEP_STILL_OK);
2802 }
2798 2803
2799 return 0; 2804 return 0;
2800} 2805}
2801#else /* !CONFIG_LIVEPATCH */ 2806#else /* !CONFIG_LIVEPATCH */
2802static int find_livepatch_modinfo(struct module *mod, struct load_info *info) 2807static int check_modinfo_livepatch(struct module *mod, struct load_info *info)
2803{ 2808{
2804 if (get_modinfo(info, "livepatch")) { 2809 if (get_modinfo(info, "livepatch")) {
2805 pr_err("%s: module is marked as livepatch module, but livepatch support is disabled", 2810 pr_err("%s: module is marked as livepatch module, but livepatch support is disabled",
@@ -2969,7 +2974,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
2969 "is unknown, you have been warned.\n", mod->name); 2974 "is unknown, you have been warned.\n", mod->name);
2970 } 2975 }
2971 2976
2972 err = find_livepatch_modinfo(mod, info); 2977 err = check_modinfo_livepatch(mod, info);
2973 if (err) 2978 if (err)
2974 return err; 2979 return err;
2975 2980