]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
sg_write()/bsg_write() is not fit to be called under KERNEL_DS
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 16 Dec 2016 18:42:06 +0000 (13:42 -0500)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 11:26:12 +0000 (11:26 +0000)
commit281fcfaf3ac17944d8ef04bd3644372ceb3ddc77
treef4c5a86862802a84040a44511bf7eb04ce42801b
parent98bc09660cf447af15e19ec44b3897583604d56f
sg_write()/bsg_write() is not fit to be called under KERNEL_DS

BugLink: http://bugs.launchpad.net/bugs/1655041
commit 128394eff343fc6d2f32172f03e24829539c5835 upstream.

Both damn things interpret userland pointers embedded into the payload;
worse, they are actually traversing those.  Leaving aside the bad
API design, this is very much _not_ safe to call with KERNEL_DS.
Bail out early if that happens.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
block/bsg.c
drivers/scsi/sg.c