Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6d0abf9 authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Mohamad Ayyash
Browse files

ext4 crypto: fix memory leak in ext4_bio_write_page()



There are times when ext4_bio_write_page() is called even though we
don't actually need to do any I/O.  This happens when ext4_writepage()
gets called by the jbd2 commit path when an inode needs to force its
pages written out in order to provide data=ordered guarantees --- and
a page is backed by an unwritten (e.g., uninitialized) block on disk,
or if delayed allocation means the page's backing store hasn't been
allocated yet.  In that case, we need to skip the call to
ext4_encrypt_page(), since in addition to wasting CPU, it leads to a
bounce page and an ext4 crypto context getting leaked.

Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTheodore Ts'o <tytso@google.com>
Change-Id: I1951c737742420b10c80eb616abb92af467d80d9
parent c70f019a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment