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-next>] [day] [month] [year] [list]
Message-Id: <20191015064906.13833-1-efremov@linux.com>
Date:   Tue, 15 Oct 2019 09:49:06 +0300
From:   Denis Efremov <efremov@...ux.com>
To:     linux-kbuild@...r.kernel.org
Cc:     Denis Efremov <efremov@...ux.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] modpost: add NOFAIL to strdup call

Add NOFAIL check for the strdup call, since the function
allocates memory and can return NULL. All strdup calls in
modpost are checked with NOFAIL.

Signed-off-by: Denis Efremov <efremov@...ux.com>
---
 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 936d3ad23c83..8e8975065cbc 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -384,7 +384,7 @@ static struct symbol *sym_add_exported(const char *name, const char *namespace,
 		}
 	}
 	free(s->namespace);
-	s->namespace = namespace ? strdup(namespace) : NULL;
+	s->namespace = namespace ? NOFAIL(strdup(namespace)) : NULL;
 	s->preloaded = 0;
 	s->vmlinux   = is_vmlinux(mod->name);
 	s->kernel    = 0;
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ