milos-linux/tools/accounting
Yiyang Chen cfcca09ece tools/accounting: handle truncated taskstats netlink messages
commit cc82b3dcc6 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-05-07 06:13:56 +02: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-05-07 06:13:56 +02:00
Makefile tools/accounting/delaytop: add delaytop to record top-n task delay 2025-07-09 22:57:56 -07:00
procacct.c tools/accounting: handle truncated taskstats netlink messages 2026-05-07 06:13:56 +02:00