linux/tools/accounting
Yiyang Chen cc82b3dcc6 tools/accounting: handle truncated taskstats netlink messages
procacct and getdelays use a fixed receive buffer for taskstats generic
netlink messages.  A multi-threaded process exit can emit a single
PID+TGID notification large enough to exceed that buffer on newer kernels.

Switch to recvmsg() so MSG_TRUNC is detected explicitly, increase the
message buffer size, and report truncated datagrams clearly instead of
misparsing them as fatal netlink errors.

Also print the taskstats version in debug output to make version
mismatches easier to diagnose while inspecting taskstats traffic.

Link: https://lkml.kernel.org/r/520308bb4cbbaf8dc2c7296b5f60f11e12fb30a5.1774810498.git.cyyzero16@gmail.com
Signed-off-by: Yiyang Chen <cyyzero16@gmail.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de>
Cc: Fan Yu <fan.yu9@zte.com.cn>
Cc: Wang Yaxin <wang.yaxin@zte.com.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-04-15 02:15:02 -07:00
..
.gitignore taskstats: version 12 with thread group and exe info 2022-04-29 14:38:03 -07:00
delaytop.c tools/delaytop: improve error handling for missing PSI support 2025-09-13 17:32:56 -07:00
getdelays.c tools/accounting: handle truncated taskstats netlink messages 2026-04-15 02:15:02 -07:00
Makefile tools/getdelays: use the static UAPI headers from tools/include/uapi 2026-03-27 21:19:43 -07:00
procacct.c tools/accounting: handle truncated taskstats netlink messages 2026-04-15 02:15:02 -07:00