Skip to contentSkip to conversation

x86/process: Export start_thread()

PATCH In review Rian Hunter 4 participants 6 messages Aug 19, 2018 – Aug 20, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/process: Export start_thread()

Commit e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") removed exporting for the start_thread() function in what seems like a typo. Add it back to arch/x86/kernel/process_64.c for parity with process_32.c and other arch.

---
 arch/x86/kernel/process_64.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c +1 -0
index 476e3ddf8890..a451bc374b9b 100644
@@ -384,6 +384,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	start_thread_common(regs, new_ip, new_sp,
 			    __USER_CS, __USER_DS, 0);
 }
+EXPORT_SYMBOL_GPL(start_thread);
 
 #ifdef CONFIG_COMPAT
 void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)
Signature · 1 line
2.16.3
#1 lore raw
Quoted 9 lines · Rian Hunter

Commit e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") removed exporting for the start_thread() function in what seems like a typo. Add it back to arch/x86/kernel/process_64.c for parity with process_32.c and other arch.

What for? Perhaps 32-bit could remove it instead?

Quoted 21 lines

---
arch/x86/kernel/process_64.c | 1 +

1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c +1 -0
index 476e3ddf8890..a451bc374b9b 100644
@@ -384,6 +384,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
   start_thread_common(regs, new_ip, new_sp,
               __USER_CS, __USER_DS, 0);
 }
+EXPORT_SYMBOL_GPL(start_thread);
 
 #ifdef CONFIG_COMPAT
 void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)
Signature · 1 line
2.16.3
#2 lore raw
Quoted 10 lines · Andy Lutomirski
Quoted 7 lines · Rian Hunter

Commit e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") removed exporting for the start_thread() function in what seems like a typo. Add it back to arch/x86/kernel/process_64.c for parity with process_32.c and other arch.

What for? Perhaps 32-bit could remove it instead?

Came across this while writing a binfmt module. Useful for me but probably no one else on Earth, at least for another ~9 years on average.

Quoted 21 lines
Quoted 21 lines

---
arch/x86/kernel/process_64.c | 1 +

1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c +1 -0
index 476e3ddf8890..a451bc374b9b 100644
@@ -384,6 +384,7 @@ start_thread(struct pt_regs *regs, unsigned long 
 new_ip, unsigned long new_sp)
   start_thread_common(regs, new_ip, new_sp,
               __USER_CS, __USER_DS, 0);
 }
+EXPORT_SYMBOL_GPL(start_thread);
 
 #ifdef CONFIG_COMPAT

void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp) --
2.16.3

#3 lore raw
In reply to Andy Lutomirski
Quoted 9 lines · Andy Lutomirski
Quoted 7 lines · Rian Hunter

Commit e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") removed exporting for the start_thread() function in what seems like a typo. Add it back to arch/x86/kernel/process_64.c for parity with process_32.c and other arch.

What for? Perhaps 32-bit could remove it instead?

No. start_thread() is called from various binfmt implementations which can be built as modules.

Thanks,

tglx

#4 lore raw
Quoted 13 lines · Thomas Gleixner
Quoted 8 lines · Andy Lutomirski
Quoted 7 lines · Rian Hunter

Commit e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions") removed exporting for the start_thread() function in what seems like a typo. Add it back to arch/x86/kernel/process_64.c for parity with process_32.c and other arch.

Quoted 4 lines
Quoted 1 line

What for? Perhaps 32-bit could remove it instead?

No. start_thread() is called from various binfmt implementations which can be built as modules.

Fair enough. I’m fine with the patch.

Quoted 4 lines

Thanks,

tglx

#5 lore raw

[tip:x86/urgent] x86/process: Re-export start_thread()

In reply to Rian Hunter
x86/process: Re-export start_thread()
Commit-ID:  dc76803e57cc86589c4efcb5362918f9b0c0436f
Gitweb:     https://git.kernel.org/tip/dc76803e57cc86589c4efcb5362918f9b0c0436f
Author:     Rian Hunter <[email protected]>
AuthorDate: Sun, 19 Aug 2018 16:08:53 -0700
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Aug 2018 18:04:42 +0200

x86/process: Re-export start_thread()

The consolidation of the start_thread() functions removed the export unintentionally. This breaks binfmt handlers built as a module.

Add it back.

Fixes e634d8fc792c ("x86-64: merge the standard and compat start_thread() functions")
Cc "H. Peter Anvin" <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Josh Poimboeuf <[email protected]>
---
 arch/x86/kernel/process_64.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c +1 -0
index 476e3ddf8890..a451bc374b9b 100644
@@ -384,6 +384,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	start_thread_common(regs, new_ip, new_sp,
 			    __USER_CS, __USER_DS, 0);
 }
+EXPORT_SYMBOL_GPL(start_thread);
 
 #ifdef CONFIG_COMPAT
 void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp)