net/smc: use memcpy instead of snprintf to avoid out of bounds read
mainline inclusion from mainline-v5.11-rc4 commit 8a446536 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I78IFM CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=8a4465368964b4fbaf084760c94c7aabf61059fb -------------------------------- Using snprintf() to convert not null-terminated strings to null terminated strings may cause out of bounds read in the source string. Therefore use memcpy() and terminate the target string with a null afterwards. Fixes: a3db10ef ("net/smc: Add support for obtaining SMCR device list") Signed-off-by:Guvenc Gulce <guvenc@linux.ibm.com> Signed-off-by:
Karsten Graul <kgraul@linux.ibm.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Yingyu Zeng <zengyingyu@sangfor.com.cn>
Loading
Please sign in to comment