]> git.baikalelectronics.ru Git - kernel.git/commit
ide: memory overrun in ide_get_identity_ioctl() on big endian machines using ioctl...
authorChristian Engelmayer <christian.engelmayer@frequentis.com>
Tue, 30 Jun 2009 02:31:41 +0000 (19:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2009 02:31:41 +0000 (19:31 -0700)
commite3da6f2a7d2bade88ddcc0cb72b5fab6b63afb51
treea238f98c80917c37dc46dabf19a7d5510605968b
parent0a1c244bad221831fda0fc568e6333e8d4bc3fa8
ide: memory overrun in ide_get_identity_ioctl() on big endian machines using ioctl HDIO_OBSOLETE_IDENTITY

This patch fixes a memory overrun in function ide_get_identity_ioctl() which
chooses the size of a memory buffer depending on the ioctl command that led
to the function call, however, passes that buffer to a function which needs the
buffer size to be always chosen unconditionally.

Due to conditional compilation the memory overrun can only happen on big endian
machines. The error can be triggered using ioctl HDIO_OBSOLETE_IDENTITY. Usage
of ioctl HDIO_GET_IDENTITY is safe.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ide/ide-ioctls.c