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:	Wed, 10 Sep 2008 21:42:52 +0200 (CEST)
From:	Sven Wegener <sven.wegener@...aler.net>
To:	Ingo Molnar <mingo@...hat.com>, Neil Brown <neilb@...e.de>
cc:	linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: md: Check for memory allocation failure in faulty personality

It's a fault injection module, but I don't think we should oops here.

Signed-off-by: Sven Wegener <sven.wegener@...aler.net>
---
 drivers/md/faulty.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Other personalities return -EIO, when something like this happens, but I 
don't see a reason why we shouldn't return the more appropriate -ENOMEM 
here.

diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 268547d..f26c1f9 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -287,6 +287,8 @@ static int run(mddev_t *mddev)
 	int i;
 
 	conf_t *conf = kmalloc(sizeof(*conf), GFP_KERNEL);
+	if (!conf)
+		return -ENOMEM;
 
 	for (i=0; i<Modes; i++) {
 		atomic_set(&conf->counters[i], 0);
--
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