Skip to content

Commit a555ad4

Browse files
author
Al Viro
committed
whack-a-mole: no need to set_fs(USER_DS) in {start,flush}_thread()
flush_old_exec() has already done that. Back on 2011 a bunch of instances like that had been kicked out, but that hadn't taken care of then-out-of-tree architectures, obviously, and they served as reinfection vector... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 9e7543e commit a555ad4

6 files changed

Lines changed: 0 additions & 8 deletions

File tree

‎arch/arc/kernel/process.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ int copy_thread(unsigned long clone_flags,
155155
*/
156156
void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
157157
{
158-
set_fs(USER_DS); /* user space */
159-
160158
regs->sp = usp;
161159
regs->ret = pc;
162160

‎arch/c6x/kernel/process.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp)
101101
*/
102102
usp -= 8;
103103

104-
set_fs(USER_DS);
105104
regs->pc = pc;
106105
regs->sp = usp;
107106
regs->tsr |= 0x40; /* set user mode */

‎arch/hexagon/kernel/process.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
*/
3838
void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
3939
{
40-
/* Set to run with user-mode data segmentation */
41-
set_fs(USER_DS);
4240
/* We want to zero all data-containing registers. Is this overkill? */
4341
memset(regs, 0, sizeof(*regs));
4442
/* We might want to also zero all Processor registers here */

‎arch/metag/include/asm/processor.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ struct thread_struct {
111111
*/
112112
#define start_thread(regs, pc, usp) do { \
113113
unsigned int *argc = (unsigned int *) bprm->exec; \
114-
set_fs(USER_DS); \
115114
current->thread.int_depth = 1; \
116115
/* Force this process down to user land */ \
117116
regs->ctx.SaveMask = TBICTX_PRIV_BIT; \

‎arch/nios2/kernel/process.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ void show_regs(struct pt_regs *regs)
9494

9595
void flush_thread(void)
9696
{
97-
set_fs(USER_DS);
9897
}
9998

10099
int copy_thread(unsigned long clone_flags,

‎arch/openrisc/kernel/process.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
197197
{
198198
unsigned long sr = mfspr(SPR_SR) & ~SPR_SR_SM;
199199

200-
set_fs(USER_DS);
201200
memset(regs, 0, sizeof(struct pt_regs));
202201

203202
regs->pc = pc;

0 commit comments

Comments
 (0)