Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lockd: fix access beyond unterminated strings in prints

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>

authored by

Amir Goldstein and committed by
J. Bruce Fields
93f38b6f bb6ad557

+1 -1
+1 -1
fs/lockd/host.c
··· 341 341 }; 342 342 struct lockd_net *ln = net_generic(net, lockd_net_id); 343 343 344 - dprintk("lockd: %s(host='%*s', vers=%u, proto=%s)\n", __func__, 344 + dprintk("lockd: %s(host='%.*s', vers=%u, proto=%s)\n", __func__, 345 345 (int)hostname_len, hostname, rqstp->rq_vers, 346 346 (rqstp->rq_prot == IPPROTO_UDP ? "udp" : "tcp")); 347 347