Re: [f2fs-dev] [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 09:55:43PM -0700, Kees Cook wrote: > If any of the subsystems ask you to break this up (I hope not), I've got > this[1], which does a reasonable job of splitting a commit up into > separate commits for each matching subsystem. [1] https://github.com/kees/kernel-tools/blob/t

Re: [f2fs-dev] [PATCH v1 2/5] treewide: use get_random_{u8, u16}() when possible

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:41PM +0200, Jason A. Donenfeld wrote: > Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, > simply use the get_random_{u8,u16}() functions, which are faster than > wasting the additional bytes from a 32-bit value. > > Signed-off-by: Jason A. Don

Re: [f2fs-dev] [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:39PM +0200, Jason A. Donenfeld wrote: > Hi folks, > > This is a five part treewide cleanup of random integer handling. The > rules for random integers are: > > - If you want a secure or an insecure random u64, use get_random_u64(). > - If you want a secure or an inse

Re: [f2fs-dev] [PATCH v1 4/5] treewide: use get_random_bytes when possible

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:43PM +0200, Jason A. Donenfeld wrote: > The prandom_bytes() function has been a deprecated inline wrapper around > get_random_bytes() for several releases now, and compiles down to the > exact same code. Replace the deprecated wrapper with a direct call to > the real f

Re: [f2fs-dev] [PATCH v1 4/5] treewide: use get_random_bytes when possible

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:43PM +0200, Jason A. Donenfeld wrote: > The prandom_bytes() function has been a deprecated inline wrapper around > get_random_bytes() for several releases now, and compiles down to the > exact same code. Replace the deprecated wrapper with a direct call to > the real f

Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > Rather than incurring a division or requesting too many random bytes for > the given range, use the prandom_u32_max() function, which only takes > the minimum required bytes from the RNG and avoids divisions. Yes please! Since

Re: [f2fs-dev] [PATCH v1 5/5] prandom: remove unused functions

2022-10-05 Thread Kees Cook
On Wed, Oct 05, 2022 at 11:48:44PM +0200, Jason A. Donenfeld wrote: > With no callers left of prandom_u32() and prandom_bytes(), remove these > deprecated wrappers. > > Signed-off-by: Jason A. Donenfeld Reviewed-by: Kees Cook -- Kees Cook ___ Linu

Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-05 Thread KP Singh
On Wed, Oct 5, 2022 at 9:16 PM Kees Cook wrote: > > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > Rather than incurring a division or requesting too many random bytes for > > the given range, use the prandom_u32_max() function, which only takes > > the minimum required by

Re: [f2fs-dev] [PATCH v3] f2fs: support errors=remount-ro|continue|panic mountoption

2022-10-05 Thread Jaegeuk Kim
On 10/05, Chao Yu wrote: > On 2022/10/5 4:28, Jaegeuk Kim wrote: > > On 10/04, Chao Yu wrote: > > > This patch supports errors=remount-ro|continue|panic mount option. > > > > > > Signed-off-by: Chao Yu > > > --- > > > - clean up codes > > > - stop gc/discard threads after remount fs as readonly >

[f2fs-dev] [PATCH v1 5/5] prandom: remove unused functions

2022-10-05 Thread Jason A. Donenfeld via Linux-f2fs-devel
With no callers left of prandom_u32() and prandom_bytes(), remove these deprecated wrappers. Signed-off-by: Jason A. Donenfeld --- include/linux/prandom.h | 12 1 file changed, 12 deletions(-) diff --git a/include/linux/prandom.h b/include/linux/prandom.h index 78db003bc290..e0a075

[f2fs-dev] [PATCH v1 4/5] treewide: use get_random_bytes when possible

2022-10-05 Thread Jason A. Donenfeld via Linux-f2fs-devel
The prandom_bytes() function has been a deprecated inline wrapper around get_random_bytes() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. Signed-off-by: Jason A. Donenfeld --- arch/powerpc/crypto/crc-vp

[f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-05 Thread Jason A. Donenfeld via Linux-f2fs-devel
The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. Signed-off-by: Jason A. Donenfeld --- Documentation/networking/filte

[f2fs-dev] [PATCH v1 2/5] treewide: use get_random_{u8, u16}() when possible

2022-10-05 Thread Jason A. Donenfeld via Linux-f2fs-devel
Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, simply use the get_random_{u8,u16}() functions, which are faster than wasting the additional bytes from a 32-bit value. Signed-off-by: Jason A. Donenfeld --- crypto/testmgr.c | 8 +++

[f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-05 Thread Jason A. Donenfeld via Linux-f2fs-devel
Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. Signed-off-by: Jason A. Donenfeld --- arch/x86/mm/pat/cpa-test.c| 4 +-