]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
jbd2: fix potential buffer head reference count leak
authorYe Bin <yebin10@huawei.com>
Wed, 14 Sep 2022 10:08:11 +0000 (18:08 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:24:02 +0000 (14:24 +0100)
commitf46471a644f270623e79b4c02323052c39ac9ef1
treeb733e05eda5b06a6ef9de9019cf5a57eb8465041
parent6e3110e7baa1774f2ae3c38b2084411e89e959ba
jbd2: fix potential buffer head reference count leak

BugLink: https://bugs.launchpad.net/bugs/1996825
commit e0d5fc7a6d80ac2406c7dfc6bb625201d0250a8a upstream.

As in 'jbd2_fc_wait_bufs' if buffer isn't uptodate, will return -EIO without
update 'journal->j_fc_off'. But 'jbd2_fc_release_bufs' will release buffer head
from ‘j_fc_off - 1’ if 'bh' is NULL will terminal release which will lead to
buffer head buffer head reference count leak.
To solve above issue, update 'journal->j_fc_off' before return -EIO.

Cc: stable@kernel.org
Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220914100812.1414768-2-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/jbd2/journal.c