aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPhilipp Rudo <prudo@linux.vnet.ibm.com>2017-04-11 14:28:51 +0100
committerPedro Alves <palves@redhat.com>2017-04-11 14:28:51 +0100
commita6acac06113f4b04fa0333ee2a3ab3025b43ee7c (patch)
treec49d011da715d7eb940f9b54ed3fac91f63725f4 /gdb/linux-nat.c
parent64403bd1832e10aa8324194968f72bdc5feb5aeb (diff)
Fix read after xfree in linux-nat.c:linux_nat_detach
At the end of linux_nat_detach the main_lwp is deleted (delete_lwp). This is problematic as during detach (detach_one_lwp and linux_fork_detach) main_lwp already gets freed. Thus calling delete_lwp causes a read after free. Fix it by removing the unnecessary delete_lwp. gdb/ChangeLog: 2017-04-11 Philipp Rudo <prudo@linux.vnet.ibm.com> * linux-nat.c (linux_nat_detach): Remove delete_lwp call.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index b06e400fdc..8dececf2c5 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1549,7 +1549,6 @@ linux_nat_detach (struct target_ops *ops, const char *args, int from_tty)
inf_ptrace_detach_success (ops);
}
- delete_lwp (main_lwp->ptid);
}
/* Resume execution of the inferior process. If STEP is nonzero,