Re: [PATCH v2 2/5] params: Do not go over the limit when getting the string length

2023-10-02 Thread Kees Cook
On Mon, Oct 02, 2023 at 03:48:53PM +0300, Andy Shevchenko wrote: > We can use strnlen() even on early stages and it prevents from > going over the string boundaries in case it's already too long. It makes sense to avoid calling strlen() multiple times. I don't have much opinion one way or another

[PATCH v2 2/5] params: Do not go over the limit when getting the string length

2023-10-02 Thread Andy Shevchenko
We can use strnlen() even on early stages and it prevents from going over the string boundaries in case it's already too long. Signed-off-by: Andy Shevchenko --- kernel/params.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index 6