Commit a555ad45 authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9e7543e9
...@@ -155,8 +155,6 @@ int copy_thread(unsigned long clone_flags, ...@@ -155,8 +155,6 @@ int copy_thread(unsigned long clone_flags,
*/ */
void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp) void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
{ {
set_fs(USER_DS); /* user space */
regs->sp = usp; regs->sp = usp;
regs->ret = pc; regs->ret = pc;
......
...@@ -101,7 +101,6 @@ void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp) ...@@ -101,7 +101,6 @@ void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp)
*/ */
usp -= 8; usp -= 8;
set_fs(USER_DS);
regs->pc = pc; regs->pc = pc;
regs->sp = usp; regs->sp = usp;
regs->tsr |= 0x40; /* set user mode */ regs->tsr |= 0x40; /* set user mode */
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
*/ */
void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
{ {
/* Set to run with user-mode data segmentation */
set_fs(USER_DS);
/* We want to zero all data-containing registers. Is this overkill? */ /* We want to zero all data-containing registers. Is this overkill? */
memset(regs, 0, sizeof(*regs)); memset(regs, 0, sizeof(*regs));
/* We might want to also zero all Processor registers here */ /* We might want to also zero all Processor registers here */
......
...@@ -111,7 +111,6 @@ struct thread_struct { ...@@ -111,7 +111,6 @@ struct thread_struct {
*/ */
#define start_thread(regs, pc, usp) do { \ #define start_thread(regs, pc, usp) do { \
unsigned int *argc = (unsigned int *) bprm->exec; \ unsigned int *argc = (unsigned int *) bprm->exec; \
set_fs(USER_DS); \
current->thread.int_depth = 1; \ current->thread.int_depth = 1; \
/* Force this process down to user land */ \ /* Force this process down to user land */ \
regs->ctx.SaveMask = TBICTX_PRIV_BIT; \ regs->ctx.SaveMask = TBICTX_PRIV_BIT; \
......
...@@ -94,7 +94,6 @@ void show_regs(struct pt_regs *regs) ...@@ -94,7 +94,6 @@ void show_regs(struct pt_regs *regs)
void flush_thread(void) void flush_thread(void)
{ {
set_fs(USER_DS);
} }
int copy_thread(unsigned long clone_flags, int copy_thread(unsigned long clone_flags,
......
...@@ -197,7 +197,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) ...@@ -197,7 +197,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
{ {
unsigned long sr = mfspr(SPR_SR) & ~SPR_SR_SM; unsigned long sr = mfspr(SPR_SR) & ~SPR_SR_SM;
set_fs(USER_DS);
memset(regs, 0, sizeof(struct pt_regs)); memset(regs, 0, sizeof(struct pt_regs));
regs->pc = pc; regs->pc = pc;
......
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