diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-09-02 13:57:33 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-09-02 17:51:17 -0400 |
commit | 6f46b3aef0031c08a7b439d63013dad2aeb093b2 (patch) | |
tree | 939cceda0d84c419d3ee35f6c2625734a4218be2 | |
parent | dc56c0f9b870fba7a4eef2bb463db6881284152b (diff) |
x86: copy_thread: Don't nullify ->ptrace_bps twice
Both 32bit and 64bit versions of copy_thread() do memset(ptrace_bps)
twice for no reason, kill the 2nd memset().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20140902175733.GA21676@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | arch/x86/kernel/process_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/process_64.c | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index c73b3c1a582b..8f3ebfe710d0 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -138,6 +138,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
138 | 138 | ||
139 | p->thread.sp = (unsigned long) childregs; | 139 | p->thread.sp = (unsigned long) childregs; |
140 | p->thread.sp0 = (unsigned long) (childregs+1); | 140 | p->thread.sp0 = (unsigned long) (childregs+1); |
141 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); | ||
141 | 142 | ||
142 | if (unlikely(p->flags & PF_KTHREAD)) { | 143 | if (unlikely(p->flags & PF_KTHREAD)) { |
143 | /* kernel thread */ | 144 | /* kernel thread */ |
@@ -153,7 +154,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
153 | childregs->cs = __KERNEL_CS | get_kernel_rpl(); | 154 | childregs->cs = __KERNEL_CS | get_kernel_rpl(); |
154 | childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED; | 155 | childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED; |
155 | p->thread.io_bitmap_ptr = NULL; | 156 | p->thread.io_bitmap_ptr = NULL; |
156 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); | ||
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
159 | *childregs = *current_pt_regs(); | 159 | *childregs = *current_pt_regs(); |
@@ -168,8 +168,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
168 | tsk = current; | 168 | tsk = current; |
169 | err = -ENOMEM; | 169 | err = -ENOMEM; |
170 | 170 | ||
171 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); | ||
172 | |||
173 | if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { | 171 | if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { |
174 | p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr, | 172 | p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr, |
175 | IO_BITMAP_BYTES, GFP_KERNEL); | 173 | IO_BITMAP_BYTES, GFP_KERNEL); |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 593257def776..3ed4a68d4013 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -192,8 +192,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
192 | childregs->sp = sp; | 192 | childregs->sp = sp; |
193 | 193 | ||
194 | err = -ENOMEM; | 194 | err = -ENOMEM; |
195 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); | ||
196 | |||
197 | if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { | 195 | if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { |
198 | p->thread.io_bitmap_ptr = kmemdup(me->thread.io_bitmap_ptr, | 196 | p->thread.io_bitmap_ptr = kmemdup(me->thread.io_bitmap_ptr, |
199 | IO_BITMAP_BYTES, GFP_KERNEL); | 197 | IO_BITMAP_BYTES, GFP_KERNEL); |