OSDN Git Service

scsi: sg: sg_ioctl(): fix copyout handling
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 17 Oct 2019 19:39:18 +0000 (20:39 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Nov 2019 05:04:03 +0000 (00:04 -0500)
commita16a47416d3f4f78dd8766e3278459ead45d6193
tree5cafe0dc091aa5cae8b98206d6996ff4c099def9
parentec990306f77fd4c58c3b27cc3b3c53032d6e6670
scsi: sg: sg_ioctl(): fix copyout handling

First of all, __put_user() can fail with access_ok() succeeding.  And
access_ok() + __copy_to_user() is spelled copy_to_user()...

__put_user() *can* fail with access_ok() succeeding...

Link: https://lore.kernel.org/r/20191017193925.25539-1-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sg.c