linux/tools
Hongfu Li 2a7d34eba5 selftests/cgroup: check malloc return value in alloc_anon functions
The alloc_anon() function calls malloc() without checking for a NULL
return. If memory allocation fails, a NULL pointer dereference will
occur when accessing the buffer.

Add proper error handling to return -1 when malloc() fails in all
four alloc_anon variants:
- alloc_anon()
- alloc_anon_50M_check()
- alloc_anon_noexit()
- alloc_anon_50M_check_swap()

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Reviewed-by: Vishal Moola <vishal.moola@gmail.com>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
History 2026-05-12 07:31:39 -10:00
..
accounting tools/accounting: handle truncated taskstats netlink messages 2026-04-15 02:15:02 -07:00
arch Arm: 2026-04-17 07:18:03 -07:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-03-19 08:43:06 +09:00
bpf bpftool: add missing fsession to the usage and docs of bpftool 2026-04-12 12:42:38 -07:00
build RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
certs tools/certs: Add print-cert-tbs-hash.sh 2022-05-23 18:47:49 +03:00
cgroup memcg_slabinfo: Fix use of PG_slab 2025-07-23 11:55:22 +02:00
counter tools/counter: add direction change event to watcher 2025-02-05 13:22:04 +09:00
crypto crypto: tools/ccp - Remove unused variable 2024-08-30 18:22:30 +08:00
debugging kernel-chktaint: add reporting for tainted modules 2026-01-26 19:07:15 -08:00
dma dma-mapping updates for Linux 6.19: 2025-12-06 09:25:05 -08:00
docs docs: kdoc_diff: add a helper tool to help checking kdoc regressions 2026-03-30 10:54:13 -06:00
firewire tools/firewire: Fix several incorrect format specifiers 2024-11-14 09:12:04 +09:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio tools: gpio: remove the include directory on make clean 2025-09-04 16:29:28 +02:00
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-07-15 06:25:33 +00:00
iio iio: add power and energy measurement modifiers 2025-09-13 13:47:19 +01:00
include Arm: 2026-04-17 07:18:03 -07:00
kvm/kvm_stat tools/kvm_stat: use canonical ftrace path 2023-03-29 06:52:08 -04:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
memory-model tools/memory-model/Documentation: Fix SRCU section in explanation.txt 2025-04-23 12:17:04 -07:00
mm tools/mm/slabinfo: fix --partial long option mapping 2026-01-20 19:24:43 -08:00
net tools: ynl: add sample for wireguard 2026-04-14 11:48:04 -07:00
objtool objtool updates for v7.1: 2026-04-14 13:00:04 -07:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf RISC-V updates for v7.0-rc8 2026-04-10 17:27:08 -07:00
power Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
rcu tools/rcu: Remove RCU Tasks Rude asynchronous APIs from rcu-updaters.sh 2024-07-29 07:39:32 +05:30
sched tools/sched: Add dl_bw_dump.py for printing bandwidth accounting info 2025-07-14 10:59:33 +02:00
sched_ext tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY() 2026-04-13 06:14:11 -10:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound ASoC: dapm-graph: set fill colour of turned on nodes 2025-02-24 18:35:54 +00:00
spi spi: tools: Add include folder to .gitignore 2026-02-09 12:27:31 +00:00
testing selftests/cgroup: check malloc return value in alloc_anon functions 2026-05-12 07:31:39 -10:00
thermal tools/thermal/thermal-engine: Fix format string bug in thermal-engine 2025-11-25 11:00:28 +01:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
tracing RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
unittests docs: kdoc: better handle source when producing YAML output 2026-03-25 13:36:46 -06:00
usb tools: usb: usbip: remove dead-link from README 2026-01-23 17:16:42 +01:00
verification rv: Allow epoll in rtapp-sleep monitor 2026-04-01 15:18:30 +02:00
virtio tools/virtio: add device, device_driver stubs 2025-12-24 08:02:56 -05:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
workqueue tools/workqueue: add CACHE_SHARD support to wq_dump.py 2026-04-01 10:24:18 -10:00
writeback writeback: add wb_monitor.py script to monitor writeback info on bdi 2024-05-05 17:53:51 -07:00
Makefile tools/dma: move dma_map_benchmark from selftests to tools/dma 2025-10-29 09:41:40 +01:00