From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D63B81E531 for ; Fri, 10 Jul 2026 22:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783724375; cv=none; b=OJvFLGtV0gc6XVcvuU+vHxaZ5QDnNc5gAM0j7jWliEP4e1U+vLuMkAnLcPH6S23vBiFCim5lbpnB/d57I1CH9SLhvdvT/XBKtAXBKM2MR50jpt2wcqKVkeowEQLOQ7D3n9s+FGc8nhU3H2X07+Tc5t41207ZGUBs3ZWcRNWtzoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783724375; c=relaxed/simple; bh=mPdDc84kprQIdj5IHqvh+b6FFpRlicePsfiAuIKNNqU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=LSb4A9VQWIIJnUCTSKVppu/V8kridHgY8BpqYKxgYkxpUrkM3QNOyy0SuZUPCoLK247PqErk08csS3gSWehCH38K8hzcDfI3wxsk8cEmuQLrEzkyilVM2CHyxytb+wpBTK9zB4LRj562WZJaAaFNY/7cc/8mk1i6Ic7IjOAbDWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=wcgExZno; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="wcgExZno" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DE051F000E9; Fri, 10 Jul 2026 22:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783724374; bh=bdFunyKV1FXRs7lJOZ6GAGmuniedMGW2WlPtICcVV48=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=wcgExZnonhIkYIyEJvlXQ6hjDddTHcolHOirKJJMFG3sjPwiDRZZBBp9kAybJtuQ1 Lv6Gc5dc4GsDymeNc3FC6FdcS7UnV7GGiFl9jOkQ7Y7HMksZzxQ9SS4PgdzdzDO/O+ fidQCmYIXWWpwi3HtsKxbeOo9YnCwVdgNPX9VTMs= Date: Fri, 10 Jul 2026 15:59:33 -0700 From: Andrew Morton To: Yiyang Chen Cc: Balbir Singh , linux-kernel@vger.kernel.org, "Dr . Thomas Orgis" Subject: Re: [PATCH 0/2] taskstats: fix cgroupstats invalid fd handling and add selftests Message-Id: <20260710155933.5a7a4d1eb8996f0042058f7b@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 11 Jul 2026 04:07:35 +0800 Yiyang Chen 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/ :(