]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/blk-map.c
blk_rq_map_user_iov: fix error override
authorDouglas Gilbert <dgilbert@interlog.com>
Sun, 14 Jan 2018 22:00:48 +0000 (17:00 -0500)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Feb 2018 14:46:35 +0000 (08:46 -0600)
commit0f330296b2694faaf6914c5ae147f884ab79ba4d
tree1546f6f3267254fd97fdb9d649d518fb413a3e06
parente4b94f036d51033ad5247270d120b42873325de6
blk_rq_map_user_iov: fix error override

BugLink: http://bugs.launchpad.net/bugs/1752119
commit 69e0927b3774563c19b5fb32e91d75edc147fb62 upstream.

During stress tests by syzkaller on the sg driver the block layer
infrequently returns EINVAL. Closer inspection shows the block
layer was trying to return ENOMEM (which is much more
understandable) but for some reason overroad that useful error.

Patch below does not show this (unchanged) line:
   ret =__blk_rq_map_user_iov(rq, map_data, &i, gfp_mask, copy);
That 'ret' was being overridden when that function failed.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
block/blk-map.c