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]
Date:   Thu, 19 Oct 2017 11:29:43 +0200
From:   Jessica Yu <jeyu@...nel.org>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:     kernel-janitors@...r.kernel.org,
        Rusty Russell <rusty@...tcorp.com.au>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: kernel/module: Delete an error message for a failed memory
 allocation in add_module_usage()

+++ SF Markus Elfring [06/10/17 17:12 +0200]:
>From: Markus Elfring <elfring@...rs.sourceforge.net>
>Date: Fri, 6 Oct 2017 16:27:26 +0200
>
>Omit an extra message for a memory allocation failure in this function.
>
>This issue was detected by using the Coccinelle software.
>
>Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
>---
> kernel/module.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index de66ec825992..07ef44767245 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -837,10 +837,8 @@ static int add_module_usage(struct module *a, struct module *b)
>
> 	pr_debug("Allocating new usage for %s.\n", a->name);
> 	use = kmalloc(sizeof(*use), GFP_ATOMIC);
>-	if (!use) {
>-		pr_warn("%s: out of memory loading\n", a->name);
>+	if (!use)
> 		return -ENOMEM;
>-	}

IMO this is removing useful information. Although stack traces are
generated on alloc failures, the extra print also tells us which
module we were trying to load at the time the memory allocation
failed.

Jessica

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ