[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180308215019.399ebdb4@heffalump.sk2.org>
Date: Thu, 8 Mar 2018 21:50:19 +0100
From: Stephen Kitt <steve@....org>
To: Kees Cook <keescook@...omium.org>
Cc: hare <hare@...e.com>, linux-scsi@...r.kernel.org,
Kernel Hardening <kernel-hardening@...ts.openwall.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] aic7xxx/aic79xx: remove VLAs
On Thu, 8 Mar 2018 11:52:25 -0800, Kees Cook <keescook@...omium.org> wrote:
> On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt <steve@....org> wrote:
> > -static const int num_critical_sections = sizeof(critical_sections)
> > - / sizeof(*critical_sections);
> > +#define NUM_CRITICAL_SECTIONS 14
>
> The compiler doesn't treat "const" as a literal, hence the need to
> change this. However, you can still use the sizeof (actually, this is
> exactly ARRAY_SIZE()). Perhaps:
>
> #define NUM_CRITICAL_SECTIONS ARRAY_SIZE(critical_sections)
>
> ?
>
> Otherwise, looks great!
Thanks, v2 incoming...
Regards,
Stephen
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists