Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1534728

Re: [PATCH 2/6] fscrypt: Release fscrypt context on in-place encryption

From Eric Biggers <ebiggers@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/6] fscrypt: Release fscrypt context on in-place encryption
Date 2016-12-02 09:20 +0100
Message-ID <sJRex-16S-9@gated-at.bofh.it> (permalink)
References <sJHRU-35y-27@gated-at.bofh.it> <sJI1z-3bb-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Dec 01, 2016 at 11:14:54PM +0100, Richard Weinberger wrote:
> From: David Gstir <david@sigma-star.at>
> 
> In case of in-place encryption ctx must be released right away.
> Otherwise ctx is never freed.
> 

I didn't notice this before, but the fscrypt_ctx isn't actually used at all in
the "own pages" crypto case.  So there's really no need to allocate one.  How
about we just handle the "own pages" case at the beginning of
fscrypt_encrypt_page():

	if (inode->i_sb->s_cop->flags & FS_CFLG_OWN_PAGES) {
		err = do_page_crypto(inode, FS_ENCRYPT, lblk_num, page, page,
				     len, offs, gfp_flags);
		if (err)
			return ERR_PTR(err);
		return page;
	}

	(and the rest essentially the same as it used to be)

Eric

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/6] fscrypt: Release fscrypt context on in-place encryption Richard Weinberger <richard@nod.at> - 2016-12-01 23:30 +0100
  Re: [PATCH 2/6] fscrypt: Release fscrypt context on in-place  encryption Eric Biggers <ebiggers@google.com> - 2016-12-02 09:20 +0100

csiph-web