]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] sd: fix memory corruption with broken mode page headers
authorAl Viro <viro@ftp.linux.org.uk>
Sun, 26 Feb 2006 14:34:10 +0000 (08:34 -0600)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 26 Feb 2006 17:09:49 +0000 (09:09 -0800)
commitbf6b2a45900475f5e9416af6d24fa744572a73af
tree425e0dda8d5fec842ffdd3b2cdadfeaf60f5a668
parente7d18b86c552ef520c2c617bf22ac9ff1c5d47d6
[PATCH] sd: fix memory corruption with broken mode page headers

There's a problem in sd where we blindly believe the length of the
headers and block descriptors.  Some devices return insane values for
these and cause our length to end up greater than the actual buffer
size, so check to make sure.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Also removed the buffer size magic number (512) and added DPOFUA of
zero to the defaults

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/scsi/sd.c