From: Jakub Kicinski Date: Wed, 13 Jan 2021 04:22:14 +0000 (-0800) Subject: Merge branch 'net-smc-fix-out-of-bound-access-in-netlink-interface' X-Git-Tag: Ubuntu-5.11.0-11.12~659^2~17 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5527d0ea199354c798a63b50d911eeda6ee471ba;p=mirror_ubuntu-hirsute-kernel.git 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 --- 5527d0ea199354c798a63b50d911eeda6ee471ba