2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 01:04:08 +08:00
linux-next/drivers/s390
Kees Cook 096a8aac6b clean up scary strncpy(dst, src, strlen(src)) uses
Fix various weird constructions of strncpy(dst, src, strlen(src)).

Length limits should be about the space available in the destination,
not repurposed as a method to either always include or always exclude a
trailing NULL byte.  Either the NULL should always be copied (using
strlcpy), or it should not be copied (using something like memcpy).
Readable code should not depend on the weird behavior of strncpy when it
hits the length limit.  Better to avoid the anti-pattern entirely.

[akpm@linux-foundation.org: revert getdelays.c part due to missing bsd/string.h]
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>	[staging]
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>	[acpi]
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ursula Braun <ursula.braun@de.ibm.com>
Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03 16:07:41 -07:00
..
block s390/dasd: fix handling of gone paths 2013-05-31 17:23:49 +02:00
char s390/memory hotplug,sclp: get rid of per memory increment usecount 2013-05-02 15:50:28 +02:00
cio s390/cio: add channel ID sysfs attribute 2013-05-15 16:47:39 +02:00
crypto s390/zcrypt: ap bus rescan problem when toggle crypto adapters on/off 2013-05-02 17:10:20 +02:00
kvm Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2013-05-05 14:47:31 -07:00
net clean up scary strncpy(dst, src, strlen(src)) uses 2013-07-03 16:07:41 -07:00
scsi s390/time: rename tod clock access functions 2013-02-14 15:55:10 +01:00
Makefile [S390] split/move machine check handler code 2009-03-26 15:24:10 +01:00