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: <30cd1aa2-4dcf-d181-30d8-678377bf96c5@linux.dev>
Date:   Thu, 8 Sep 2022 12:13:50 -0700
From:   Martin KaFai Lau <martin.lau@...ux.dev>
To:     sdf@...gle.com, Pu Lehui <pulehui@...weicloud.com>
Cc:     bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Quentin Monnet <quentin@...valent.com>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>, Hao Luo <haoluo@...gle.com>,
        Jiri Olsa <jolsa@...nel.org>, Pu Lehui <pulehui@...wei.com>
Subject: Re: [PATCH bpf-next v2 0/2] Fix cgroup attach flags being assigned to
 effective progs

On 9/8/22 10:28 AM, sdf@...gle.com wrote:
> On 09/08, Pu Lehui wrote:
>> From: Pu Lehui <pulehui@...wei.com>
> 
>> When root-cgroup attach multi progs and sub-cgroup attach a
>> override prog, bpftool will display incorrectly for the attach
>> flags of the sub-cgroup’s effective progs:
> 
>> $ bpftool cgroup tree /sys/fs/cgroup effective
>> CgroupPath
>> ID       AttachType      AttachFlags     Name
>> /sys/fs/cgroup
>> 6        cgroup_sysctl   multi           sysctl_tcp_mem
>> 13       cgroup_sysctl   multi           sysctl_tcp_mem
>> /sys/fs/cgroup/cg1
>> 20       cgroup_sysctl   override        sysctl_tcp_mem
>> 6        cgroup_sysctl   override        sysctl_tcp_mem <- wrong
>> 13       cgroup_sysctl   override        sysctl_tcp_mem <- wrong
>> /sys/fs/cgroup/cg1/cg2
>> 20       cgroup_sysctl                   sysctl_tcp_mem
>> 6        cgroup_sysctl                   sysctl_tcp_mem
>> 13       cgroup_sysctl                   sysctl_tcp_mem
> 
>> For cg1, obviously, the attach flags of prog6 and prog13 can not be
>> OVERRIDE, and the attach flags of prog6 and prog13 is meaningless for
>> cg1. We only need to care the attach flags of prog which attached to
>> cg1, other progs attach flags should be omit. After these patches,
>> the above situation will show as bellow:
> 
>> $ bpftool cgroup tree /sys/fs/cgroup effective
>> CgroupPath
>> ID       AttachType      AttachFlags     Name
>> /sys/fs/cgroup
>> 6        cgroup_sysctl   multi           sysctl_tcp_mem
>> 13       cgroup_sysctl   multi           sysctl_tcp_mem
>> /sys/fs/cgroup/cg1
>> 20       cgroup_sysctl   override        sysctl_tcp_mem
>> 6        cgroup_sysctl                   sysctl_tcp_mem
>> 13       cgroup_sysctl                   sysctl_tcp_mem
>> /sys/fs/cgroup/cg1/cg2
>> 20       cgroup_sysctl                   sysctl_tcp_mem
>> 6        cgroup_sysctl                   sysctl_tcp_mem
>> 13       cgroup_sysctl                   sysctl_tcp_mem
> 
>> v2:
>> - Limit prog_cnt to avoid overflow. (John)
>> - Add more detail message.
> 
> John also raised a good question in v1: the flags don't seem to
> make sense when requesting effective list. So maybe not export them
> at all?
+1. not exporting them for 'effective' listing makes sense.

This seems to be the day one behavior instead of the recent 
prog_attach_flags changes? so bpf-next makes sense also.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ