]> git.baikalelectronics.ru Git - kernel.git/commit
net/9p: use memcpy() instead of snprintf() in p9_mount_tag_show()
authorAndrey Ryabinin <a.ryabinin@samsung.com>
Tue, 27 Jan 2015 13:00:19 +0000 (16:00 +0300)
committerEric Van Hensbergen <ericvh@gmail.com>
Fri, 20 Mar 2015 14:34:43 +0000 (07:34 -0700)
commit4cfdf192b1b555ce4cd6c1d31cd07254e6d76f12
tree600cff80e3c7483509d90ef2a4dad7db529a5ec3
parent20ce37de7bf47a2f8d59b5b1c69469c8cacddf75
net/9p: use memcpy() instead of snprintf() in p9_mount_tag_show()

p9_mount_tag_show() uses '%s' format string to print
non-NULL terminated chan->tag string. This leads
to out of bounds memory read, because format '%s'
implies that string is NULL-terminated.

The length of string is know here, so its simpler and safer
to use memcpy instead of snprintf().

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p/trans_virtio.c