diff options
author | Kees Cook <keescook@chromium.org> | 2022-02-10 01:40:41 +0100 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2022-02-16 23:30:37 +0100 |
commit | 230f6fa2c1db6a3f3e668cfe95995ac8e6eee212 (patch) | |
tree | 0efbee5d1df73b95483adf495bb6e2232342fc7d /lib/Makefile | |
parent | overflow: Implement size_t saturating arithmetic helpers (diff) | |
download | linux-230f6fa2c1db6a3f3e668cfe95995ac8e6eee212.tar.xz linux-230f6fa2c1db6a3f3e668cfe95995ac8e6eee212.zip |
overflow: Provide constant expression struct_size
There have been cases where struct_size() (or flex_array_size()) needs
to be calculated for an initializer, which requires it be a constant
expression. This is possible when the "count" argument is a constant
expression, so provide this ability for the helpers.
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Tested-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/lkml/20220210010407.GA701603@embeddedor
Diffstat (limited to 'lib/Makefile')
0 files changed, 0 insertions, 0 deletions