linux-stable/drivers
Qian Cai eabd5e7d8b drivers/base/test: fix global-out-of-bounds error
Commit c032ace71c ("software node: add basic tests for property
entries") introduced a global-out-of-bounds error because it forgot to
add a terminator of "nodes "for software_node_register_nodes() to
process.

 	# Subtest: property-entry
 	1..7
 	ok 1 - pe_test_uints
 	ok 2 - pe_test_uint_arrays
 	ok 3 - pe_test_strings
 	ok 4 - pe_test_bool
 	ok 5 - pe_test_move_inline_u8
 	ok 6 - pe_test_move_inline_str
 ==================================================================
 BUG: KASAN: global-out-of-bounds in
 software_node_register_nodes+0x41/0x80
 Read of size 8 at addr ffffffff989ef250 by task kunit_try_catch/316

 CPU: 17 PID: 316 Comm: kunit_try_catch Not tainted
 5.5.0-rc4-next-20200106+ #1
 Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40
 03/09/2018
 Call Trace:
  dump_stack+0xa0/0xea
  print_address_description.constprop.5.cold.7+0x64/0x384
  __kasan_report.cold.8+0x7a/0xc0
  kasan_report+0x12/0x20
  __asan_load8+0x71/0xa0
  software_node_register_nodes+0x41/0x80
  pe_test_reference+0x1eb/0x1200
  kunit_try_run_case+0x6b/0xd1
  kunit_generic_run_threadfn_adapter+0x29/0x50
  kthread+0x1e6/0x210
  ret_from_fork+0x27/0x50

 The buggy address belongs to the variable:
  nodes.21544+0x30/0x920

 Memory state around the buggy address:
  ffffffff989ef100: fa fa fa fa 00 04 fa fa fa fa fa fa 00 00 00 00
  ffffffff989ef180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 >ffffffff989ef200: fa fa fa fa 00 00 00 00 00 00 fa fa fa fa fa fa
                                                  ^
  ffffffff989ef280: 00 06 fa fa fa fa fa fa 00 00 04 fa fa fa fa fa
  ffffffff989ef300: 00 00 fa fa fa fa fa fa 00 05 fa fa fa fa fa fa
 ==================================================================
 Disabling lock debugging due to kernel taint
 	ok 7 - pe_test_reference
 ok 8 - property-entry

Fixes: c032ace71c ("software node: add basic tests for property entries")
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-01-07 11:41:04 +01:00
..
accessibility
acpi dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
amba
android compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
ata This is the bulk of GPIO changes for the v5.5 kernel cycle 2019-12-01 17:56:50 -08:00
atm
auxdisplay
base drivers/base/test: fix global-out-of-bounds error 2020-01-07 11:41:04 +01:00
bcma
block compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
bluetooth
bus Staging / IIO patches for 5.5-rc1 2019-11-27 10:57:52 -08:00
cdrom
char compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
clk This merge window we have one small clk provider API in the core framework and 2019-12-01 16:06:02 -08:00
clocksource First set of RISC-V updates for v5.5-rc1 2019-11-27 11:27:59 -08:00
connector
counter
cpufreq Power management updates for 5.5-rc1 2019-11-26 19:06:44 -08:00
cpuidle
crypto compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
dax
dca
devfreq
dio
dma
dma-buf compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
edac
eisa
extcon Char/Misc driver patches for 5.5-rc1 2019-11-27 10:53:50 -08:00
firewire compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
firmware Char/Misc driver patches for 5.5-rc1 2019-11-27 10:53:50 -08:00
fpga
fsi
gnss
gpio This is the bulk of GPIO changes for the v5.5 kernel cycle 2019-12-01 17:56:50 -08:00
gpu This is the bulk of GPIO changes for the v5.5 kernel cycle 2019-12-01 17:56:50 -08:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2019-12-01 18:20:54 -08:00
hsi
hv - Support for new VMBus protocols (Andrea Parri). 2019-11-30 14:50:51 -08:00
hwmon compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
hwspinlock
hwtracing compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
i2c Driver core patches for 5.5-rc1 2019-11-27 11:06:20 -08:00
i3c
ide compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
idle
iio compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
infiniband compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
input
interconnect
iommu - Support for new VMBus protocols (Andrea Parri). 2019-11-30 14:50:51 -08:00
ipack
irqchip First set of RISC-V updates for v5.5-rc1 2019-11-27 11:27:59 -08:00
isdn compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
leds Merge tag 'leds-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds 2019-12-01 16:09:28 -08:00
lightnvm
macintosh powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
mailbox
mcb
md
media compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
memory
memstick
message
mfd - Core Frameworks 2019-12-01 16:16:31 -08:00
misc compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
mmc Driver core patches for 5.5-rc1 2019-11-27 11:06:20 -08:00
mtd compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
mux
net compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
nfc
ntb
nubus
nvdimm compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
nvme compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
nvmem Char/Misc driver patches for 5.5-rc1 2019-11-27 10:53:50 -08:00
of dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
opp
oprofile
parisc
parport
pci compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
pcmcia
perf
phy Char/Misc driver patches for 5.5-rc1 2019-11-27 10:53:50 -08:00
pinctrl pinctrl: Fix warning by adding missing MODULE_LICENSE 2019-11-28 09:12:43 +01:00
platform platform/x86: intel_cht_int33fe: use inline reference properties 2019-12-03 11:46:20 +01:00
pnp
power - Core Frameworks 2019-12-01 16:16:31 -08:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc - Core Frameworks 2019-12-01 16:16:31 -08:00
s390 compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
sbus
scsi compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
target
tc
tee
thermal platform-drivers-x86 for v5.5-1 2019-12-01 18:24:25 -08:00
thunderbolt
tty compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
uio
usb compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
vfio compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
vhost compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
video - New Functionality 2019-12-01 16:13:39 -08:00
virt compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
virtio
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.5-rc1 tag 2019-12-01 18:01:03 -08:00
xen hmm related patches for 5.5 2019-11-30 10:33:14 -08:00
zorro
Kconfig
Makefile