[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZfGtX-V35SbUJ6BE7Psa6dqrbcoyP9ABcjroAn_bO8rQ-6wg@mail.gmail.com>
Date: Fri, 3 Dec 2021 15:43:37 +0800
From: Muchun Song <songmuchun@...edance.com>
To: Kees Cook <keescook@...omium.org>
Cc: Mina Almasry <almasrymina@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shakeel Butt <shakeelb@...gle.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] hugetlb/cgroup: Fix copy/paste array assignment
On Fri, Dec 3, 2021 at 2:56 PM Kees Cook <keescook@...omium.org> wrote:
>
> Fix mismatched array assignment, reported by an -Warray-bounds build:
>
> mm/hugetlb_cgroup.c: In function '__hugetlb_cgroup_file_legacy_init':
> mm/hugetlb_cgroup.c:850:35: error: array subscript 8 is above array bounds of 'struct cftype[8]' [-Werror=array-bounds ]
> 850 | cft = &h->cgroup_files_dfl[8];
> | ~~~~~~~~~~~~~~~~~~~^~~
> In file included from mm/hugetlb_cgroup.c:23:
> ./include/linux/hugetlb.h:625:23: note: while referencing 'cgroup_files_dfl'
> 625 | struct cftype cgroup_files_dfl[8];
> | ^~~~~~~~~~~~~~~~
>
> Fixes: e45f4726bcad ("hugetlb: add hugetlb.*.numa_stat file")
> Signed-off-by: Kees Cook <keescook@...omium.org>
Reviewed-by: Muchun Song <songmuchun@...edance.com>
Thanks.
Powered by blists - more mailing lists