lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251217162744.352391-1-mkoutny@suse.com>
Date: Wed, 17 Dec 2025 17:27:32 +0100
From: Michal Koutný <mkoutny@...e.com>
To: linux-block@...r.kernel.org,
	bpf@...r.kernel.org,
	linux-trace-kernel@...r.kernel.org,
	netfilter-devel@...r.kernel.org,
	netdev@...r.kernel.org,
	coreteam@...filter.org,
	linux-hardening@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	cgroups@...r.kernel.org
Cc: Michal Koutný <mkoutny@...e.com>,
	Hao Luo <haoluo@...gle.com>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Phil Sutter <phil@....cc>,
	Yonghong Song <yonghong.song@...ux.dev>,
	Jens Axboe <axboe@...nel.dk>,
	Jozsef Kadlecsik <kadlec@...filter.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Martin KaFai Lau <martin.lau@...ux.dev>,
	KP Singh <kpsingh@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Florian Westphal <fw@...len.de>,
	Jiri Olsa <jolsa@...nel.org>,
	Stanislav Fomichev <sdf@...ichev.me>,
	Song Liu <song@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Simon Horman <horms@...nel.org>,
	John Fastabend <john.fastabend@...il.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>,
	Tejun Heo <tj@...nel.org>,
	Josef Bacik <josef@...icpanda.com>,
	Paolo Abeni <pabeni@...hat.com>,
	"Gustavo A. R. Silva" <gustavoars@...nel.org>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Eduard Zingerman <eddyz87@...il.com>,
	Yu Kuai <yukuai@...as.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Kees Cook <kees@...nel.org>,
	Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH 0/4] Use __counted_by for ancestor arrays

The trick with utilizing space in cgroup_root for cgroup::ancetors flex
array was an obstacle for kernel reworks for
-Wflex-array-member-not-at-end.

The first patch fixes that, then I wanted to utilize __counted_by for
this flex array which required some more rework how cgroup level is
evaluated.

Similar flex array is also in struct ioc_gq where it was tempting to
simply use __counted_by(level), however, this would be off-by-one as it
has semantics like cgroup's level (0 == root).
Proper adjustment for __counted_by() would either need similar
level/ancestor helpers or abstracted macros for ancestors up/down
iterations.

I only made a simple comment fixup since I'm not sure about benefit of
__counted_by for structs that aren't sized based on direct user input.

Michal Koutný (4):
  cgroup: Eliminate cgrp_ancestor_storage in cgroup_root
  cgroup: Introduce cgroup_level() helper
  cgroup: Use __counted_by for cgroup::ancestors
  blk-iocost: Correct comment ioc_gq::level

 block/bfq-iosched.c           |  2 +-
 block/blk-iocost.c            |  6 ++---
 include/linux/cgroup-defs.h   | 43 +++++++++++++++++++----------------
 include/linux/cgroup.h        | 18 ++++++++++++---
 include/trace/events/cgroup.h |  8 +++----
 kernel/bpf/helpers.c          |  2 +-
 kernel/cgroup/cgroup.c        |  9 ++++----
 net/netfilter/nft_socket.c    |  2 +-
 8 files changed, 53 insertions(+), 37 deletions(-)


base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ