From: Alan Stern Date: Fri, 6 Sep 2013 15:49:51 +0000 (-0400) Subject: [SCSI] sd: Fix potential out-of-bounds access X-Git-Tag: v3.12-rc1~7^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=984f1733fcee3fbc78d47e26c5096921c5d9946a;p=pandora-kernel.git [SCSI] sd: Fix potential out-of-bounds access This patch fixes an out-of-bounds error in sd_read_cache_type(), found by Google's AddressSanitizer tool. When the loop ends, we know that "offset" lies beyond the end of the data in the buffer, so no Caching mode page was found. In theory it may be present, but the buffer size is limited to 512 bytes. Signed-off-by: Alan Stern Reported-by: Dmitry Vyukov CC: Signed-off-by: James Bottomley --- Reading git-diff-tree failed