Re: [stable] ext4 fscrypt_get_encryption_info() circular locking dependency

2020-12-11 Thread Eric Biggers
On Fri, Dec 11, 2020 at 01:08:07PM +0900, Sergey Senozhatsky wrote: > On (20/12/10 19:48), Eric Biggers wrote: > > > > > > [ 133.454836] Chain exists of: > > > jbd2_handle --> fscrypt_init_mutex --> fs_reclaim > > > > >

Re: [PATCH] scsi: ufs: fix memory boundary check for UFS 3.0

2020-12-11 Thread Eric Biggers
On Fri, Dec 11, 2020 at 11:38:14AM -0800, Jaegeuk Kim wrote: > From: Jaegeuk Kim > > If param_offset is greater than what UFS supports, it'll give kernel panic. > > Signed-off-by: Jaegeuk Kim > Change-Id: I48ea6f3f3074bd42abf4ecf8be87806732f3e6a3 > --- > drivers/scsi/ufs/ufshcd.c | 3 +++ > 1

Re: [RFC V1 0/7] Introduce AVX512 optimized crypto algorithms

2020-12-21 Thread Eric Biggers
On Fri, Dec 18, 2020 at 01:10:57PM -0800, Megha Dey wrote: > Optimize crypto algorithms using VPCLMULQDQ and VAES AVX512 instructions > (first implemented on Intel's Icelake client and Xeon CPUs). > > These algorithms take advantage of the AVX512 registers to keep the CPU > busy and increase memor

Re: [f2fs-dev] [PATCH v5 RESEND] f2fs: compress: add compress_inode to cache compressed blocks

2020-12-07 Thread Eric Biggers
On Mon, Dec 07, 2020 at 05:52:20PM +0800, Chao Yu wrote: > diff --git a/Documentation/filesystems/f2fs.rst > b/Documentation/filesystems/f2fs.rst > index dae15c96e659..fd413d319e93 100644 > --- a/Documentation/filesystems/f2fs.rst > +++ b/Documentation/filesystems/f2fs.rst > @@ -268,6 +268,9 @@ co

Re: [f2fs-dev] [PATCH RESEND] f2fs: compress: deny setting unsupported compress algorithm

2020-12-07 Thread Eric Biggers
On Mon, Dec 07, 2020 at 05:56:09PM +0800, Chao Yu wrote: > If kernel doesn't support certain kinds of compress algorithm, deny to set > them as compress algorithm of f2fs via 'compress_algorithm=%s' mount option. > > Signed-off-by: Chao Yu > --- > no changes, just rebase on dev branch. This does

Re: [f2fs-dev] [PATCH v3] f2fs: fix race of pending_pages in decompression

2020-12-07 Thread Eric Biggers
On Sat, Dec 05, 2020 at 01:26:26PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > I found out f2fs_free_dic() is invoked in a wrong timing, but > f2fs_verify_bio() still needed the dic info and it triggered the > below kernel panic. It has been caused by the race condition of > pending_pages v

Re: [f2fs-dev] [PATCH v3] f2fs: compress: support chksum

2020-12-07 Thread Eric Biggers
On Thu, Nov 26, 2020 at 06:32:09PM +0800, Chao Yu wrote: > + if (!ret && fi->i_compress_flag & 1 << COMPRESS_CHKSUM) { This really could use some parentheses. People shouldn't have to look up a C operator precedence table to understand the code. > + u32 provided = le32_to_cpu(dic

Re: [f2fs-dev] [PATCH v3] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-12-07 Thread Eric Biggers
On Thu, Dec 03, 2020 at 03:56:15PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > Added two ioctl to decompress/compress explicitly the compression > enabled file in "compress_mode=user" mount option. > > Using these two ioctls, the users can make a control of compression > and decompression

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: add compress_mode mount option

2020-12-07 Thread Eric Biggers
On Tue, Dec 01, 2020 at 01:08:02PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > We will add a new "compress_mode" mount option to control file > compression mode. This supports "fs" and "user". In "fs" mode (default), > f2fs does automatic compression on the compression enabled files. > In "

Re: [f2fs-dev] [PATCH v3] f2fs: fix race of pending_pages in decompression

2020-12-07 Thread Eric Biggers
On Tue, Dec 08, 2020 at 08:51:45AM +0900, Daeho Jeong wrote: > > I am trying to review this but it is very hard, as the f2fs compression > > code is > > very hard to understand. > > > > It looks like a 'struct decompress_io_ctx' represents the work to > > decompress a > > particular cluster. Sin

[PATCH RESEND] random: initialize ChaCha20 constants with correct endianness

2021-01-12 Thread Eric Biggers
From: Eric Biggers On big endian CPUs, the ChaCha20-based CRNG is using the wrong endianness for the ChaCha20 constants. This doesn't matter cryptographically, but technically it means it's not ChaCha20 anymore. Fix it to always use the standard constants. Cc: linux-cry...@vger.ker

[PATCH RESEND] random: fix the RNDRESEEDCRNG ioctl

2021-01-12 Thread Eric Biggers
From: Eric Biggers The RNDRESEEDCRNG ioctl reseeds the primary_crng from itself, which doesn't make sense. Reseed it from the input_pool instead. Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG") Cc: sta...@vger.kernel.org Cc: linux-cry...@vger.kernel.org Cc: Andy

[PATCH RESEND] random: remove dead code left over from blocking pool

2021-01-12 Thread Eric Biggers
From: Eric Biggers Remove some dead code that was left over following commit 90ea1c6436d2 ("random: remove the blocking pool"). Cc: linux-cry...@vger.kernel.org Cc: Andy Lutomirski Cc: Jann Horn Cc: Theodore Ts'o Reviewed-by: Andy Lutomirski Signed-off-by: Eric Biggers ---

Re: [PATCH 5/5] fs: use HKDF implementation from kernel crypto API

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 08:49:52AM +0100, Stephan Mueller wrote: > > > -int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key, > > > +int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, u8 *master_key, > > >   unsigned int master_key_size); > > > > It shouldn't be

Re: [PATCH 3/5] crypto: add RFC5869 HKDF

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 08:53:15AM +0100, Stephan Mueller wrote: > > > > > RFC5869 > > > allows two optional parameters to be provided to the extract operation: > > > the salt and additional information. Both are to be provided with the > > > seed parameter where the salt is the first entry of the

Re: Aarch64 EXT4FS inode checksum failures - seems to be weak memory ordering issues

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 10:48:05PM +0100, Arnd Bergmann wrote: > On Thu, Jan 7, 2021 at 5:27 PM Theodore Ts'o wrote: > > > > On Thu, Jan 07, 2021 at 01:37:47PM +, Russell King - ARM Linux admin > > wrote: > > > > The gcc bugzilla mentions backports into gcc-linaro, but I do not see > > > > th

Re: Aarch64 EXT4FS inode checksum failures - seems to be weak memory ordering issues

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 10:14:46PM +, Russell King - ARM Linux admin wrote: > On Thu, Jan 07, 2021 at 10:48:05PM +0100, Arnd Bergmann wrote: > > On Thu, Jan 7, 2021 at 5:27 PM Theodore Ts'o wrote: > > > > > > On Thu, Jan 07, 2021 at 01:37:47PM +, Russell King - ARM Linux admin > > > wrote

Re: [PATCH] evm: Fix memleak in init_desc

2021-01-09 Thread Eric Biggers
On Sat, Jan 09, 2021 at 07:33:05PM +0800, Dinghao Liu wrote: > When kmalloc() fails, tmp_tfm allocated by > crypto_alloc_shash() has not been freed, which > leads to memleak. > > Fixes: d46eb3699502b ("evm: crypto hash replaced by shash") > Signed-off-by: Dinghao Liu > --- > security/integrity/e

Re: KMSAN: uninit-value in __crypto_memneq (2)

2021-01-09 Thread Eric Biggers
+Jason, since this looks WireGuard-related. On Sat, Jan 09, 2021 at 05:05:24AM -0800, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:73d62e81 kmsan: random: prevent boot-time reports in _mix_.. > git tree: https://github.com/google/kmsan.git master > co

Re: Re: [PATCH] evm: Fix memleak in init_desc

2021-01-09 Thread Eric Biggers
On Sun, Jan 10, 2021 at 01:27:09PM +0800, dinghao@zju.edu.cn wrote: > > On Sat, Jan 09, 2021 at 07:33:05PM +0800, Dinghao Liu wrote: > > > When kmalloc() fails, tmp_tfm allocated by > > > crypto_alloc_shash() has not been freed, which > > > leads to memleak. > > > > > > Fixes: d46eb3699502b ("

Re: [f2fs-dev] [PATCH AUTOSEL 5.10 10/31] f2fs: Handle casefolding with Encryption

2020-12-30 Thread Eric Biggers
gt; can't compute the dirhash when recovering a new dentry in an encrypted + > casefolded directory. To avoid having to force a checkpoint when a new > file is fsync'ed, store the dirhash on-disk appended to i_name. > > This patch incorporates work by Eric Biggers > and Jae

Re: [PATCH 0/2] crypto: x86/aes-ni-xts - recover and improve performance

2020-12-25 Thread Eric Biggers
hmarked using tcrypt using 1420 byte blocks - full results below) > > It also allows us to enable the same driver for i386. > > Cc: Megha Dey > Cc: Eric Biggers > Cc: Herbert Xu > > Ard Biesheuvel (2): > crypto: x86/aes-ni-xts - use direct calls to and 4-way stri

Re: [PATCH v4 2/5] fs: Check if utf8 encoding is loaded before calling utf8_unload()

2021-03-25 Thread Eric Biggers
On Thu, Mar 25, 2021 at 05:38:08AM +0530, Shreeya Patel wrote: > utf8_unload is being called if CONFIG_UNICODE is enabled. > The ifdef block doesn't check if utf8 encoding has been loaded > or not before calling the utf8_unload() function. > This is not the expected behavior since it would sometime

Re: [PATCH v4 3/5] fs: unicode: Rename function names from utf8 to unicode

2021-03-25 Thread Eric Biggers
On Thu, Mar 25, 2021 at 05:38:09AM +0530, Shreeya Patel wrote: > Rename the function names from utf8 to unicode for taking the first step > towards the transformation of utf8-core file into the unicode subsystem > layer file. > > Reviewed-by: Gabriel Krisman Bertazi > Signed-off-by: Shreeya Patel

Re: [PATCH v4 5/5] fs: unicode: Add utf8 module and a unicode layer

2021-03-25 Thread Eric Biggers
On Thu, Mar 25, 2021 at 05:38:11AM +0530, Shreeya Patel wrote: > Also, indirect calls using function pointers are easily exploitable by > speculative execution attacks, hence use static_call() in unicode.h and > unicode-core.c files inorder to prevent these attacks by making direct > calls and also

Re: [PATCH v4 2/5] fs: Check if utf8 encoding is loaded before calling utf8_unload()

2021-03-25 Thread Eric Biggers
On Thu, Mar 25, 2021 at 03:31:42PM -0400, Gabriel Krisman Bertazi wrote: > Eric Biggers writes: > > > On Thu, Mar 25, 2021 at 05:38:08AM +0530, Shreeya Patel wrote: > >> utf8_unload is being called if CONFIG_UNICODE is enabled. > >> The ifdef block doesn't che

Re: [PATCH v2 3/4] fs: unicode: Use strscpy() instead of strncpy()

2021-03-18 Thread Eric Biggers
On Thu, Mar 18, 2021 at 07:03:04PM +0530, Shreeya Patel wrote: > Following warning was reported by Kernel Test Robot. > > In function 'utf8_parse_version', > inlined from 'utf8_load' at fs/unicode/utf8mod.c:195:7: > >> fs/unicode/utf8mod.c:175:2: warning: 'strncpy' specified bound 12 equals > dest

Re: [PATCH v2 4/4] fs: unicode: Add utf8 module and a unicode layer

2021-03-18 Thread Eric Biggers
On Thu, Mar 18, 2021 at 07:03:05PM +0530, Shreeya Patel wrote: > +struct unicode_ops { > + struct module *owner; > + int (*validate)(const struct unicode_map *um, const struct qstr *str); > + int (*strncmp)(const struct unicode_map *um, const struct qstr *s1, > +cons

Re: [PATCH 01/18] vfs: add miscattr ops

2021-03-22 Thread Eric Biggers
On Wed, Feb 03, 2021 at 01:40:55PM +0100, Miklos Szeredi wrote: > + * Verifying attributes involves retrieving current attributes with > + * i_op->miscattr_get(), this also allows initilaizing attributes that have initilaizing => initializing > +int vfs_miscattr_set(struct dentry *dentry, struct

Re: [PATCH 07/18] f2fs: convert to miscattr

2021-03-22 Thread Eric Biggers
On Wed, Feb 03, 2021 at 01:41:01PM +0100, Miklos Szeredi wrote: > @@ -3071,123 +3012,54 @@ static int f2fs_ioc_setproject(struct file *filp, > __u32 projid) > } > #endif > > -/* FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR support */ > - > -/* > - * To make a new on-disk f2fs i_flag gettable via FS

Re: [PATCH] crypto: poly1305: fix poly1305_core_setkey() declaration

2021-03-22 Thread Eric Biggers
me key". So that's why there's a mix of 16 and 32 byte "keys". The naming "POLY1305_KEY_SIZE" assumes the second convention, which is a bit confusing; it really should be called something like POLY1305_ONETIME_KEY_SIZE. I guess the idea was that the one-time key convention is the more common one. Anyway, the patch seems to be fine, as it uses the correct length in each location. You can add: Reviewed-by: Eric Biggers - Eric

Re: [PATCH] keys: Allow disabling read permissions for key possessor

2021-03-22 Thread Eric Biggers
On Mon, Mar 22, 2021 at 12:57:26PM +0300, Andrey Ryabinin wrote: > keyctl_read_key() has a strange code which allows possessor to read > key's payload regardless of READ permission status: > > $ keyctl add user test test @u > 196773443 > $ keyctl print 196773443 > test > $ keyctl describe 19677344

Re: [PATCH v3 5/5] fs: unicode: Add utf8 module and a unicode layer

2021-03-23 Thread Eric Biggers
On Tue, Mar 23, 2021 at 03:51:44PM -0400, Gabriel Krisman Bertazi wrote: > > -int unicode_validate(const struct unicode_map *um, const struct qstr *str) > > -{ > > - const struct utf8data *data = utf8nfdi(um->version); > > - > > - if (utf8nlen(data, str->name, str->len) < 0) > > - ret

Re: [PATCH v1 3/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys

2021-03-30 Thread Eric Biggers
On Sun, Mar 28, 2021 at 11:37:23PM +0300, Jarkko Sakkinen wrote: > > Unfortunately, TPM trusted keys started this bad security practice, and > obviously it cannot be fixed without breaking uapi backwards compatibility. > The whole point of a randomness source is that it is random. So userspace

Re: [PATCH v2] Documentation: crypto: add info about "fips=" boot option

2021-03-30 Thread Eric Biggers
On Tue, Mar 30, 2021 at 09:38:55AM -0700, Randy Dunlap wrote: > On 3/29/21 10:29 PM, Eric Biggers wrote: > > On Mon, Mar 29, 2021 at 10:06:51PM -0700, Randy Dunlap wrote: > >> Having just seen a report of using "fips=1" on the kernel command line, > >> I coul

[PATCH RESEND] random: initialize ChaCha20 constants with correct endianness

2021-03-21 Thread Eric Biggers
From: Eric Biggers On big endian CPUs, the ChaCha20-based CRNG is using the wrong endianness for the ChaCha20 constants. This doesn't matter cryptographically, but technically it means it's not ChaCha20 anymore. Fix it to always use the standard constants. Cc: linux-cry...@vger.ker

[PATCH RESEND] random: remove dead code left over from blocking pool

2021-03-21 Thread Eric Biggers
From: Eric Biggers Remove some dead code that was left over following commit 90ea1c6436d2 ("random: remove the blocking pool"). Cc: linux-cry...@vger.kernel.org Cc: Andy Lutomirski Cc: Jann Horn Cc: Theodore Ts'o Reviewed-by: Andy Lutomirski Acked-by: Ard Biesheuvel Sign

Re: [PATCH 1/2] ima: don't access a file's integrity status before an IMA policy is loaded

2021-03-22 Thread Eric Biggers
On Mon, Mar 22, 2021 at 11:42:06AM -0400, Mimi Zohar wrote: > Only after an IMA policy is loaded, check, save, or update the cached > file's integrity status. > > Signed-off-by: Mimi Zohar This commit message doesn't describe what the actual effect of this change is. Is it fixing something? - E

Re: [PATCH 2/2] integrity: double check iint_cache was initialized

2021-03-22 Thread Eric Biggers
On Mon, Mar 22, 2021 at 11:42:07AM -0400, Mimi Zohar wrote: > > Reported-by: Dmitry Vyukov > Fixes: 79f7865d844c ("LSM: Introduce "lsm=" for boottime LSM selection") > Signed-off-by: Mimi Zohar Missing Cc stable? - Eric

Re: v5.12.0-rc5: the kernel panics if FIPS mode is on

2021-03-29 Thread Eric Biggers
On Mon, Mar 29, 2021 at 09:56:18PM +, Dexuan Cui wrote: > Hi all, > The v5.12.0-rc5 kernel (1e43c377a79f) panics with fips=1. > > Please refer to the below panic call-trace. The kernel config file and > the full kernel messages are also attached. > > Is this a known issue? > > Thanks, > -- D

Re: [PATCH 1/3] fs/dcache: Add d_clear_dir_neg_dentries()

2021-03-29 Thread Eric Biggers
On Sun, Mar 28, 2021 at 11:43:54AM -0300, André Almeida wrote: > For directories with negative dentries that are becoming case-insensitive > dirs, we need to remove all those negative dentries, otherwise they will > become dangling dentries. During the creation of a new file, if a d_hash > collisio

Re: [PATCH v5 2/4] fs: unicode: Rename function names from utf8 to unicode

2021-03-29 Thread Eric Biggers
On Tue, Mar 30, 2021 at 02:12:38AM +0530, Shreeya Patel wrote: > utf8data.h_shipped has a large database table which is an auto-generated > decodification trie for the unicode normalization functions and it is not > necessary to carry this large table in the kernel. > Goal is to make UTF-8 encoding

Re: [PATCH v5 4/4] fs: unicode: Add utf8 module and a unicode layer

2021-03-29 Thread Eric Biggers
On Tue, Mar 30, 2021 at 02:12:40AM +0530, Shreeya Patel wrote: > diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig > index 2c27b9a5cd6c..ad4b837f2eb2 100644 > --- a/fs/unicode/Kconfig > +++ b/fs/unicode/Kconfig > @@ -2,13 +2,26 @@ > # > # UTF-8 normalization > # > +# CONFIG_UNICODE will be au

Re: [PATCH v2] Documentation: crypto: add info about "fips=" boot option

2021-03-29 Thread Eric Biggers
-cry...@vger.kernel.org > Cc: Eric Biggers > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Jonathan Corbet > Cc: linux-...@vger.kernel.org > --- > Updates/corrections welcome. > > v2: drop comment that "fips_enabled can cause some tests to be

Re: [PATCH v5 4/4] fs: unicode: Add utf8 module and a unicode layer

2021-03-29 Thread Eric Biggers
On Mon, Mar 29, 2021 at 10:16:57PM -0400, Gabriel Krisman Bertazi wrote: > Eric Biggers writes: > > > On Tue, Mar 30, 2021 at 02:12:40AM +0530, Shreeya Patel wrote: > >> diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig > >> index 2c27b9a5cd6c..ad4b837f2eb

Re: [PATCH v2 1/8] block: introduce blk_ksm_is_empty()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:02PM +, Satya Tangirala wrote: > This function checks if a given keyslot manager supports any encryption > mode/data unit size combination (and returns true if there is no such > supported combination). Helps clean up code a little. > > Signed-off-by: Satya Tangir

Re: [PATCH v2 2/8] dm,mmc,ufshcd: handle error from blk_ksm_register()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:03PM +, Satya Tangirala wrote: > Handle any error from blk_ksm_register() in the callers. Previously, > the callers ignored the return value because blk_ksm_register() wouldn't > fail as long as the request_queue didn't have integrity support too, but > as this is

Re: [PATCH v2 3/8] block: blk-crypto: introduce blk_crypto_bio_sectors_alignment()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:04PM +, Satya Tangirala wrote: > The size of any bio must be aligned to the data unit size of the bio crypt > context (if it exists) of that bio. This must also be ensured whenever a > bio is split. Introduce blk_crypto_bio_sectors_alignment() that returns > the re

Re: [PATCH v2 4/8] block: introduce bio_required_sector_alignment()

2021-04-15 Thread Eric Biggers
On Tue, Mar 30, 2021 at 07:06:53PM +0100, Christoph Hellwig wrote: > On Thu, Mar 25, 2021 at 09:26:05PM +, Satya Tangirala wrote: > > +/* > > + * The required sector alignment for a bio. The number of sectors in any > > bio > > + * that's constructed/split must be aligned to this value. > > +

Re: [PATCH v2 4/8] block: introduce bio_required_sector_alignment()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:05PM +, Satya Tangirala wrote: > This function returns the required alignment for the number of sectors in > a bio. In particular, the number of sectors passed to bio_split() must be > aligned to this value. > > Signed-off-by: Satya Tangirala > --- > block/blk.h

Re: [PATCH v2 5/8] block: respect bio_required_sector_alignment() in blk-crypto-fallback

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:06PM +, Satya Tangirala wrote: > Make blk_crypto_split_bio_if_needed() respect > bio_required_sector_alignment() when calling bio_split(). > A bit more explanation would be helpful here. Does this fix something, and if so what is it and under what circumstances?

Re: [PATCH v2 6/8] block: keyslot-manager: introduce blk_ksm_restrict_dus_to_queue_limits()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:07PM +, Satya Tangirala wrote: > Not all crypto data unit sizes might be supported by the block layer due to > certain queue limits. This new function checks the queue limits and > appropriately modifies the keyslot manager to reflect only the supported > crypto da

Re: [PATCH v2 8/8] block: add WARN() in bio_split() for sector alignment

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:09PM +, Satya Tangirala wrote: > The number of sectors passed to bio_split() should be aligned to > bio_required_sector_alignment(). All callers (other than bounce.c) have > been updated to ensure this, so add a WARN() if the number of sectors is > not aligned. (bo

Re: [PATCH v8 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-15 Thread Eric Biggers
On Thu, Apr 15, 2021 at 03:46:46PM -0400, Chris von Recklinghausen wrote: > Hibernation fails on a system in fips mode because md5 is used for the e820 > integrity check and is not available. Use crc32 instead. > > This patch changes the integrity check algorithm from md5 to crc32. The second par

Re: [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-12 Thread Eric Biggers
t; v2 >bump up RESTORE_MAGIC > v2 -> v3 >move embelishment from cover letter to commit comments (no code change) > v3 -> v4 >add note to comments that md5 isn't used for encryption here. > v4 -> v5 >reword comment per Simo's suggestion > v5

Re: [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-12 Thread Eric Biggers
On Mon, Apr 12, 2021 at 03:04:58PM -0400, Chris von Recklinghausen wrote: > On 4/12/21 1:45 PM, Eric Biggers wrote: > > On Mon, Apr 12, 2021 at 10:09:32AM -0400, Chris von Recklinghausen wrote: > > > Suspend fails on a system in fips mode because md5 is used for the e820 > &g

Re: [PATCH v7 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-13 Thread Eric Biggers
On Tue, Apr 13, 2021 at 12:13:30PM -0400, Chris von Recklinghausen wrote: > +static inline void get_e820_crc32(struct e820_table *table, void *buf) > { This should just return the CRC-32 value as a u32. There's no need for the 'void *buf' argument. Also like I said, compute_e820_crc32() would b

Re: [PATCH v7 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-13 Thread Eric Biggers
On Tue, Apr 13, 2021 at 12:13:30PM -0400, Chris von Recklinghausen wrote: > Suspend fails on a system in fips mode because md5 is used for the e820 Suspend to disk (hibernation), or any suspend? > struct restore_data_record { > unsigned long jump_address; > unsigned long jump_address

Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-04-14 Thread Eric Biggers
On Wed, Apr 14, 2021 at 11:01:29AM -0700, Nick Terrell wrote: > Hi all, > > I would really like to make some progress on this and get it merged. > This patchset offsers: > * 15-30% better decompression speed > * 3 years of zstd bug fixes and code improvements > * Allows us to import zstd directly

Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-04-14 Thread Eric Biggers
On Wed, Apr 14, 2021 at 11:53:51AM -0700, Nick Terrell wrote: > On Wed, Apr 14, 2021 at 11:35 AM Eric Biggers wrote: > > > > On Wed, Apr 14, 2021 at 11:01:29AM -0700, Nick Terrell wrote: > > > Hi all, > > > > > > I would really like to make some prog

Re: [PATCH v1 3/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys

2021-03-31 Thread Eric Biggers
On Thu, Apr 01, 2021 at 02:31:46AM +0300, Jarkko Sakkinen wrote: > > It's a bummer but uapi is the god in the end. Since TPM does not do it > today, that behaviour must be supported forever. That's why a boot option > AND a warning would be the best compromise. > It's not UAPI if there is no way

Re: [PATCH v1 3/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys

2021-03-31 Thread Eric Biggers
On Thu, Apr 01, 2021 at 08:50:05AM +0300, Jarkko Sakkinen wrote: > On Thu, Apr 01, 2021 at 12:11:32PM +1100, Herbert Xu wrote: > > On Wed, Mar 31, 2021 at 04:34:29PM -0700, Eric Biggers wrote: > > > On Thu, Apr 01, 2021 at 02:31:46AM +0300, Jarkko Sakkinen wrote: > > > &

Re: Fix hibernation in FIPS mode?

2021-04-01 Thread Eric Biggers
On Thu, Apr 01, 2021 at 09:54:21AM -0400, Chris von Recklinghausen wrote: > On 4/1/21 9:38 AM, Rafael J. Wysocki wrote: > > On Thu, Apr 1, 2021 at 10:47 AM Ard Biesheuvel wrote: > > > On Tue, 30 Mar 2021 at 21:56, Simo Sorce wrote: > > > > On Tue, 2021-03-30 at 21:45 +0200, Ard Biesheuvel wrote:

Re: [PATCH 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-01 Thread Eric Biggers
On Thu, Apr 01, 2021 at 06:19:57PM +0200, Rafael J. Wysocki wrote: > On Thu, Apr 1, 2021 at 3:59 PM Ard Biesheuvel wrote: > > > > On Thu, 1 Apr 2021 at 15:34, Rafael J. Wysocki wrote: > > > > > > On Thu, Apr 1, 2021 at 2:25 PM Chris von Recklinghausen > > > wrote: > > > > > > > > Suspend fails o

Re: [PATCH v6 4/4] fs: unicode: Add utf8 module and a unicode layer

2021-04-01 Thread Eric Biggers
On Thu, Apr 01, 2021 at 02:37:51AM +0530, Shreeya Patel wrote: > +# utf8data.h_shipped has a large database table which is an auto-generated > +# decodification trie for the unicode normalization functions and it is not > +# necessary to carry this large table in the kernel. > +# Enabling UNICODE_U

Re: [PATCH 1/1 v9] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-19 Thread Eric Biggers
he "Fixes" line shouldn't be line-wrapped. Otherwise this looks fine. The explanation in the commit message still isn't great, but it's much better than it was before. You can add: Reviewed-by: Eric Biggers - Eric

Re: [PATCH] crypto: fix CRYPTO_LIB_* dependencies on CRYPTO

2021-04-05 Thread Eric Biggers
On Mon, Apr 05, 2021 at 11:04:38AM -0400, Julian Braha wrote: > Currently, when a config option selects a > CRYPTO_LIB_* option while CRYPTO is disabled, > Kbuild gives an unmet dependency. However, > these config options do not actually need to > depend on CRYPTO. > > Signed-off-by: Julian Braha

Re: [PATCH 0/6] Enable Qualcomm Crypto Engine on sdm845

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 08:47:08AM -0500, Thara Gopinath wrote: > Qualcomm crypto engine supports hardware accelerated algorithms for > encryption and authentication. Enable support for aes,des,3des encryption > algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication > algorithms on sdm8

Re: [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 04:03:13AM +, Daniel Rosenberg wrote: > > Currently the casefolding dentry operation are always set if the > filesystem defines an encoding because the features is toggleable on > empty directories. Since we don't know what set of functions we'll > eventually need, and

Re: [PATCH v2 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 04:03:14AM +, Daniel Rosenberg wrote: > diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h > index a8f7a43f031b..df2c66ca370e 100644 > --- a/include/linux/fscrypt.h > +++ b/include/linux/fscrypt.h > @@ -741,8 +741,9 @@ static inline int fscrypt_prepare_rename

Re: [f2fs-dev] [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 10:16:49AM -0800, Eric Biggers wrote: > > Here's a suggestion which I think explains it a lot better. It's still > possible > I'm misunderstanding something, though, so please check it carefully: > > /** > * generic_set_encrypted_ci_

Re: [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-17 Thread Eric Biggers
ry. To avoid having to force a checkpoint when a new > file is fsync'ed, store the dirhash on-disk appended to i_name. > > This patch incorporates work by Eric Biggers > and Jaegeuk Kim . > > Co-developed-by: Eric Biggers > Signed-off-by: Eric Big

Re: [PATCH v2 0/3] Add support for Encryption and Casefolding in F2FS

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 04:03:12AM +, Daniel Rosenberg wrote: > I've included one ext4 patch from the previous set since it isn't in the f2fs > branch, but is needed for the fscrypt changes. Note that this is no longer the case, as this ext4 patch was merged in 5.10 (commit f8f4acb6cded: "ext4

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 02:07:01PM +, Satya Tangirala wrote: > Introduce blk_crypto_bio_sectors_alignment() that returns the required > alignment for the number of sectors in a bio. Any bio split must ensure > that the number of sectors in the resulting bios is aligned to that > returned value.

Re: [PATCH v7 2/8] blk-crypto: don't require user buffer alignment

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 02:07:02PM +, Satya Tangirala wrote: > Previously, blk-crypto-fallback required the offset and length of each bvec > in a bio to be aligned to the crypto data unit size. This patch enables > blk-crypto-fallback to work even if that's not the case - the requirement > now

Re: [PATCH v7 8/8] fscrypt: update documentation for direct I/O support

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 02:07:08PM +, Satya Tangirala wrote: > +Direct I/O support > +== > + > +Direct I/O on encrypted files is supported through blk-crypto. In > +particular, this means the kernel must have CONFIG_BLK_INLINE_ENCRYPTION > +enabled, the filesystem must have had

Re: [PATCH v7 0/8] add support for direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 02:07:00PM +, Satya Tangirala wrote: > This patch series was tested by running xfstests with test_dummy_encryption > with and without the 'inlinecrypt' mount option, and there were no > meaningful regressions. One regression was for generic/587 on ext4, > but that test i

Re: [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 10:22:28PM -0800, Daniel Rosenberg wrote: > > > @@ -273,10 +308,14 @@ struct f2fs_dir_entry > > > *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d, > > > continue; > > > } > > > > > > - if (de->hash_code == fname->hash

Re: [PATCH v3 1/3] libfs: Add generic function for setting dentry_ops

2020-11-18 Thread Eric Biggers
er, but it's nice to keep things consistent. Otherwise, please feel free to add: Reviewed-by: Eric Biggers - Eric

Re: [PATCH v3 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-18 Thread Eric Biggers
d be removed too. Otherwise this patch looks good; feel free to add: Acked-by: Eric Biggers - Eric

Re: [PATCH v3 3/3] f2fs: Handle casefolding with Encryption

2020-11-18 Thread Eric Biggers
ry. To avoid having to force a checkpoint when a new > file is fsync'ed, store the dirhash on-disk appended to i_name. > > This patch incorporates work by Eric Biggers > and Jaegeuk Kim . > > Co-developed-by: Eric Biggers > Signed-off-by: Eric Biggers > Signed-off

Re: [f2fs-dev] [PATCH v3] f2fs: fix race of pending_pages in decompression

2020-12-08 Thread Eric Biggers
On Wed, Dec 09, 2020 at 09:34:06AM +0800, Chao Yu wrote: > On 2020/12/9 7:55, Jaegeuk Kim wrote: > > On 12/07, Eric Biggers wrote: > > > On Tue, Dec 08, 2020 at 08:51:45AM +0900, Daeho Jeong wrote: > > > > > I am trying to review this but it is very hard, as the f2

Re: [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845

2020-11-19 Thread Eric Biggers
On Thu, Nov 19, 2020 at 10:52:27AM -0500, Thara Gopinath wrote: > Qualcomm crypto engine supports hardware accelerated algorithms for > encryption and authentication. Enable support for aes,des,3des encryption > algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication > algorithms on sdm8

Re: [PATCH] random: avoid arch_get_random_seed_long() when collecting IRQ randomness

2020-11-19 Thread Eric Biggers
_bytes(r, &seed, sizeof(seed)); > > - credit = 1; > > - } > > spin_unlock(&r->lock); > > > > fast_pool->count = 0; > > > > /* award one bit for the contents of the fast pool */ > > - credit_entropy_bits(r, credit + 1); > > + credit_entropy_bits(r, 1); > > } > > EXPORT_SYMBOL_GPL(add_interrupt_randomness); Looks reasonable to me. The CRNG state already gets XOR'ed with the output of arch_get_random_seed_long() each time the CRNG is reseeded. Calling arch_get_random_seed_long() here too isn't necessary, and it's not really appropriate to repeatedly call it during interrupt handling, as you point out. Reviewed-by: Eric Biggers - Eric

Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks

2020-11-30 Thread Eric Biggers
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 cac

Re: [f2fs-dev] [PATCH 1/2] f2fs: add compress_mode mount option

2020-11-23 Thread Eric Biggers
On Mon, Nov 23, 2020 at 12:17:50PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > We will add a new "compress_mode" mount option to control file > compression mode. This supports "fs-based" and "user-based". > In "fs-based" mode (default), f2fs does automatic compression on > the compression e

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-23 Thread Eric Biggers
On Mon, Nov 23, 2020 at 12:17:51PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > Added two ioctl to decompress/compress explicitly the compression > enabled file in "compress_mode=user-based" mount option. > > Using these two ioctls, the users can make a control of compression > and decompre

Re: [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-23 Thread Eric Biggers
On Sat, Nov 21, 2020 at 11:45:41PM -0500, Gabriel Krisman Bertazi wrote: > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > > index 6633b20224d5..0288bedf46e1 100644 > > --- a/fs/ext4/super.c > > +++ b/fs/ext4/super.c > > @@ -4968,11 +4968,6 @@ static int ext4_fill_super(struct super_block *sb,

Re: [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-23 Thread Eric Biggers
ops required under the circumstances. > > > > Since the fscrypt d_ops are set later on, we must set all d_ops there, > > since we cannot adjust those later on. This should not result in any > > change in behavior. > > > > Signed-off-by: Daniel Rosenbe

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-23 Thread Eric Biggers
On Tue, Nov 24, 2020 at 08:02:21AM +0900, Daeho Jeong wrote: > Jaegeuk, > > My mistake~ > > Eric, > > What I want is like do_page_cache_ra(), but I used > page_cache_ra_unbounded() directly, because we already checked that > read is within i_size. > > Or we could use do_page_cache_ra(), but it m

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 09:58:47AM +0900, Daeho Jeong wrote: > diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > index 87090da8693d..cdf72e153da0 100644 > --- a/fs/f2fs/compress.c > +++ b/fs/f2fs/compress.c > @@ -803,8 +803,6 @@ void f2fs_decompress_pages(struct bio *bio, struct page > *page,

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 12:43:23PM +0900, Daeho Jeong wrote: > STEP_VERITY is enabled by f2fs_need_verity() and the function is like below. > We already know the second condition (idx < DIV_ROUND_UP...) is > satisfied when invoking f2fs_alloc_dic(). > > static inline bool f2fs_need_verity(const st

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 01:48:24PM +0900, Daeho Jeong wrote: > Eric, > > I have another question. > I understand enabling the verity can be possible in the middle of I/O. > Is the opposite way also possible? Actually, I couldn't find any > disabling function of it, though. > No, disabling fs-ver

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 02:00:34PM +0900, Daeho Jeong wrote: > I think I don't understand how verity works. > Right after verity is enabled on a file, is the verity logic working > for the whole file data area? > Or it's just working for the data area which is updated after verity is > enabled? >

Re: [PATCH v14 06/10] fs/ntfs3: Add compression

2020-12-04 Thread Eric Biggers
On Fri, Dec 04, 2020 at 06:45:56PM +0300, Konstantin Komarov wrote: > This adds compression > > Signed-off-by: Konstantin Komarov > --- > fs/ntfs3/lib/common_defs.h | 196 +++ > fs/ntfs3/lib/decompress_common.c | 314 + > fs/ntfs3/lib/decompress_common.h | 558 +

Re: [PATCH v14 04/10] fs/ntfs3: Add file operations and implementation

2020-12-04 Thread Eric Biggers
On Fri, Dec 04, 2020 at 06:45:54PM +0300, Konstantin Komarov wrote: > +/* external compression lzx/xpress */ > +static int decompress_lzx_xpress(struct ntfs_sb_info *sbi, const char *cmpr, > + size_t cmpr_size, void *unc, size_t unc_size, > +

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-25 Thread Eric Biggers
On Wed, Nov 18, 2020 at 12:38:15AM +, Satya Tangirala wrote: > > > +/** > > > + * update_aligned_sectors_and_segs() - Ensures that *@aligned_sectors is > > > aligned > > > + * to @bio_sectors_alignment, and > > > that > > > + *

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-25 Thread Eric Biggers
On Tue, Nov 17, 2020 at 02:07:01PM +, Satya Tangirala wrote: > @@ -275,11 +331,24 @@ static struct bio *blk_bio_segment_split(struct > request_queue *q, > bvprvp = &bvprv; > } > > + /* > + * The input bio's number of sectors is assumed to be aligned to > + *

Re: [RFC PATCH 4/8] x86/power: Restore Key Locker internal key from the ACPI S3/4 sleep states

2020-12-17 Thread Eric Biggers
On Wed, Dec 16, 2020 at 09:41:42AM -0800, Chang S. Bae wrote: > When the system state switches to these sleep states, the internal key gets > reset. Since this system transition is transparent to userspace, the > internal key needs to be restored properly. > > Key Locker provides a mechanism to ba

Re: [RFC PATCH 0/8] x86: Support Intel Key Locker

2020-12-17 Thread Eric Biggers
On Wed, Dec 16, 2020 at 09:41:38AM -0800, Chang S. Bae wrote: > [1] Intel Architecture Instruction Set Extensions Programming Reference: > > https://software.intel.com/content/dam/develop/external/us/en/documents/architecture-instruction-set-$ > [2] Intel Key Locker Specification: > > htt

<    1   2   3   4   5   6   7   8   9   10   >