linux/drivers
Linus Torvalds fec4d42724 drm/i915/display: fix compiler warning about array overrun
intel_dp_check_mst_status() uses a 14-byte array to read the DPRX Event
Status Indicator data, but then passes that buffer at offset 10 off as
an argument to drm_dp_channel_eq_ok().

End result: there are only 4 bytes remaining of the buffer, yet
drm_dp_channel_eq_ok() wants a 6-byte buffer.  gcc-11 correctly warns
about this case:

  drivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_check_mst_status’:
  drivers/gpu/drm/i915/display/intel_dp.c:3491:22: warning: ‘drm_dp_channel_eq_ok’ reading 6 bytes from a region of size 4 [-Wstringop-overread]
   3491 |                     !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
        |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/display/intel_dp.c:3491:22: note: referencing argument 1 of type ‘const u8 *’ {aka ‘const unsigned char *’}
  In file included from drivers/gpu/drm/i915/display/intel_dp.c:38:
  include/drm/drm_dp_helper.h:1466:6: note: in a call to function ‘drm_dp_channel_eq_ok’
   1466 | bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
        |      ^~~~~~~~~~~~~~~~~~~~
       6:14 elapsed

This commit just extends the original array by 2 zero-initialized bytes,
avoiding the warning.

There may be some underlying bug in here that caused this confusion, but
this is at least no worse than the existing situation that could use
random data off the stack.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-08 11:30:22 -07:00
..
accessibility TTY/Serial driver updates for 5.13-rc1 2021-04-26 11:20:10 -07:00
acpi Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
amba
android selinux/stable-5.13 PR 20210426 2021-04-27 13:42:11 -07:00
ata pci-v5.13-changes 2021-05-05 13:24:11 -07:00
atm atm: firestream: Use fallthrough pseudo-keyword 2021-05-07 16:01:08 -07:00
auxdisplay treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
base init/initramfs.c: do unpacking asynchronously 2021-05-07 00:26:33 -07:00
bcma bcma: remove unused function 2021-04-18 09:36:56 +03:00
block block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
bluetooth Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
bus ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
cdrom
char drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
clk pci-v5.13-changes 2021-05-05 13:24:11 -07:00
clocksource ARM: 2021-05-01 10:14:08 -07:00
comedi
connector
counter
cpufreq Power management updates for 5.13-rc1 2021-04-26 15:10:25 -07:00
cpuidle
crypto ARM: 2021-05-01 10:14:08 -07:00
cxl cxl/mem: Fix memory device capacity probing 2021-04-16 18:21:56 -07:00
dax
dca
devfreq
dio
dma dmaengine updates for v5.13-rc1 2021-05-04 11:24:46 -07:00
dma-buf
edac
eisa
extcon - Core Frameworks 2021-04-28 15:59:13 -07:00
firewire The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
firmware Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
fpga ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
fsi
gnss
gpio gpio updates for v5.13 2021-05-05 12:39:29 -07:00
gpu drm/i915/display: fix compiler warning about array overrun 2021-05-08 11:30:22 -07:00
greybus
hid Merge branch 'for-5.13/warnings' into for-linus 2021-04-29 21:47:22 +02:00
hsi
hv printk changes for 5.13 2021-04-27 18:09:44 -07:00
hwmon ACPI updates for 5.13-rc1 2021-04-26 15:03:23 -07:00
hwspinlock
hwtracing ARM: 2021-05-01 10:14:08 -07:00
i2c Merge branch 'i2c/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2021-04-30 13:01:02 -07:00
i3c Revert "i3c master: fix missing destroy_workqueue() on error in i3c_master_register" 2021-04-24 22:21:01 +02:00
ide
idle
iio spi: Updates for v5.13 2021-04-26 16:32:11 -07:00
infiniband block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-05-06 23:37:55 -07:00
interconnect CFI on arm64 series for v5.13-rc1 2021-04-27 10:16:46 -07:00
iommu pci-v5.13-changes 2021-05-05 13:24:11 -07:00
ipack
irqchip ARM: 2021-05-01 10:14:08 -07:00
isdn proc: mandate ->proc_lseek in "struct proc_ops" 2021-05-06 19:24:11 -07:00
leds Nothing too exciting here, just some fixes. 2021-05-03 12:23:03 -07:00
lightnvm
macintosh macintosh/via-pmu: Fix build warning 2021-04-16 23:57:51 +10:00
mailbox - qcom: enable support for SM8350 and SC7280 2021-04-28 16:10:33 -07:00
mcb
md Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
media Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
memory .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
memstick memstick: r592: ignore kfifo_out() return code again 2021-04-26 11:08:23 +02:00
message
mfd - Core Frameworks 2021-04-28 15:59:13 -07:00
misc IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
mmc MMC core: 2021-04-28 15:56:51 -07:00
most Staging/IIO driver updates for 5.13-rc1 2021-04-26 11:14:21 -07:00
mtd This pull request contains changes for JFFS2, UBI and UBIFS 2021-05-04 18:08:40 -07:00
mux
net Networking fixes for 5.13-rc1, including fixes from bpf, can 2021-05-08 08:31:46 -07:00
nfc
ntb
nubus
nvdimm include: remove pagemap.h from blkdev.h 2021-05-06 19:24:11 -07:00
nvme nvmet: remove unsupported command noise 2021-05-04 09:39:26 +02:00
nvmem
of of: overlay: Remove redundant assignment to ret 2021-05-03 13:57:56 -05:00
opp
parisc
parport treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
pci more s390 updates for 5.13 merge window 2021-05-06 14:39:50 -07:00
pcmcia
perf ARM: 2021-05-01 10:14:08 -07:00
phy Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
pinctrl linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> 2021-05-09 00:29:45 +09:00
platform chrome platform changes for 5.13 2021-05-07 14:49:18 -07:00
pnp
power power supply and reset changes for the v5.13 series 2021-04-28 15:43:58 -07:00
powercap
pps TTY/Serial driver updates for 5.13-rc1 2021-04-26 11:20:10 -07:00
ps3
ptp ARM: 2021-05-01 10:14:08 -07:00
pwm pwm: Changes for v5.13-rc1 2021-05-05 12:53:16 -07:00
rapidio
ras
regulator - Core Frameworks 2021-04-28 15:59:13 -07:00
remoteproc remoteproc updates for v5.13 2021-05-04 11:13:33 -07:00
reset pci-v5.13-changes 2021-05-05 13:24:11 -07:00
rpmsg
rtc RTC for 5.13 2021-05-03 12:15:21 -07:00
s390 block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
sbus
scsi SCSI misc on 20210508 2021-05-08 10:44:36 -07:00
sh The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
siox
slimbus
soc IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
soundwire
spi sound updates for 5.13 2021-04-30 12:48:14 -07:00
spmi
ssb
staging drm tegra-next + fixes for 5.13-rc1 2021-04-30 12:44:02 -07:00
target SCSI misc on 20210508 2021-05-08 10:44:36 -07:00
tc
tee ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
thermal - Remove duplicate error message for the amlogic driver (Tang Bin) 2021-05-05 12:46:48 -07:00
thunderbolt
tty .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
uio
usb SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
vdpa vDPA/ifcvf: get_config_size should return dev specific config size 2021-05-03 04:55:54 -04:00
vfio IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
vhost virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00
video Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
virt nitro_enclaves: Fix stale file descriptors on failed usercopy 2021-04-29 19:06:49 +02:00
virtio virtio_pci_modern: correct sparse tags for notify 2021-05-04 04:19:59 -04:00
visorbus
vlynq
vme
w1
watchdog - Core Frameworks 2021-04-28 15:59:13 -07:00
xen Merge branch 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-05-04 10:58:49 -07:00
zorro
Kconfig
Makefile virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00