]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
io_uring: io_allocate_scq_urings() should return a sane state
authorJens Axboe <axboe@kernel.dk>
Wed, 20 Nov 2019 16:26:29 +0000 (09:26 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 16:10:11 +0000 (10:10 -0600)
commit58779df8c54774adbbc3faf16a38a186d6fc2a28
treedf5b6135942313f72c2661d20a3c73b7b24137be
parentb779b1c03ddd899b3304c75cb80fedca0e180fd7
io_uring: io_allocate_scq_urings() should return a sane state

BugLink: https://bugs.launchpad.net/bugs/1858429
[ Upstream commit eb065d301e8c83643367bdb0898becc364046bda ]

We currently rely on the ring destroy on cleaning things up in case of
failure, but io_allocate_scq_urings() can leave things half initialized
if only parts of it fails.

Be nice and return with either everything setup in success, or return an
error with things nicely cleaned up.

Reported-by: syzbot+0d818c0d39399188f393@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/io_uring.c