From: Manish Ahuja <ahuja@austin.ibm.com>
To: Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Manish Ahuja <mahuja@us.ibm.com>,
LinuxPPC-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] Protect against NULL pointer deref in phyp-dump code.
Date: Tue, 16 Dec 2008 16:18:23 -0600 [thread overview]
Message-ID: <4948292F.8080402@austin.ibm.com> (raw)
In-Reply-To: <20081216041748.GB14890@ozlabs.org>
Acked-by: Manish Ahuja <mahujam@gmail.com>
Tony Breeds wrote:
> print_dump_header() will be called at least once with a NULL pointer in
> a normal boot sequence. if DEBUG is defined then we will get a deref,
> add a quick fix to exit early in the NULL pointer case.
>
> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
> ---
> arch/powerpc/platforms/pseries/phyp_dump.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
> index edbc012..16e659a 100644
> --- a/arch/powerpc/platforms/pseries/phyp_dump.c
> +++ b/arch/powerpc/platforms/pseries/phyp_dump.c
> @@ -130,6 +130,9 @@ static unsigned long init_dump_header(struct phyp_dump_header *ph)
> static void print_dump_header(const struct phyp_dump_header *ph)
> {
> #ifdef DEBUG
> + if (ph == NULL)
> + return;
> +
> printk(KERN_INFO "dump header:\n");
> /* setup some ph->sections required */
> printk(KERN_INFO "version = %d\n", ph->version);
--
--
Manish Ahuja
Linux RAS Engineer.
IBM Linux Technology Center
mahuja@us.ibm.com
512-838-1928, t/l 678-1928.
prev parent reply other threads:[~2008-12-16 22:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 4:17 [PATCH] Protect against NULL pointer deref in phyp-dump code Tony Breeds
2008-12-16 22:18 ` Manish Ahuja [this message]
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=4948292F.8080402@austin.ibm.com \
--to=ahuja@austin.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahuja@us.ibm.com \
--cc=paulus@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.