diff options
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index d4a59657fb99..6f44f40204ed 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -133,23 +133,27 @@ static long arch_prctl_tt(int code, unsigned long addr) | |||
133 | 133 | ||
134 | #ifdef CONFIG_MODE_SKAS | 134 | #ifdef CONFIG_MODE_SKAS |
135 | 135 | ||
136 | /* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */ | ||
136 | static long arch_prctl_skas(int code, unsigned long addr) | 137 | static long arch_prctl_skas(int code, unsigned long addr) |
137 | { | 138 | { |
138 | long ret = 0; | 139 | long ret = 0; |
139 | 140 | ||
140 | switch(code){ | 141 | switch(code){ |
141 | case ARCH_SET_GS: | ||
142 | current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr; | ||
143 | break; | ||
144 | case ARCH_SET_FS: | 142 | case ARCH_SET_FS: |
145 | current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; | 143 | current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; |
146 | break; | 144 | break; |
145 | case ARCH_SET_GS: | ||
146 | current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr; | ||
147 | break; | ||
147 | case ARCH_GET_FS: | 148 | case ARCH_GET_FS: |
148 | ret = put_user(current->thread.regs.regs.skas.regs[GS / sizeof(unsigned long)], &addr); | 149 | ret = put_user(current->thread.regs.regs.skas. |
150 | regs[FS_BASE / sizeof(unsigned long)], | ||
151 | (unsigned long __user *)addr); | ||
149 | break; | 152 | break; |
150 | case ARCH_GET_GS: | 153 | case ARCH_GET_GS: |
151 | ret = put_user(current->thread.regs.regs.skas.regs[FS / sizeof(unsigned \ | 154 | ret = put_user(current->thread.regs.regs.skas. |
152 | long)], &addr); | 155 | regs[GS_BASE / sizeof(unsigned long)], |
156 | (unsigned long __user *)addr); | ||
153 | break; | 157 | break; |
154 | default: | 158 | default: |
155 | ret = -EINVAL; | 159 | ret = -EINVAL; |