From: Amir Goldstein Date: Fri, 28 Sep 2018 17:41:48 +0000 (+0300) Subject: lockd: fix access beyond unterminated strings in prints X-Git-Tag: v4.19.2~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86edf5629edc161a5fbe6c5d9179f7fe8629c557;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/lockd/host.c b/fs/lockd/host.c index d35cd6b..93fb7cf0 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -341,7 +341,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"));