]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: use memcpy instead of snprintf to avoid out of bounds read
authorKarsten Graul <kgraul@linux.ibm.com>
Fri, 8 Apr 2022 15:10:33 +0000 (17:10 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Apr 2022 01:28:02 +0000 (18:28 -0700)
commitfe45bd9dcccc389ed7250b1ede82f64b1d37819a
tree666273ed9f19268849848299b5d730a50c3b12a2
parent50e61c12c5f75e449a543eeef7259678c8220ad6
net/smc: use memcpy instead of snprintf to avoid out of bounds read

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: c5ff3f43fb08 ("net/smc: add support for user defined EIDs")
Fixes: 1f5feb3c9c2f ("net/smc: add generic netlink support for system EID")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_clc.c