]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:12:47 +0000 (09:12 -0700)
commit8301f0a22259b1fba75559669413f492ff57e640
treeb7ac47e631bb8825f8318d547b588eb8af8541aa
parentff4fbe975be9e51a5acc84e70c20dee4db542268
ipr: Fix out-of-bounds null overwrite

commit d63c7dd5bcb9441af0526d370c43a65ca2c980d9 upstream.

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>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ipr.c