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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0031e5a293a89b42ac55e019d44bc9cf6ad0eca5ab75f07eb1f12b46a5ec560c@mail.kernel.org>
Date: Fri, 23 Jan 2026 09:18:59 +0000 (UTC)
From: bot+bpf-ci@...nel.org
To: hui.zhu@...ux.dev,akpm@...ux-foundation.org,hannes@...xchg.org,mhocko@...nel.org,roman.gushchin@...ux.dev,shakeel.butt@...ux.dev,muchun.song@...ux.dev,ast@...nel.org,daniel@...earbox.net,andrii@...nel.org,martin.lau@...ux.dev,eddyz87@...il.com,song@...nel.org,yonghong.song@...ux.dev,john.fastabend@...il.com,kpsingh@...nel.org,sdf@...ichev.me,haoluo@...gle.com,jolsa@...nel.org,shuah@...nel.org,peterz@...radead.org,ojeda@...nel.org,nathan@...nel.org,kees@...nel.org,tj@...nel.org,jeffxu@...omium.org,mkoutny@...e.com,kernel@...rr.cc,brauner@...nel.org,rdunlap@...radead.org,brgerst@...il.com,masahiroy@...nel.org,davem@...emloft.net,kuba@...nel.org,hawk@...nel.org,inwardvessel@...il.com,willemb@...gle.com,kerneljasonxing@...il.com,paul.chaignon@...il.com,a.s.protopopov@...il.com,ameryhung@...il.com,chenridong@...weicloud.com,lance.yang@...ux.dev,jiayuan.chen@...ux.dev,linux-kernel@...r.kernel.org,linux-mm@...ck.org,cgroups@...r.kernel.org,bpf@...r.kernel.org,netdev@...r.kernel.org,linu
 x-kselftest@...r.kernel.org
Cc: zhuhui@...inos.cn,geliang@...nel.org,ast@...nel.org,andrii@...nel.org,daniel@...earbox.net,martin.lau@...nel.org,eddyz87@...il.com,yonghong.song@...ux.dev,clm@...a.com,ihor.solodrai@...ux.dev
Subject: Re: [RFC PATCH bpf-next v3 12/12] samples/bpf: Add memcg priority control example

> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 95a4fa1f1e44..6416c8aa3034 100644

[ ... ]

> @@ -360,6 +366,7 @@ BPF_SKELS_LINKED := $(addprefix $(obj)/,$(LINKED_SKELS))
>
>  $(BPF_SKELS_LINKED): $(BPF_OBJS_LINKED) $(BPFTOOL)
>  	@echo "  BPF GEN-OBJ " $(@:.skel.h=)
> +	echo $(Q)$(BPFTOOL) gen object $(@:.skel.h=.lbpf.o) $(addprefix $(obj)/,$($(@F)-deps))
>  	$(Q)$(BPFTOOL) gen object $(@:.skel.h=.lbpf.o) $(addprefix $(obj)/,$($(@F)-deps))

Was this debug echo intended to be left in? The line without the @ prefix
will print the unexpanded command during the build, which looks like
leftover debug output.

> diff --git a/samples/bpf/memcg.c b/samples/bpf/memcg.c
> new file mode 100644
> index 000000000000..85432cb01c27
> --- /dev/null
> +++ b/samples/bpf/memcg.c

[ ... ]

> +	high_cgroup_id = get_cgroup_id(high_path);
> +	if (!high_cgroup_id)
> +		goto out;
> +	high_cgroup_fd = open(high_path, O_RDONLY);
> +	if (high_cgroup_fd < 0) {
> +		fprintf(stderr,
> +			"ERROR: open high cgroup '%s' failed: %d\n",
> +			low_path, errno);
                        ^^^^^^^^

Should this be high_path instead of low_path? The error message says
"open high cgroup" but prints low_path.

[ ... ]

> +	struct bpf_link *link = NULL, *link_low = NULL, *link_high = NULL;

[ ... ]

> +	if (over_high_ms) {

[ ... ]

> +		link_low = bpf_map__attach_struct_ops_opts(map, &opts);

[ ... ]

> +	if (use_below_low || use_below_min) {
> +		map = bpf_object__find_map_by_name(obj, "high_mcg_ops");

[ ... ]

> +		link_low = bpf_map__attach_struct_ops_opts(map, &opts);
                ^^^^^^^^

This assigns to link_low again, overwriting the previous link if both
over_high_ms and (use_below_low || use_below_min) are set. Should this
be link_high instead? The link_high variable is declared but never
assigned, and the first bpf_link would be leaked in this scenario.

[ ... ]

> +out:
> +	bpf_link__destroy(link);
> +	bpf_link__destroy(link_low);
> +	bpf_link__destroy(link_high);

Here link_high is always NULL since it was never assigned above.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21280790825

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ