lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9208246C-491E-4DA8-9EB3-76F4216B4D4F@oracle.com>
Date:   Wed, 14 Jun 2023 17:01:18 +0000
From:   Chuck Lever III <chuck.lever@...cle.com>
To:     Azeem Shaikh <azeemshaikh38@...il.com>
CC:     Jeff Layton <jlayton@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        "linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>,
        Neil Brown <neilb@...e.de>,
        Olga Kornievskaia <kolga@...app.com>,
        Dai Ngo <dai.ngo@...cle.com>, Tom Talpey <tom@...pey.com>,
        Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH v3] SUNRPC: Use sysfs_emit in place of strlcpy/sprintf



> On Jun 14, 2023, at 9:37 AM, Azeem Shaikh <azeemshaikh38@...il.com> wrote:
> 
> Part of an effort to remove strlcpy() tree-wide [1].
> 
> Direct replacement is safe here since the getter in kernel_params_ops
> handles -errno return [2].
> 
> [1] https://github.com/KSPP/linux/issues/89
> [2] https://elixir.bootlin.com/linux/v6.4-rc6/source/include/linux/moduleparam.h#L52
> 
> Signed-off-by: Azeem Shaikh <azeemshaikh38@...il.com>

Thank you! Applied to nfsd-next.


> ---
> net/sunrpc/svc.c |   10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index e6d4cec61e47..b011c318fef1 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -109,15 +109,15 @@ param_get_pool_mode(char *buf, const struct kernel_param *kp)
> switch (*ip)
> {
> case SVC_POOL_AUTO:
> - return strlcpy(buf, "auto\n", 20);
> + return sysfs_emit(buf, "auto\n");
> case SVC_POOL_GLOBAL:
> - return strlcpy(buf, "global\n", 20);
> + return sysfs_emit(buf, "global\n");
> case SVC_POOL_PERCPU:
> - return strlcpy(buf, "percpu\n", 20);
> + return sysfs_emit(buf, "percpu\n");
> case SVC_POOL_PERNODE:
> - return strlcpy(buf, "pernode\n", 20);
> + return sysfs_emit(buf, "pernode\n");
> default:
> - return sprintf(buf, "%d\n", *ip);
> + return sysfs_emit(buf, "%d\n", *ip);
> }
> }
> 
> -- 
> 2.41.0.162.gfafddb0af9-goog
> 
> 

--
Chuck Lever


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ