Skip to content

Commit

Permalink
sparc64: exit_group should kill register windows just like plain exit.
Browse files Browse the repository at this point in the history
Reported-by: Al Viro <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Dec 3, 2012
1 parent 7e5530a commit de7531e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/kernel/sys32.S
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ STUB: sra REG1, 0, REG1; \
sra REG4, 0, REG4

SIGN1(sys32_exit, sparc_exit, %o0)
SIGN1(sys32_exit_group, sys_exit_group, %o0)
SIGN1(sys32_exit_group, sparc_exit_group, %o0)
SIGN1(sys32_wait4, compat_sys_wait4, %o2)
SIGN1(sys32_creat, sys_creat, %o1)
SIGN1(sys32_mknod, sys_mknod, %o1)
Expand Down
14 changes: 12 additions & 2 deletions arch/sparc/kernel/syscalls.S
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,28 @@ ret_from_syscall:
ba,pt %xcc, ret_sys_call
ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0

.globl sparc_exit_group
.type sparc_exit_group,#function
sparc_exit_group:
sethi %hi(sys_exit_group), %g7
ba,pt %xcc, 1f
or %g7, %lo(sys_exit_group), %g7
.size sparc_exit_group,.-sparc_exit_group

.globl sparc_exit
.type sparc_exit,#function
sparc_exit:
rdpr %pstate, %g2
sethi %hi(sys_exit), %g7
or %g7, %lo(sys_exit), %g7
1: rdpr %pstate, %g2
wrpr %g2, PSTATE_IE, %pstate
rdpr %otherwin, %g1
rdpr %cansave, %g3
add %g3, %g1, %g3
wrpr %g3, 0x0, %cansave
wrpr %g0, 0x0, %otherwin
wrpr %g2, 0x0, %pstate
ba,pt %xcc, sys_exit
jmpl %g7, %g0
stb %g0, [%g6 + TI_WSAVED]
.size sparc_exit,.-sparc_exit

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/systbls_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ sys_call_table:
/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
.word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
.word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
.word sys_setpgid, sys_fremovexattr, sys_tkill, sparc_exit_group, sys_newuname
/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
.word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
Expand Down

0 comments on commit de7531e

Please sign in to comment.