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>] [day] [month] [year] [list]
Date:	Tue, 18 May 2010 15:11:04 +0800
From:	Steven Liu <lingjiujianke@...il.com>
To:	starvik@...s.com, "Gerald (Jerry) Carter" <jerry@...ba.org>,
	linux-kernel@...r.kernel.org, liuqi@...nderst.com
Subject: [PATCH] cris: check kmalloc return value before use data

check kmalloc return value before use data

Signed-off-by: Liu Qi <lingjiujianke@...il.com>
---
 arch/cris/arch-v32/kernel/signal.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/cris/arch-v32/kernel/signal.c
b/arch/cris/arch-v32/kernel/signal.c
index 0b7e3f1..534eea3 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -656,6 +656,10 @@ int __init
 cris_init_signal(void)
 {
        u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);
+       if(!data){
+               printk(KERN_ERR "kmalloc failed in %s\n", __func__);
+               return -ENOMEM;
+       }

        /* This is movu.w __NR_sigreturn, r9; break 13; */
        data[0] = 0x9c5f;
--
1.7.1
--
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