lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLGD1fXsGMCQbP8aAMDsRiwPD2hHcfWfupO4jy5=JCM=NA@mail.gmail.com>
Date:	Sun, 10 Mar 2013 16:10:56 +0200
From:	Pekka Enberg <penberg@...nel.org>
To:	Alex Grad <alex.grad@...il.com>
Cc:	benh@...nel.crashing.org, paulus@...ba.org, mikey@...ling.org,
	tiejun.chen@...driver.com, jason.wessel@...driver.com,
	fr@...b.auug.org.au, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kgdb: Removed kmalloc returned value cast

On Sun, Mar 10, 2013 at 3:06 PM, Alex Grad <alex.grad@...il.com> wrote:
> Signed-off-by: Alex Grad <alex.grad@...il.com>
> ---
>  arch/powerpc/kernel/kgdb.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
> index 5ca82cd..c1eef24 100644
> --- a/arch/powerpc/kernel/kgdb.c
> +++ b/arch/powerpc/kernel/kgdb.c
> @@ -159,7 +159,7 @@ static int kgdb_singlestep(struct pt_regs *regs)
>         if (user_mode(regs))
>                 return 0;
>
> -       backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
> +       backup_current_thread_info = kmalloc(sizeof(struct thread_info), GFP_KERNEL);

Looks good to me.

There's two additional problems in the kgdb_singlestep() function: it
doesn't check if the kmalloc() call fails nor does it kfree() the
allocated memory.

                        Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ