Skip to contentSkip to conversation

kernel-add-support-for-init_array-constructors-fix.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 31, 2013

lore
Share & tools
lore
#0 lore raw

Subject: [merged] kernel-add-support-for-init_array-constructors-fix.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 31 Oct 2013 11:00:01 -0700

The patch titled
Subject: kernel: add support for init_array constructors
has been removed from the -mm tree. Its filename was
kernel-add-support-for-init_array-constructors-fix.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Rusty Russell <[email protected]>
Subject: kernel: add support for init_array constructors

v2: - reuse mod->ctors for .init_array section for modules, because gcc uses
.ctors or .init_array, but not both at the same time
v3: - fail to load if that does happen somehow.

Cc Jan Stancek <[email protected]>
Cc Kees Cook <[email protected]>
Cc Peter Oberparleiter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Gospodarek <[email protected]>

---

 kernel/module.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
kernel/module.c renamed from kernel/module.c~kernel-add-support-for-init_array-constructors-fix +15 -2
diff -puN kernel/module.c~kernel-add-support-for-init_array-constructors-fix kernel/module.c
@@ -2738,7 +2738,7 @@ static int check_modinfo(struct module *
 	return 0;
 }
 
-static void find_module_sections(struct module *mod, struct load_info *info)
+static int find_module_sections(struct module *mod, struct load_info *info)
 {
 	mod->kp = section_objs(info, "__param",
 			       sizeof(*mod->kp), &mod->num_kp);
@@ -2771,6 +2771,15 @@ static void find_module_sections(struct
 	if (!mod->ctors)
 		mod->ctors = section_objs(info, ".init_array",
 				sizeof(*mod->ctors), &mod->num_ctors);
+	else if (find_sec(info, ".init_array")) {
+		/*
+		 * This shouldn't happen with same compiler and binutils
+		 * building all parts of the module.
+		 */
+		printk(KERN_WARNING "%s: has both .ctors and .init_array.\n",
+		       mod->name);
+		return -EINVAL;
+	}
 #endif
 
 #ifdef CONFIG_TRACEPOINTS
@@ -2809,6 +2818,8 @@ static void find_module_sections(struct
 
 	info->debug = section_objs(info, "__verbose",
 				   sizeof(*info->debug), &info->num_debug);
+
+	return 0;
 }
 
 static int move_module(struct module *mod, struct load_info *info)
@@ -3266,7 +3277,9 @@ static int load_module(struct load_info
 
 	/* Now we've got everything in the final locations, we can
 	 * find optional sections. */
-	find_module_sections(mod, info);
+	err = find_module_sections(mod, info);
+	if (err)
+		goto free_unload;
 
 	err = check_module_license_and_versions(mod);
 	if (err)

_

Patches currently in -mm which might be from [email protected] are

scripts-sortextable-support-objects-with-more-than-64k-sections.patch gcov-move-gcov-structs-definitions-to-a-gcc-version-specific-file.patch gcov-add-support-for-gcc-47-gcov-format.patch gcov-compile-specific-gcov-implementation-based-on-gcc-version.patch kernel-modulec-use-pr_foo.patch kernel-gcov-fsc-use-pr_warn.patch
linux-next.patch