]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'net-smc-fix-out-of-bound-access-in-netlink-interface'
authorJakub Kicinski <kuba@kernel.org>
Wed, 13 Jan 2021 04:22:14 +0000 (20:22 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Jan 2021 04:22:15 +0000 (20:22 -0800)
commit707dd930d6e723655eef6f86a111ab61f8833d46
tree06a00842a100de9d64eaac60c872e98a060714db
parent31d027198b1e103927af1dfa716999b6e5e42bba
parent12950765bc1269bbdc502f354255d5415ed96154
Merge branch 'net-smc-fix-out-of-bound-access-in-netlink-interface'

Karsten Graul says:

====================
net/smc: fix out of bound access in netlink interface

Both patches fix possible out-of-bounds reads. The original code expected
that snprintf() reads len-1 bytes from source and appends the terminating
null, but actually snprintf() first copies len bytes and finally overwrites
the last byte with a null.
Fix this by using memcpy() and terminating the string afterwards.
====================

Link: https://lore.kernel.org/r/20210112162122.26832-1-kgraul@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>