]> git.karo-electronics.de Git - linux-beck.git/commit
ipr: Fix out-of-bounds null overwrite
authorInsu Yun <wuninsu@gmail.com>
Wed, 6 Jan 2016 17:44:01 +0000 (12:44 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 8 Jan 2016 02:51:19 +0000 (21:51 -0500)
commitd63c7dd5bcb9441af0526d370c43a65ca2c980d9
tree63e4b30f998ecafe86821e5e4590973f1acebd97
parent9055082fb100cc66e20c048251d05159f5f2cfba
ipr: Fix out-of-bounds null overwrite

Return value of snprintf is not bound by size value, 2nd argument.
(https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html).
Return value is number of printed chars, can be larger than 2nd
argument.  Therefore, it can write null byte out of bounds ofbuffer.
Since snprintf puts null, it does not need to put additional null byte.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ipr.c