[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADmuW3VmbjBpy9CG2h_7LJp3Vw9F39LEarEtvZOwHstEejuwWA@mail.gmail.com>
Date: Wed, 30 Aug 2023 11:47:21 -0400
From: Azeem Shaikh <azeemshaikh38@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
David Laight <David.Laight@...lab.com>,
Kees Cook <keescook@...omium.org>
Cc: linux-hardening@...r.kernel.org,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] kobject: Replace strlcpy with strscpy
> - len = strlcpy(&env->buf[env->buflen], subsystem, buffer_size);
> - if (len >= buffer_size) {
> - pr_warn("init_uevent_argv: buffer size of %d too small, needed %d\n",
> - buffer_size, len);
> + len = strscpy(&env->buf[env->buflen], subsystem, buffer_size);
> + if (len < 0) {
> + pr_warn("init_uevent_argv: insufficient buffer space "
> + "(%u left) for %s\n", buffer_size, subsystem);
Please ignore this patch. There's some weird indentation that I
noticed here that I'll fix in v3.
Powered by blists - more mailing lists