linux-stable/tools
Zenghui Yu d43fde5ebf kselftests: dmabuf-heaps: Ensure the driver name is null-terminated
[ Upstream commit 291e4baf70 ]

Even if a vgem device is configured in, we will skip the import_vgem_fd()
test almost every time.

  TAP version 13
  1..11
  # Testing heap: system
  # =======================================
  # Testing allocation and importing:
  ok 1 # SKIP Could not open vgem -1

The problem is that we use the DRM_IOCTL_VERSION ioctl to query the driver
version information but leave the name field a non-null-terminated string.
Terminate it properly to actually test against the vgem device.

While at it, let's check the length of the driver name is exactly 4 bytes
and return early otherwise (in case there is a name like "vgemfoo" that
gets converted to "vgem\0" unexpectedly).

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20240729024604.2046-1-yuzenghui@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:11:38 +02:00
..
accounting
arch tools headers arm64: Sync arm64's cputype.h with the kernel sources 2024-08-14 13:59:03 +02:00
bootconfig
bpf tools/resolve_btfids: Fix comparison of distinct pointer types warning in resolve_btfids 2024-08-03 08:54:37 +02:00
build perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2024-02-05 20:14:31 +00:00
certs
cgroup
counter
crypto/ccp
debugging
edid
firewire
firmware
gpio
hv hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles 2023-12-03 07:33:02 +01:00
iio tools: iio: replace seekdir() in iio_generic_buffer 2024-04-13 13:07:38 +02:00
include tools: move alignment-related macros to new <linux/align.h> 2024-08-29 17:33:59 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Add NULL checks to bpf_object__{prev_map,next_map} 2024-09-12 11:11:36 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-03 08:54:21 +02:00
mm
net/ynl tools: ynl: don't ignore errors in NLMSG_DONE messages 2024-05-02 16:32:36 +02:00
objtool objtool: Fix UNWIND_HINT_{SAVE,RESTORE} across basic blocks 2024-03-26 18:19:35 -04:00
pci
pcmcia
perf perf tool: fix dereferencing NULL al->maps 2024-08-11 12:47:18 +02:00
power tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs 2024-07-25 09:50:41 +02:00
rcu
scripts
spi
testing kselftests: dmabuf-heaps: Ensure the driver name is null-terminated 2024-09-12 11:11:38 +02:00
thermal
time
tracing rtla/osnoise: Prevent NULL dereference in error handling 2024-08-29 17:33:14 +02:00
usb
verification tools/rv: Fix Makefile compiler options for clang 2024-02-23 09:25:14 +01:00
virtio
wmi
workqueue
Makefile