2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/include
Nitin Gote 5634c8cb29 iosys-map: Fix undefined behavior in iosys_map_clear()
The current iosys_map_clear() implementation reads the potentially
uninitialized 'is_iomem' boolean field to decide which union member
to clear. This causes undefined behavior when called on uninitialized
structures, as 'is_iomem' may contain garbage values like 0xFF.

UBSAN detects this as:
    UBSAN: invalid-load in include/linux/iosys-map.h:267
    load of value 255 is not a valid value for type '_Bool'

Fix by unconditionally clearing the entire structure with memset(),
eliminating the need to read uninitialized data and ensuring all
fields are set to known good values.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14639
Fixes: 01fd30da04 ("dma-buf: Add struct dma-buf-map for storing struct dma_buf.vaddr_ptr")
Signed-off-by: Nitin Gote <nitin.r.gote@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250718105051.2709487-1-nitin.r.gote@intel.com
2025-08-11 17:26:38 +02:00
..
acpi mailbox/pcc: support mailbox management of the shared buffer 2025-08-07 23:49:56 -05:00
asm-generic Deferred unwind changes for 6.17 2025-08-01 09:46:24 -07:00
clocksource
crypto This push fixes a regression that breaks hmac(sha3-224-s390). 2025-08-09 07:26:19 +03:00
cxl
drm drm for 6.17-rc1 2025-07-30 19:26:49 -07:00
dt-bindings Pin control changes for v6.17 2025-08-02 12:07:09 -07:00
hyperv
keys
kunit linux_kselftest-kunit-6.17-rc1 2025-07-29 12:43:10 -07:00
kvm KVM/arm64 changes for 6.17, round #1 2025-07-29 12:27:40 -04:00
linux iosys-map: Fix undefined behavior in iosys_map_clear() 2025-08-11 17:26:38 +02:00
math-emu
media
memory
misc
net Previous releases - regressions: 2025-08-08 07:03:25 +03:00
pcmcia
ras tracing, AER: Hide PCIe AER event when PCIEAER is not configured 2025-07-21 16:40:56 -04:00
rdma IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
rv rv: Retry when da monitor detects race conditions 2025-07-28 16:47:34 -04:00
scsi Merge patch series "libsas cleanups" 2025-07-25 09:05:23 -04:00
soc This is the usual collection of primarily clk driver updates. The big part of 2025-07-31 13:36:27 -07:00
sound ASoC: Fixes for v6.17 2025-08-06 20:20:25 +02:00
target
trace tracing changes for 6.17 2025-08-01 10:29:36 -07:00
uapi TTY revert fix for 6.16-rc1 2025-08-09 18:12:23 +03:00
ufs
vdso
video
xen Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
Kbuild