lkml.org 
[lkml]   [2021]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 linux-next] scsi: scsi_debug: fix type in min_t to avoid stack OOB
Date
On Tue, 9 Nov 2021 13:57:27 -0500, George Kennedy wrote:

> Change min_t() to use type "u32" instead of type "int" to
> avoid stack out of bounds. With min_t() type "int" the values get
> sign extended and the larger value gets used causing stack out of bounds.
>
> BUG: KASAN: stack-out-of-bounds in memcpy include/linux/fortify-string.h:191 [inline]
> BUG: KASAN: stack-out-of-bounds in sg_copy_buffer+0x1de/0x240 lib/scatterlist.c:976
> Read of size 127 at addr ffff888072607128 by task syz-executor.7/18707
>
> [...]

Applied to 5.16/scsi-fixes, thanks!

[1/1] scsi: scsi_debug: fix type in min_t to avoid stack OOB
https://git.kernel.org/mkp/scsi/c/36e07d7ede88

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2021-11-19 05:17    [W:0.043 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site