From: Andrew Morton <akpm@linux-foundation.org>
To: Yiyang Chen <cyyzero16@gmail.com>
Cc: Balbir Singh <balbirs@nvidia.com>,
linux-kernel@vger.kernel.org,
"Dr . Thomas Orgis" <thomas.orgis@uni-hamburg.de>
Subject: Re: [PATCH 0/2] taskstats: fix cgroupstats invalid fd handling and add selftests
Date: Fri, 10 Jul 2026 15:59:33 -0700 [thread overview]
Message-ID: <20260710155933.5a7a4d1eb8996f0042058f7b@linux-foundation.org> (raw)
In-Reply-To: <cover.1783713230.git.cyyzero16@gmail.com>
On Sat, 11 Jul 2026 04:07:35 +0800 Yiyang Chen <cyyzero16@gmail.com> wrote:
> This series fixes an issue where cgroupstats mishandles invalid file
> descriptors, and introduces a functional kselftest to prevent regressions.
>
> When an invalid file descriptor is passed via CGROUPSTATS_CMD_ATTR_FD,
> cgroupstats_user_cmd() returns 0 instead of an error code. This leads to
> two broken behaviors depending on netlink flags:
> - Callers without NLM_F_ACK block indefinitely on recv().
> - Callers with NLM_F_ACK receive a misleading success ACK (errno == 0)
> but no actual statistics payload.
>
> The first patch addresses this by returning -EBADF when the fd cannot be
> resolved. The second patch adds a comprehensive kselftest covering both
> the valid cgroup v1 query and the invalid fd paths (with and without
> NLM_F_ACK) to ensure the fixes work as intended.
lgtm, thanks.
It's a little odd to group two unrelated(?) changes in one series like
this. Oh well, let's not redo things for this.
Should the netlink_open() in taskstats_fill_stats_tgid.c also be
setting that timeout? If so, we can share a single implementation - a
little cleanup.
There's a lot of code duplication in selftests/ :(
next prev parent reply other threads:[~2026-07-10 22:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 20:07 Yiyang Chen
2026-07-10 20:07 ` [PATCH 1/2] taskstats: return -EBADF when cgroupstats receives an invalid fd Yiyang Chen
2026-07-27 0:40 ` Balbir Singh
2026-07-10 20:07 ` [PATCH 2/2] selftests/acct: add cgroupstats functional test Yiyang Chen
2026-07-10 22:59 ` Andrew Morton [this message]
2026-07-11 4:44 ` [PATCH 0/2] taskstats: fix cgroupstats invalid fd handling and add selftests Yiyang Chen
2026-07-24 22:51 ` Bradley Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260710155933.5a7a4d1eb8996f0042058f7b@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=balbirs@nvidia.com \
--cc=cyyzero16@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.orgis@uni-hamburg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®