]> git.itanic.dy.fi Git - linux-stable/commit
libata: add SG safety checks in SFF pio transfers
authorJens Axboe <axboe@kernel.dk>
Wed, 7 Aug 2019 18:23:57 +0000 (12:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:28:45 +0000 (08:28 +0200)
commit3ca013cd63be479be95ea953d08295f05f550c19
treed909025a313060f4ef743c504b592725a45edef1
parent3b84bbef51c486af18fe93320ba85c065cf40caa
libata: add SG safety checks in SFF pio transfers

[ Upstream commit 752ead44491e8c91e14d7079625c5916b30921c5 ]

Abort processing of a command if we run out of mapped data in the
SG list. This should never happen, but a previous bug caused it to
be possible. Play it safe and attempt to abort nicely if we don't
have more SG segments left.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/libata-sff.c