]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: BusLogic: Avoid unbounded vsprintf() use
authorMaciej W. Rozycki <macro@orcam.me.uk>
Tue, 20 Apr 2021 18:01:52 +0000 (20:01 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Aug 2021 17:26:38 +0000 (13:26 -0400)
commita621bd249d954d58b78cf32e1ad7be5410fee56c
treec400a7efc534ef75e6a5acd85d667069cf898ec9
parentd02deb7473cec363a4e7fd59736b1a98abaada91
scsi: BusLogic: Avoid unbounded vsprintf() use

Existing blogic_msg() invocations do not appear to overrun its internal
buffer of a fixed length of 100, which would cause stack corruption, but
it's easy to miss with possible further updates and a fix is cheap in
performance terms, so limit the output produced into the buffer by using
vscnprintf() rather than vsprintf().

Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201939390.44318@angie.orcam.me.uk
Acked-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/BusLogic.c