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] [day] [month] [year] [list]
Message-ID: <YKzfWhcraThWtwy9@dhcp22.suse.cz>
Date:   Tue, 25 May 2021 13:28:26 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     wenhuizhang <wenhui@...ail.gwu.edu>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Shakeel Butt <shakeelb@...gle.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Roman Gushchin <guro@...com>,
        Muchun Song <songmuchun@...edance.com>,
        Yang Shi <shy828301@...il.com>, Alex Shi <alexs@...nel.org>,
        Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
        Wei Yang <richard.weiyang@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] memcontrol: use flexible-array member

On Tue 18-05-21 16:09:08, wenhuizhang wrote:
> Change depracated zero-length-and-one-element-arrays into flexible
> array member.Zero-length and one-element arrays detected by Lukas's CodeChecker.
> Zero/one element arrays causes undefined behaviours if sizeof() used.
> 
> Signed-off-by: wenhuizhang <wenhui@...ail.gwu.edu>

Acked-by: Michal Hocko <mhocko@...e.com>

Thanks!
> ---
>  include/linux/memcontrol.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 0ce97eff79e2..3cc18c2176e7 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -349,8 +349,7 @@ struct mem_cgroup {
>  	struct deferred_split deferred_split_queue;
>  #endif
>  
> -	struct mem_cgroup_per_node *nodeinfo[0];
> -	/* WARNING: nodeinfo must be the last member here */
> +	struct mem_cgroup_per_node *nodeinfo[];
>  };
>  
>  /*
> -- 
> 2.17.1

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ