提交 79d54b24 编写于 作者: O Oleg Nesterov

uprobes: Do not leak UTASK_BP_HIT if find_active_uprobe() fails

If handle_swbp()->find_active_uprobe() fails we return with
utask->state = UTASK_BP_HIT.

Change handle_swbp() to reset utask->state at the start. Note
that we do this unconditionally, see the next patch(es).
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
上级 1d787d37
...@@ -1468,6 +1468,10 @@ static void handle_swbp(struct pt_regs *regs) ...@@ -1468,6 +1468,10 @@ static void handle_swbp(struct pt_regs *regs)
bp_vaddr = uprobe_get_swbp_addr(regs); bp_vaddr = uprobe_get_swbp_addr(regs);
uprobe = find_active_uprobe(bp_vaddr, &is_swbp); uprobe = find_active_uprobe(bp_vaddr, &is_swbp);
utask = current->utask;
if (utask)
utask->state = UTASK_RUNNING;
if (!uprobe) { if (!uprobe) {
if (is_swbp > 0) { if (is_swbp > 0) {
/* No matching uprobe; signal SIGTRAP. */ /* No matching uprobe; signal SIGTRAP. */
...@@ -1486,7 +1490,6 @@ static void handle_swbp(struct pt_regs *regs) ...@@ -1486,7 +1490,6 @@ static void handle_swbp(struct pt_regs *regs)
return; return;
} }
utask = current->utask;
if (!utask) { if (!utask) {
utask = add_utask(); utask = add_utask();
/* Cannot allocate; re-execute the instruction. */ /* Cannot allocate; re-execute the instruction. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册