]> git.baikalelectronics.ru Git - kernel.git/commit
staging: lustre: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Wed, 7 Mar 2018 20:54:44 +0000 (12:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Mar 2018 17:52:33 +0000 (09:52 -0800)
commitbe2f5ee366146402c92bb2605d9705de5a93179b
tree151ffa85017e8977269b87af0e2cef281d0c27df
parent81c15c4e76138507f47fc159183204552ba2fd39
staging: lustre: Remove VLA usage

The kernel would like to have all stack VLA usage removed[1]. This switches
to a simple kasprintf() instead, and in the process fixes an off-by-one
between the allocation and the sprintf (allocation did not include NULL
byte in calculation).

[1] https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/xattr.c