From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: fweisbec@gmail.com, benh@kernel.crashing.org, paulus@samba.org,
prasad.krishnan@gmail.com
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
emachado@linux.vnet.ibm.com
Subject: [PATCH] PPC Hardware Breakpoints: Fix incorrect pointer access
Date: Fri, 06 Jul 2012 17:00:58 +0530 [thread overview]
Message-ID: <20120706113058.8600.30142.stgit@localhost.localdomain> (raw)
If arch_validate_hwbkpt_settings() fails, bp->ctx won't be valid and the
kernel panics. Add a check to fix this.
Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/hw_breakpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 2bc0584..f3a82dd 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -111,7 +111,7 @@ void arch_unregister_hw_breakpoint(struct perf_event *bp)
* and the single_step_dabr_instruction(), then cleanup the breakpoint
* restoration variables to prevent dangling pointers.
*/
- if (bp->ctx->task)
+ if (bp->ctx && bp->ctx->task)
bp->ctx->task->thread.last_hit_ubp = NULL;
}
next reply other threads:[~2012-07-06 11:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 11:30 Naveen N. Rao [this message]
2012-07-18 10:38 ` [PATCH RESEND] PPC Hardware Breakpoints: Fix incorrect pointer access Naveen N. Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120706113058.8600.30142.stgit@localhost.localdomain \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=emachado@linux.vnet.ibm.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=prasad.krishnan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).