]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commit3e0d3ac3428e400d7991da9511f5d6e7e0d5bd62
treea5445b6333b6118938ea7fa295e5077ab0d8a535
parent2ed2582d3cc48409fab056e850794c07e992c4ec
libata: add SG safety checks in SFF pio transfers

BugLink: https://bugs.launchpad.net/bugs/1842114
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/ata/libata-sff.c