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: <20201102142001.560490-1-lee.jones@linaro.org>
Date:   Mon,  2 Nov 2020 14:20:00 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     gregkh@...uxfoundation.org, arnd@...db.de
Cc:     linux-kernel@...r.kernel.org, Lee Jones <lee.jones@...aro.org>,
        Rodolfo Giometti <giometti@...eenne.com>,
        "Eurotech S.p.A" <info@...otech.it>,
        David Laight <David.Laight@...lab.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH v2 1/2] misc: c2port: core: Make copying name from userspace more secure

Currently the 'c2dev' device data is not initialised when it's
allocated.  There maybe an issue when using strncpy() to populate the
'name' attribute since a NUL terminator may not be provided in all
use-cases.  To prevent such a failing, let's ensure the 'c2dev'
device data area is fully zeroed out on allocation.

Cc: Rodolfo Giometti <giometti@...eenne.com>
Cc: "Eurotech S.p.A" <info@...otech.it>
Cc: David Laight <David.Laight@...lab.com>
Reported-by: Geert Uytterhoeven <geert+renesas@...der.be>
Acked-by: Arnd Bergmann <arnd@...db.de>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 drivers/misc/c2port/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index 80d87e8a0bea9..fb9a1b49ff6de 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -899,7 +899,7 @@ struct c2port_device *c2port_device_register(char *name,
 		unlikely(!ops->c2d_get) || unlikely(!ops->c2d_set))
 		return ERR_PTR(-EINVAL);
 
-	c2dev = kmalloc(sizeof(struct c2port_device), GFP_KERNEL);
+	c2dev = kzalloc(sizeof(struct c2port_device), GFP_KERNEL);
 	if (unlikely(!c2dev))
 		return ERR_PTR(-ENOMEM);
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ