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: <4B019FC2.3060004@gmail.com>
Date:	Mon, 16 Nov 2009 19:53:54 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	linux390@...ibm.com, linux-s390@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] s390: ensure NUL termination by strncpy()

For a larger source string, strncpy only NUL terminates when
the size argument is less than the size of the destination string.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
 arch/s390/kernel/ipl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Is this maybe needed?

diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 4890ac6..d52fcb4 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1881,7 +1881,7 @@ void __init setup_ipl(void)
 		break;
 	case IPL_TYPE_NSS:
 		strncpy(ipl_info.data.nss.name, kernel_nss_name,
-			sizeof(ipl_info.data.nss.name));
+			sizeof(ipl_info.data.nss.name) - 1);
 		break;
 	case IPL_TYPE_UNKNOWN:
 		/* We have no info to copy */
--
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