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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 30 Aug 2021 08:10:34 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>,
        Zefan Li <lizefan.x@...edance.com>,
        Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3] cgroup: Avoid compiler warnings with no subsystems

On Fri, Aug 27, 2021 at 05:02:55PM -0700, Kees Cook wrote:
> As done before in commit cb4a31675270 ("cgroup: use bitmask to filter
> for_each_subsys"), avoid compiler warnings for the pathological case of
> having no subsystems (i.e. CGROUP_SUBSYS_COUNT == 0). This condition is
> hit for the arm multi_v7_defconfig config under -Wzero-length-bounds:
> 
> In file included from ./arch/arm/include/generated/asm/rwonce.h:1,
>                  from include/linux/compiler.h:264,
>                  from include/uapi/linux/swab.h:6,
>                  from include/linux/swab.h:5,
>                  from arch/arm/include/asm/opcodes.h:86,
>                  from arch/arm/include/asm/bug.h:7,
>                  from include/linux/bug.h:5,
>                  from include/linux/thread_info.h:13,
>                  from include/asm-generic/current.h:5,
>                  from ./arch/arm/include/generated/asm/current.h:1,
>                  from include/linux/sched.h:12,
>                  from include/linux/cgroup.h:12,
>                  from kernel/cgroup/cgroup-internal.h:5,
>                  from kernel/cgroup/cgroup.c:31:
> kernel/cgroup/cgroup.c: In function 'of_css':
> kernel/cgroup/cgroup.c:651:42: warning: array subscript '<unknown>' is outside the bounds of an
> interior zero-length array 'struct cgroup_subsys_state *[0]' [-Wzero-length-bounds]
>   651 |   return rcu_dereference_raw(cgrp->subsys[cft->ss->id]);
> 
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Zefan Li <lizefan.x@...edance.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: cgroups@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>

Applied to cgroup/for-5.15.

Thanks.

-- 
tejun

Powered by blists - more mailing lists