All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks
Date: Tue, 1 Dec 2020 10:39:15 +0800	[thread overview]
Message-ID: <11c11980-1cef-eac5-d42a-4acd4d87565c@huawei.com> (raw)
In-Reply-To: <X8U1zbBa4IaaSYXV@sol.localdomain>

On 2020/12/1 2:11, Eric Biggers wrote:
> On Fri, Nov 27, 2020 at 09:01:47AM +0800, Chao Yu wrote:
>> On 2020/11/27 1:55, Eric Biggers wrote:
>>> On Thu, Nov 26, 2020 at 06:37:09PM +0800, Chao Yu wrote:
>>>> Support to use address space of inner inode to cache compressed block,
>>>> in order to improve cache hit ratio of random read.
>>>>
>>>> Signed-off-by: Chao Yu <yuchao0@huawei.com>
>>>
>>> If the file is also encrypted, are the compressed pages that are cached still
>>> encrypted, or are they decrypted?
>>
>> In current implementation, they are decrypted in cache.
>>
> 
> One of the things the FS_IOC_REMOVE_ENCRYPTION key ioctl is supposed to
> accomplish is evicting all the pagecache pages for all encrypted files that were
> using a particular key.  This happens as a consequence of the ioctl evicting the
> inodes that were using that key.  If the user is also using the init_on_free=1
> kernel command-line option to enable automatic zeroing of all freed memory, that
> should cause those inode's pagecache pages (which contain decrypted data) to be
> zeroed, so that they can't be compromised later by an online attack.
> 
> This new filesystem-wide cache containing decrypted pages might break that.  It
> sounds like when an inode is evicted, its cached pages won't necessarily be
> evicted from this new filesystem-wide cache.

Correct.

> 
> Can you ensure that pages get evicted from this new cache when the inode to
> which they belong is evicted?

Not yet with current implementation, let me consider to find a way to make sure
all cached compressed pages being evicted during f2fs_evict_inode().

Thanks,

> 
> - Eric
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <yuchao0@huawei.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: <jaegeuk@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks
Date: Tue, 1 Dec 2020 10:39:15 +0800	[thread overview]
Message-ID: <11c11980-1cef-eac5-d42a-4acd4d87565c@huawei.com> (raw)
In-Reply-To: <X8U1zbBa4IaaSYXV@sol.localdomain>

On 2020/12/1 2:11, Eric Biggers wrote:
> On Fri, Nov 27, 2020 at 09:01:47AM +0800, Chao Yu wrote:
>> On 2020/11/27 1:55, Eric Biggers wrote:
>>> On Thu, Nov 26, 2020 at 06:37:09PM +0800, Chao Yu wrote:
>>>> Support to use address space of inner inode to cache compressed block,
>>>> in order to improve cache hit ratio of random read.
>>>>
>>>> Signed-off-by: Chao Yu <yuchao0@huawei.com>
>>>
>>> If the file is also encrypted, are the compressed pages that are cached still
>>> encrypted, or are they decrypted?
>>
>> In current implementation, they are decrypted in cache.
>>
> 
> One of the things the FS_IOC_REMOVE_ENCRYPTION key ioctl is supposed to
> accomplish is evicting all the pagecache pages for all encrypted files that were
> using a particular key.  This happens as a consequence of the ioctl evicting the
> inodes that were using that key.  If the user is also using the init_on_free=1
> kernel command-line option to enable automatic zeroing of all freed memory, that
> should cause those inode's pagecache pages (which contain decrypted data) to be
> zeroed, so that they can't be compromised later by an online attack.
> 
> This new filesystem-wide cache containing decrypted pages might break that.  It
> sounds like when an inode is evicted, its cached pages won't necessarily be
> evicted from this new filesystem-wide cache.

Correct.

> 
> Can you ensure that pages get evicted from this new cache when the inode to
> which they belong is evicted?

Not yet with current implementation, let me consider to find a way to make sure
all cached compressed pages being evicted during f2fs_evict_inode().

Thanks,

> 
> - Eric
> .
> 

  reply	other threads:[~2020-12-01  2:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 10:37 [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks Chao Yu
2020-11-26 10:37 ` Chao Yu
2020-11-26 17:55 ` [f2fs-dev] " Eric Biggers
2020-11-26 17:55   ` Eric Biggers
2020-11-27  1:01   ` Chao Yu
2020-11-27  1:01     ` Chao Yu
2020-11-30 18:11     ` Eric Biggers
2020-11-30 18:11       ` Eric Biggers
2020-12-01  2:39       ` Chao Yu [this message]
2020-12-01  2:39         ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11c11980-1cef-eac5-d42a-4acd4d87565c@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.