Skip to content

Commit

Permalink
lockd: fix access beyond unterminated strings in prints
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amir Goldstein authored and J. Bruce Fields committed Oct 29, 2018
1 parent bb6ad55 commit 93f38b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down

0 comments on commit 93f38b6

Please sign in to comment.