]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] sg: return EFAULT for an invalid user address
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fri, 3 Apr 2009 15:35:42 +0000 (00:35 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 27 Apr 2009 14:38:11 +0000 (09:38 -0500)
commit471684bcc4711ed2559342c3afdcb5c8903c0a04
tree3edc28a8f84a84b9893813e047b805e2915528c5
parent8f1a9ac4a3a9b60cba2814b719f61ce4ab8418bd
[SCSI] sg: return EFAULT for an invalid user address

blk_rq_unmap_user() returns EFAULT if a program passes an invalid
address to kernel (the kernel fails to copy data to user space). sg
needs to pass the returned value to user space instead of ignoring
it. Before the block layer conversion, sg returns EFAULT
properly. This restores the old behavior.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sg.c