Skip to content
Commit 5527d0ea authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents 584c19f9 8a446536
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment