mirror-linux/arch/x86/kernel/cpu/mce
Tony Luck 7ccddc4613 x86/mce/dev-mcelog: Fix -Wstringop-truncation warning about strncpy()
The kbuild test robot reported this warning:

  arch/x86/kernel/cpu/mce/dev-mcelog.c: In function 'dev_mcelog_init_device':
  arch/x86/kernel/cpu/mce/dev-mcelog.c:346:2: warning: 'strncpy' output \
    truncated before terminating nul copying 12 bytes from a string of the \
    same length [-Wstringop-truncation]

This is accurate, but I don't care that the trailing NUL character isn't
copied. The string being copied is just a magic number signature so that
crash dump tools can be sure they are decoding the right blob of memory.

Use memcpy() instead of strncpy().

Fixes: d8ecca4043 ("x86/mce/dev-mcelog: Dynamically allocate space for machine check records")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200527182808.27737-1-tony.luck@intel.com
2020-06-11 15:19:17 +02:00
..
Makefile
amd.c Merge branch 'x86/entry' into ras/core 2020-06-11 15:17:57 +02:00
apei.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
core.c x86/{mce,mm}: Unmap the entire page if the whole page is affected and poisoned 2020-06-11 15:19:17 +02:00
dev-mcelog.c x86/mce/dev-mcelog: Fix -Wstringop-truncation warning about strncpy() 2020-06-11 15:19:17 +02:00
genpool.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 437 2019-06-05 17:37:17 +02:00
inject.c x86/entry: Convert Machine Check to IDTENTRY_IST 2020-06-11 15:14:57 +02:00
intel.c * Do not report spurious MCEs on some Intel platforms caused by errata; 2020-03-30 13:17:50 -07:00
internal.h Merge branch 'x86/entry' into ras/core 2020-06-11 15:17:57 +02:00
p5.c x86/mce: Address objtools noinstr complaints 2020-06-11 15:15:02 +02:00
severity.c x86/mce: Fixup exception only for the correct MCEs 2020-04-14 16:01:49 +02:00
therm_throt.c x86/entry: Convert various system vectors 2020-06-11 15:15:14 +02:00
threshold.c x86/entry: Convert various system vectors 2020-06-11 15:15:14 +02:00
winchip.c x86/mce: Address objtools noinstr complaints 2020-06-11 15:15:02 +02:00