Re: [f2fs-dev] [PATCH 03/10] fs: consistently use file_has_valid_mmap_hooks() helper

2025-06-16 Thread Kees Cook via Linux-f2fs-devel
Lorenzo Stoakes >--- > fs/backing-file.c | 2 +- > fs/binfmt_elf.c | 4 ++-- > fs/binfmt_elf_fdpic.c | 2 +- Thanks for the refactoring! Acked-by: Kees Cook -- Kees Cook ___ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[PATCH 52/82] f2fs: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
nel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 [1] Link: https://github.com/KSPP/linux/issues/26 [2] Link: https://github.com/KSPP/linux/issues/27 [3] Link: https://github.com/KSPP/linux/issues/344 [4] Cc: Jaegeuk Kim Cc: Chao Yu Cc: [email protected] Signed-off-by: Kees Cook --- fs/f2fs/file.c |

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/ker

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

2022-10-05 Thread Kees Cook
; > } > > - r = prandom_u32() & SFB_MAX_PROB; > + r = get_random_u16() & SFB_MAX_PROB; > > if (unlikely(r < p_min)) { > if (unlikely(p_min > SFB_MAX_PROB / 2)) { include/uapi/linux/pkt_sched.h:#define SFB_MAX_PROB 0x Reviewed-by: Kees Cook -- Kees Cook ___ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

2022-10-05 Thread Kees Cook
, let me > know if I'm doing it wrong. I usually stick to just mailing lists and subsystem maintainers. 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

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

2022-10-05 Thread Kees Cook
gt; the real function. > > Signed-off-by: Jason A. Donenfeld Global search/replace matches. :) Reviewed-by: Kees Cook -- Kees Cook ___ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/l

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

2022-10-05 Thread Kees Cook
gt; the real function. Global search/replace matches. :) Reviewed-by: Kees Cook -- Kees Cook ___ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

2022-10-05 Thread Kees Cook
gt; - j = rnd % i; > + j = prandom_u32_max(i); > > /* Swap indexes. */ > swap(arr[i], arr[j]); And some by hand. :) Reviewed-by: Kees Cook -- Kees Cook ___ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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 -

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-02 Thread Kees Cook
On Wed, Mar 02, 2022 at 12:18:45PM -0800, Linus Torvalds wrote: > On Wed, Mar 2, 2022 at 12:07 PM Kees Cook wrote: > > > > I've long wanted to change kfree() to explicitly set pointers to NULL on > > free. https://github.com/KSPP/linux/issues/87 > > We've ha

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-02 Thread Kees Cook
le with Coccinelle) and change them into something like kfree_no_null() and redefine kfree() itself: #define kfree_no_null(x) do { void *__ptr = (x); __kfree(__ptr); } while (0) #define kfree(x) do { __kfree(x); x = NULL; } while (0) -- Kees Cook ___

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-01 Thread Kees Cook
h treewide.patch $ split-on-maintainer treewide.patch $ ls 0*.patch If you have a build log before the patch that spits out warnings, the --build-log argument can extract those warnings on a per-file basis, too (though this can be fragile). -- Kees Cook _

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-01 Thread Kees Cook
onally shadows variables. :) Another way to try to catch misused shadow variables is -Wunused-but-set-varible, but it, too, has tons of false positives. I tried to capture some of the rationale and research here: https://github.com/KSPP/linux/issues/152 -- Kees Cook __

Re: [f2fs-dev] [PATCH] f2fs: Eliminate usage of uninitialized_var() macro

2020-06-15 Thread Kees Cook
it is not needed at all. > > [1] https://github.com/KSPP/linux/issues/81 > [2] > https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yvju65tplgn_ybynv0ve...@mail.gmail.com/ > > Cc: Kees Cook > Suggested-by: Chao Yu > Signed-off-by: Jason Yan > --- > v2: Dir