EDAC/ghes: Set the DIMM label unconditionally
Toshi Kani authored
commit 5e2805d5 upstream.

The commit

  cb51a371 ("EDAC/ghes: Setup DIMM label from DMI and use it in error reports")

enforced that both the bank and device strings passed to
dimm_setup_label() are not NULL.

However, there are BIOSes, for example on a

  HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 03/15/2019

which don't populate both strings:

  Handle 0x0020, DMI type 17, 84 bytes
  Memory Device
          Array Handle: 0x0013
          Error Information Handle: Not Provided
          Total Width: 72 bits
          Data Width: 64 bits
          Size: 32 GB
          Form Factor: DIMM
          Set: None
          Locator: PROC 1 DIMM 1        <===== device
          Bank Locator: Not Specified   <===== bank

This results in a buffer overflow because ghes_edac_register() calls
strlen() on an uninitialized label, which had non-zero values left over
from krealloc_array():

  detected buffer overflow in __fortif...
e936e552
Name Last commit Last update
Documentation Documentation: fix sctp_wmem in ip-sysctl.rst
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers
arch ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
block block: pop cached rq before potentially blocking rq_qos_throttle()
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist
crypto crypto: memneq - move into lib/
drivers EDAC/ghes: Set the DIMM label unconditionally
fs fs: sendfile handles O_NONBLOCK of out_fd
include net: Fix data-races around sysctl_[rw]mem(_offset)?.
init gcc-12: disable '-Warray-bounds' universally for now
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree()
kernel watch_queue: Fix missing locking in add_watch_to_object()
lib ida: don't use BUG_ON() for debugging
mm page_alloc: fix invalid watermark check on a negative value
net tcp: Fix data-races around sysctl_tcp_workaround_signed_windows.
samples samples/landlock: Format with clang-format
scripts x86/retbleed: Add fine grained Kconfig knobs
security lockdown: Fix kexec lockdown bypass with ima policy
sound ASoC: SOF: Intel: disable IMR boot when resuming from ACPI S4 and S5 states
tools perf symbol: Correct address for bss symbols
usr Merge tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
virt KVM: Don't null dereference ops->destroy
.clang-format genirq/msi: Make interrupt allocation less convoluted
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.