[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZREuh1OQR5MBpRmQ@smile.fi.intel.com>
Date: Mon, 25 Sep 2023 09:53:59 +0300
From: Andy Shevchenko <andy@...nel.org>
To: Kees Cook <keescook@...omium.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, linux-gpio@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] gpiolib: cdev: Annotate struct linereq with __counted_by
On Fri, Sep 22, 2023 at 10:52:03AM -0700, Kees Cook wrote:
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
> (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
> functions).
>
> As found with Coccinelle[1], add __counted_by for struct linereq.
> Additionally, since the element count member must be set before accessing
> the annotated flexible array member, move its initialization earlier.
Ah, hadn't taken into account in my patch, so, Bart, feel free to ignore mine
and apply this one.
Reviewed-by: Andy Shevchenko <andy@...nel.org>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists