summaryrefslogtreecommitdiff
path: root/fs/lockd
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-09-28 20:41:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-13 11:17:02 -0800
commit5c22b67bc29defe0a68f603f22456ee5c1024cbe (patch)
treefcf5756fb51d18fd640d6df46132189adcf9034c /fs/lockd
parent5727dbcd2628f30b7063c89f6b1eb028e9fef540 (diff)
lockd: fix access beyond unterminated strings in prints
commit 93f38b6fae0ea8987e22d9e6c38f8dfdccd867ee upstream. printk format used %*s instead of %.*s, so hostname_len does not limit the number of bytes accessed from hostname. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index d716c9993a26..c7eb47f2fb6c 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -340,7 +340,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
};
struct lockd_net *ln = net_generic(net, lockd_net_id);
- dprintk("lockd: %s(host='%*s', vers=%u, proto=%s)\n", __func__,
+ dprintk("lockd: %s(host='%.*s', vers=%u, proto=%s)\n", __func__,
(int)hostname_len, hostname, rqstp->rq_vers,
(rqstp->rq_prot == IPPROTO_UDP ? "udp" : "tcp"));