Re: [PATCH 02/16] elf, uapi: Add definition for STN_UNDEF

2025-02-04 Thread Kees Cook
gt; Link: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.symtab.html > Signed-off-by: Thomas Weißschuh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 04/16] elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK

2025-02-04 Thread Kees Cook
docs.oracle.com/cd/E19683-01/816-1386/chapter6-80869/index.html > Signed-off-by: Thomas Weißschuh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 06/16] elf, uapi: Add types ElfXX_Verdef and ElfXX_Veraux

2025-02-04 Thread Kees Cook
Link: > https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html#VERDEFEXTS > Signed-off-by: Thomas Weißschuh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 05/16] elf, uapi: Add type ElfXX_Versym

2025-02-04 Thread Kees Cook
; > Signed-off-by: Thomas Weißschuh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 03/16] elf, uapi: Add definition for DT_GNU_HASH

2025-02-04 Thread Kees Cook
Link: > https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/libc-ddefs.html > Signed-off-by: Thomas Weißschuh Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 04/16] elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK

2025-02-04 Thread Kees Cook
On Tue, Feb 04, 2025 at 04:17:03PM +0100, Thomas Weißschuh wrote: > On Tue, Feb 04, 2025 at 07:10:00AM -0800, Kees Cook wrote: > > On Mon, Feb 03, 2025 at 10:05:05AM +0100, Thomas Weißschuh wrote: > > > The definitions are used by tools/testing/selftests/vDSO/parse_vdso.c. &

Re: [PATCH 04/16] elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK

2025-02-04 Thread Kees Cook
ed libc header somewhere? -Kees -- Kees Cook

Re: [RFC PATCH v1 1/2] mm/memfd: Add support for F_SEAL_FUTURE_EXEC to memfd

2025-01-14 Thread Kees Cook
ritten function pointer, not that they already have arbitrary execution control. (i.e. taking a "jump anywhere" primitive and upgrading it to "execute anything".) Is the expectation that existing ROP/JOP techniques make protecting memfd irrelevant? -- Kees Cook

Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-09 Thread Kees Cook
main declaration with argc/argv present. But it's mostly aesthetic. And if you think use of kselftest.h isn't universal, then perhaps we can avoid the macro, but it does seem nicer and more "normal" feeling for the rest of kernel development. -Kees -- Kees Cook

Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-09 Thread Kees Cook
-git a/tools/testing/selftests/mm/hugetlb-madvise.c > b/tools/testing/selftests/mm/hugetlb-madvise.c > index e74107185324f..43f16c12c8e9a 100644 > --- a/tools/testing/selftests/mm/hugetlb-madvise.c > +++ b/tools/testing/selftests/mm/hugetlb-madvise.c > @@ -58,7 +58,7 @@ void read_fault_pages(void *addr, unsigned long nr_pages) > } > } > > -int main(int argc, char **argv) > +int main(int __attribute__((unused)) argc, char **argv) Can we add a macro in kselftest.h for "__unused" like the kernel already does? Then instead of removing args, we can just mark them, like you're doing here. -- Kees Cook

Re: [RFC PATCH v1 1/2] mm/memfd: Add support for F_SEAL_FUTURE_EXEC to memfd

2025-01-08 Thread Kees Cook
On Wed, Jan 08, 2025 at 07:06:13PM +, Lorenzo Stoakes wrote: > On Mon, Jan 06, 2025 at 04:44:33PM -0800, Kees Cook wrote: > > On Mon, Jan 06, 2025 at 10:26:27AM -0800, Jeff Xu wrote: > > > + Kees because this is related to W^X memfd and security. > > > > > >

Re: [PATCH] selftests: harness: fix printing of mismatch values in __EXPECT()

2025-01-08 Thread Kees Cook
:Expected exp_args[2] (3134324433) > == info.entry.args[1] (18446744072548908753) > > Fixes: b5bb6d3068ea ("selftests/seccomp: fix 32-bit build warnings") > Signed-off-by: Dmitry V. Levin Ah nice, thanks! Reviewed-by: Kees Cook -- Kees Cook

Re: [RFC PATCH v1 1/2] mm/memfd: Add support for F_SEAL_FUTURE_EXEC to memfd

2025-01-06 Thread Kees Cook
On Mon, Jan 06, 2025 at 10:26:27AM -0800, Jeff Xu wrote: > + Kees because this is related to W^X memfd and security. > > On Fri, Jan 3, 2025 at 7:14 AM Jann Horn wrote: > > > > On Fri, Dec 6, 2024 at 7:19 PM Lorenzo Stoakes > > wrote: > > > On Thu, Dec 0

Re: [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed

2025-01-06 Thread Kees Cook
mode for that?) Also, why is it too late to cancel? Can we set the module to the "Unloading" state to stop any dependent modules from loading on top of it, and then request it unload? -- Kees Cook

Re: [PATCH v2 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump

2024-12-30 Thread Kees Cook
it doesn't hurt to keep. > > Fixes: 92307383082d ("coredump: Don't perform any cleanups before dumping > core") > Cc: sta...@vger.kernel.org > Cc: Eric W. Biederman > Acked-by: Oleg Nesterov > Signed-off-by: Nam Cao Thanks for fixing this! Acked-by: Kees Cook -- Kees Cook

Re: [PATCH v2 2/2] selftests: coredump: Add stackdump test

2024-12-30 Thread Kees Cook
e added by this commit. This is great! One tiny nit below... > +#define STACKDUMP_FILE "/tmp/kselftest_stackdump" Please move this to the local directory (and have the Makefile and/or test itself clean it up). (Or use mkstemp()) I don't want to have "well known" filena

Re: [RFC PATCH] get_maintainer: decouple subsystem status from maintainer role

2024-12-17 Thread Kees Cook
rt of > the subsystem name. So for example, instead of "(supporter:SUBSYSTEM)" > report "(maintainer:SUBSYSTEM [supported])". > > [1] > https://lore.kernel.org/all/20221006162413.858527-1-bryan.odonog...@linaro.org/ > > Cc: "Theodore Ts'o&quo

Re: [PATCH 1/2] exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case

2024-11-02 Thread Kees Cook
On Sat, Nov 02, 2024 at 11:29:55AM +, Zbigniew Jędrzejewski-Szmek wrote: > On Thu, Oct 31, 2024 at 03:10:37PM -0700, Kees Cook wrote: > > On Wed, 30 Oct 2024 14:37:31 -0600, Tycho Andersen wrote: > > > Zbigniew mentioned at Linux Plumber's that systemd is intereste

Re: [PATCH 1/2] exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case

2024-10-31 Thread Kees Cook
at(AT_EMPTY_PATH) case https://git.kernel.org/kees/c/7bdc6fc85c9a [2/2] selftests/exec: add a test for execveat()'s comm https://git.kernel.org/kees/c/bd104872311a Take care, -- Kees Cook

Re: [PATCH v2 1/2] exec: add a flag for "reasonable" execveat() comm

2024-09-28 Thread Kees Cook
s regardless of bprm->fdpath. > > It will be a change of behavior on when executing symlinks and possibly > mount points but I don't think we care. If we do then we can add make > it conditional with "if (bprm->fdpath)" > > At the very least using the above version unconditionally ought to flush > out any bugs. I'm not super comfortable doing this regardless of bprm->fdpath; that seems like too many cases getting changed. Can we just leave it as depending on bprm->fdpath? Also, is d_name.name always going to be set? e.g. what about memfd, etc? -- Kees Cook

Re: [PATCH] kunit: Fix missing kerneldoc comment

2024-09-05 Thread Kees Cook
not described in 'kunit_kfree_const' > > Reported-by: Stephen Rothwell > Closes: https://lore.kernel.org/lkml/20240827160631.67e12...@canb.auug.org.au/ > Fixes: f2c6dbd22017 ("kunit: Device wrappers should also manage driver name") > Signed-off-by: David Gow Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH v3 0/2] Fix kallsyms with CONFIG_LTO_CLANG

2024-08-15 Thread Kees Cook
suffix before sorting symbols https://git.kernel.org/kees/c/020925ce9299 [2/2] kallsyms: Match symbols exactly with CONFIG_LTO_CLANG https://git.kernel.org/kees/c/fb6a421fb615 Take care, -- Kees Cook

Re: [PATCH v3 0/2] Fix kallsyms with CONFIG_LTO_CLANG

2024-08-15 Thread Kees Cook
ching is probably not used by a lot of users, so I guess we > are OK without Fixes tags? I personally don't have a strong preference > either way. > > It is not necessary to invert the order of the two patches. Only applying > one of the two patches won't cause more issues than what we have today. Which tree should carry this series? -- Kees Cook

Re: [PATCHv2 bpf-next 1/9] uprobe: Add support for session consumer

2024-07-05 Thread Kees Cook
On Fri, Jul 05, 2024 at 09:10:36AM +0200, Peter Zijlstra wrote: > On Wed, Jul 03, 2024 at 01:36:19PM -0700, Kees Cook wrote: > > > Yes, please use struct_size_t(). This is exactly what it was designed for. > > Kees, please, just let up, not going to happen. I'm getting re

Re: [PATCHv2 bpf-next 1/9] uprobe: Add support for session consumer

2024-07-03 Thread Kees Cook
() is not. > > This hack with __maybe_unused is more readable than the standard > struct_size() helper that was added specifically for cases like this, > really? > > I wonder if Kees agrees and whether there are any downsides to using > struct_size() > > struct_siz

Re: [PATCH v2] KUnit: add missing MODULE_DESCRIPTION() macros for lib/test_*.ko

2024-06-19 Thread Kees Cook
odpost: missing MODULE_DESCRIPTION() in lib/test_bits.o > > Add the missing invocations of the MODULE_DESCRIPTION() macro. > > Signed-off-by: Jeff Johnson Thanks for chasing these down! Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH v2] tracing: Add sched_prepare_exec tracepoint

2024-04-11 Thread Kees Cook
thanks! [1/1] tracing: Add sched_prepare_exec tracepoint https://git.kernel.org/kees/c/5c5fad46e48c Take care, -- Kees Cook

Re: [PATCH v2] tracing: Add sched_prepare_exec tracepoint

2024-04-11 Thread Kees Cook
rp=/usr/bin/dmesg filename=/usr/bin/dmesg pid=389 comm=bash > > Signed-off-by: Marco Elver This looks good to me. If tracing wants to take it: Acked-by: Kees Cook If not, I can take it in my tree if I get a tracing Ack. :) -Kees -- Kees Cook

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-09 Thread Kees Cook
On Tue, Apr 09, 2024 at 08:25:45PM +0200, Marco Elver wrote: > On Tue, Apr 09, 2024 at 08:46AM -0700, Kees Cook wrote: > [...] > > > + trace_new_exec(current, bprm); > > > + > > > > All other steps in this function have explicit comments about > > wha

Re: [PATCH] tracing: Add new_exec tracepoint

2024-04-09 Thread Kees Cook
e] */ > +TRACE_EVENT(new_exec, > + > + TP_PROTO(struct task_struct *task, struct linux_binprm *bprm), > + > + TP_ARGS(task, bprm), > + > + TP_STRUCT__entry( > + __string( filename, bprm->filename ) > + __field(pid_t, pid ) &

Re: [PATCH 0/8] tracing: Persistent traces across a reboot or crash

2024-03-09 Thread Kees Cook
On Sat, Mar 09, 2024 at 01:51:16PM -0500, Steven Rostedt wrote: > On Sat, 9 Mar 2024 10:27:47 -0800 > Kees Cook wrote: > > > On Tue, Mar 05, 2024 at 08:59:10PM -0500, Steven Rostedt wrote: > > > This is a way to map a ring buffer instance across reboots. > > &

Re: [PATCH 0/8] tracing: Persistent traces across a reboot or crash

2024-03-09 Thread Kees Cook
quot; in fs/pstore/ram.c to see how to plumb a new frontend into the RAM backend. I continue to want to lift the frontend configuration options up into the pstore core, since it would avoid a bunch of redundancy, but this is where we are currently. :) -Kees [1] CONFIG_PSTORE et. al. in fs/pstore

Re: [kees:devel/overflow/sanitizers] [overflow] 660787b56e: UBSAN:signed-integer-overflow_in_lib/test_memcat_p.c

2024-01-30 Thread Kees Cook
t; signed and unsigned overflow sanitizers") > https://git.kernel.org/cgit/linux/kernel/git/kees/linux.git > devel/overflow/sanitizers > > in testcase: boot > > compiler: gcc-11 > test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G > > (please

Re: [PATCH] eventfs: Save directory inodes in the eventfs_inode structure

2024-01-22 Thread Kees Cook
es > all be the same") > Signed-off-by: Steven Rostedt (Google) Since I reviewed the earlier patch, I will repeat here for the formal one too. :) Thanks for avoiding the hashing! Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2023-12-21 Thread Kees Cook
On December 21, 2023 4:16:56 AM PST, Michael Ellerman wrote: >Cc +Kees > >Christophe Leroy writes: >> Declaring rodata_enabled and mark_rodata_ro() at all time >> helps removing related #ifdefery in C files. >> >> Signed-off-by: Christophe Leroy >

Re: [PATCH v3 0/5] params: harden string ops and allocatio ops

2023-12-01 Thread Kees Cook
On Mon, 20 Nov 2023 17:11:41 +0200, Andy Shevchenko wrote: > A couple of patches are for get the string ops, used in the module, > slightly harden. On top a few cleanups. > > Since the main part is rather hardening, I think the Kees' tree is > the best fit for the series.

Re: [PATCH] eventfs: Use ERR_CAST() in eventfs_create_events_dir()

2023-10-18 Thread Kees Cook
exact situation (casting an error pointer to another type). > > Closes: https://github.com/ClangBuiltLinux/linux/issues/1947 > Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use > eventfs_inode") > Signed-off-by: Nathan Chancellor Yes, please. That's the correct method to do such casts. Thanks! Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] KVM: deprecate KVM_WERROR in favor of general WERROR

2023-10-09 Thread Kees Cook
how to deal with the global > W=1 already, tracking all per-subsystem WERRORs is too much... > > Link: > https://lore.kernel.org/all/0da9874b6e9fcbaaa5edeb345d7e2a7c859fc818.1696271334.git.thomas.lenda...@amd.com/ > Signed-off-by: Jakub Kicinski Yeah, best to have just the global

Re: [PATCH v2 0/5] params: harden string ops and allocatio ops

2023-10-02 Thread Kees Cook
On Mon, Oct 02, 2023 at 03:48:51PM +0300, Andy Shevchenko wrote: > A couple of patches are for get the string ops, used in the module, > slightly harden. On top a few cleanups. > > Since the main part is rather hardening, I think the Kees' tree is > the best fit for the seri

Re: [PATCH v2 2/5] params: Do not go over the limit when getting the string length

2023-10-02 Thread Kees Cook
e way or another about using strnlen() here, since we know the string will be terminated. -Kees > > Signed-off-by: Andy Shevchenko > --- > kernel/params.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/kernel/params.c b/kernel/params

Re: [PATCH 3/3] get_maintainer: add patch-only pattern matching type

2023-09-27 Thread Kees Cook
@@ -19302,8 +19302,8 @@ F: include/uapi/linux/seccomp.h F: kernel/seccomp.c F: tools/testing/selftests/kselftest_harness.h F: tools/testing/selftests/seccomp/* -K: \bsecure_computing -K: \bTIF_SECCOMP\b +D: \bsecure_computing +D: \bTIF_SECCOMP\b SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) Broadcom BRCMSTB DRIVER M: Kamal Dasu -- Kees Cook

Re: [PATCH 1/3] MAINTAINERS: add documentation for D:

2023-09-27 Thread Kees Cook
re are used when rendering: https://docs.kernel.org/process/maintainers.html In this case, I assume "D" is inspired by "Diff", so perhaps reword this to get a proper emphasis hint, and add additional context: D: *Diff content regex* (perl extended) pattern match that applies only to patches and not entire files (e.g. when using the get_maintainers.pl script). -- Kees Cook

Re: [PATCH 0/3] get_maintainer: add patch-only keyword matching

2023-09-27 Thread Kees Cook
t; The goal of this is to reduce noise when folks use get_maintainer on > > tree files as opposed to patches. This use case should be steered away > > from [1] but "D:" should help maintainers reduce noise in their inboxes > > regardless, especially when matching omnipresent ke

Re: [PATCH] MAINTAINERS: add include/linux/module*.h to modules

2023-09-24 Thread Kees Cook
On Wed, Sep 20, 2023 at 02:10:09PM -0700, Luis Chamberlain wrote: > Use glob include/linux/module*.h to capture all module changes. > > Suggested-by: Kees Cook > Signed-off-by: Luis Chamberlain Thanks! Reviewed-by: Kees Cook -- Kees Cook

[PATCH] x86/mm/dump_pagetables: Add SLAB_VIRTUAL knowledge

2023-09-15 Thread Kees Cook
Add the markings for the SLAB_VIRTUAL area. Cc: Matteo Rizzo Cc: Jann Horn Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Kees Cook --- This is on

Re: [PATCH] HID: uhid: refactor deprecated strncpy

2023-09-15 Thread Kees Cook
On Fri, Sep 15, 2023 at 09:36:23AM +0200, David Rheinsberg wrote: > Hi > > On Fri, Sep 15, 2023, at 7:13 AM, Kees Cook wrote: > >> - /* @hid is zero-initialized, strncpy() is correct, strlcpy() not */ > >> - len = min(sizeof(hid->name), sizeof(ev->u.create2.name

[PATCH] ceph: Annotate struct ceph_osd_request with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct ceph_osd_request. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Ilya Dryomov Cc: Xiubo Li Cc: Jeff Layton Cc: ceph-de...@vger.kernel.org Signed-off-by: Kees Cook --- include/linux

[PATCH] afs: Annotate struct afs_permits with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct afs_permits. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Howells Cc: Marc Dionne Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook --- fs/afs/internal.h | 2 +- 1

[PATCH] ceph: Annotate struct ceph_monmap with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct ceph_monmap. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples

[PATCH] ocfs2: Annotate struct ocfs2_slot_info with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct ocfs2_slot_info. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: ocfs2-de...@lists.linux.dev Signed-off-by: Kees Cook --- fs/ocfs2

[PATCH] afs: Annotate struct afs_addr_list with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct afs_addr_list. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Howells Cc: Marc Dionne Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook --- fs/afs/internal.h | 2

[PATCH] NFS/flexfiles: Annotate struct nfs4_ff_layout_segment with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct nfs4_ff_layout_segment. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-...@vger.kernel.org Signed-off-by: Kees Cook --- fs/nfs

[PATCH] nfs41: Annotate struct nfs4_file_layout_dsaddr with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct nfs4_file_layout_dsaddr. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Trond Myklebust Cc: Anna Schumaker Cc: "Gustavo A. R. Silva" Cc: linux-...@vger.kernel.org Sig

[PATCH] aio: Annotate struct kioctx_table with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct kioctx_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Benjamin LaHaise Cc: Alexander Viro Cc: Christian Brauner Cc: linux-...@kvack.org Cc: linux-fsde...@vger.kernel.org

[PATCH] mtd: rawnand: ingenic: Annotate struct ingenic_nfc with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct ingenic_nfc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Paul Cercueil Cc: Harvey Hunt Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-m

[PATCH] udf: Annotate struct udf_bitmap with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct udf_bitmap. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jan Kara Signed-off-by: Kees Cook --- fs/udf/udf_sb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] mtd: rawnand: sunxi: Annotate struct sunxi_nand_chip with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct sunxi_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland

[PATCH] mtd: rawnand: marvell: Annotate struct marvell_nand_chip with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct marvell_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-...@lists.infradead.org Signed-off-by: Kees

[PATCH] mtd: cfi: Annotate struct cfi_private with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct cfi_private. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook

[PATCH] mtd: rawnand: meson: Annotate struct meson_nfc_nand_chip with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct meson_nfc_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Liang Yang Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Neil Armstrong Cc: Kevin Hilman

[PATCH] mtd: rawnand: renesas: Annotate struct rnand_chip with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct rnand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-...@lists.infradead.org Cc: linux-renesas

[PATCH] mtd: rawnand: atmel: Annotate struct atmel_nand with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct atmel_nand. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Tudor Ambarus Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Nicolas Ferre Cc: Alexandre Belloni

[PATCH] mtd: rawnand: denali: Annotate struct denali_chip with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct denali_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook

[PATCH] mtd: Annotate struct lpddr_private with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct lpddr_private. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-...@lists.infradead.org Signed-off-by: Kees Cook

[PATCH] leds: qcom-lpg: Annotate struct lpg_led with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct lpg_led. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: Bjorn Andersson Cc: "Uwe Kleine-König" Cc: Douglas Anderson Cc: Anjelique Melendez

[PATCH] leds: mt6370: Annotate struct mt6370_priv with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct mt6370_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: Alice Chen Cc: Jacek Anaszewski Cc

[PATCH] leds: lm3697: Annotate struct lm3697 with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct lm3697. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: linux-l...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/leds/leds-lm3697.c | 2 +- 1

[PATCH] leds: mt6360: Annotate struct mt6360_priv with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct mt6360_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: Gene Chen Cc: Jacek Anaszewski Cc

[PATCH] leds: gpio: Annotate struct gpio_leds_priv with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct gpio_leds_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: linux-l...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/leds/leds-gpio.c | 2

[PATCH] leds: el15203000: Annotate struct el15203000 with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct el15203000. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: linux-l...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/leds/leds-el15203000.c | 2

[PATCH] leds: cr0014114: Annotate struct cr0014114 with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct cr0014114. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: linux-l...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/leds/leds-cr0014114.c | 2

[PATCH] leds: aw200xx: Annotate struct aw200xx with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct aw200xx. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pavel Machek Cc: Lee Jones Cc: linux-l...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/leds/leds-aw200xx.c | 2 +- 1

Re: [PATCH 00/21] dmaengine: Annotate with __counted_by

2023-09-15 Thread Kees Cook
Hi, Just a ping on the series... how do these look to you, Vinod? If you want I can carry them in my tree. Please let me know. Thanks! -Kees On Thu, Aug 17, 2023 at 04:58:37PM -0700, Kees Cook wrote: > Hi, > > This annotates several structures with the coming __counted_by attrib

[PATCH] wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct brcmf_gscan_config. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: "Gustavo A. R. Silva" Cc: Hector

[PATCH] wifi: ipw2x00: Annotate struct libipw_txb with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct libipw_txb. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Stanislav Yakovlev Cc: Kalle Valo Cc: linux-wirel...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/net/wireless

[PATCH] wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct brcmf_fw_request. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: Matthias Brugger Cc: Hector Martin Cc

[PATCH] wifi: mt76: Annotate struct mt76_rx_tid with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct mt76_rx_tid. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Felix Fietkau Cc: Lorenzo Bianconi Cc: Ryder Lee Cc: Shayne Chen Cc: Sean Wang Cc: Kalle Valo Cc: Matthias Brugger Cc

[PATCH] wifi: wcn36xx: Annotate struct wcn36xx_hal_ind_msg with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct wcn36xx_hal_ind_msg. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Loic Poulain Cc: Kalle Valo Cc: wcn3...@lists.infradead.org Cc: linux-wirel...@vger.kernel.org Signed-off-by: Kees

[PATCH] md/md-linear: Annotate struct linear_conf with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct linear_conf. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples

[PATCH] usb: gadget: f_midi: Annotate struct f_midi with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct f_midi. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples

[PATCH] usb: gadget: f_fs: Annotate struct ffs_buffer with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct ffs_buffer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Greg Kroah-Hartman Cc: John Keeping Cc: Udipto Goswami Cc: Linyu Yuan Cc: linux-...@vger.kernel.org Signed-off-by: Kees

[PATCH] usb: Annotate struct urb_priv with __counted_by

2023-09-15 Thread Kees Cook
functions). As found with Coccinelle[1], add __counted_by for struct urb_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: Mathias Nyman Cc: linux-...@vger.kernel.org Signed-off-by: Kees Cook --- drivers/usb

Re: [PATCH][next] net: spider_net: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
th `size_add()`. > > Fixes: 3f1071ec39f7 ("net: spider_net: Use struct_size() helper") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH][next] tipc: Use size_add() in calls to struct_size()

2023-09-15 Thread Kees Cook
th `size_add()`. > > Fixes: e034c6d23bc4 ("tipc: Use struct_size() helper") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH][next] usb: atm: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
th `size_add()`. > > Fixes: b626871a7cda ("usb: atm: Use struct_size() helper") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH][next] tls: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
th `size_add()`. > > Fixes: b89fec54fd61 ("tls: rx: wrap decrypt params in a struct") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH][next] mlxsw: Use size_mul() in call to struct_size()

2023-09-15 Thread Kees Cook
`size_mul()`. > > Fixes: 2285ec872d9d ("mlxsw: spectrum_acl_bloom_filter: use struct_size() in > kzalloc()") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH][next] ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
th `size_add()`. > > Fixes: f9efae954905 ("ASoC: SOF: ipc4-topology: Add support for base config > extension") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH v3 1/2] uapi: fix __DECLARE_FLEX_ARRAY for C++

2023-09-15 Thread Kees Cook
) is 1 not 0, > changing UAPI structures layouts. Looking at this again just now, what about using a 0-length array instead of an anonymous struct? https://godbolt.org/z/rGaxPWjef Then we don't need an #ifdef at all... struct { int __empty_member[0];

Re: [PATCH][next] gve: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
gt; > Fixes: 691f4077d560 ("gve: Replace zero-length array with flexible-array > member") > Signed-off-by: Gustavo A. R. Silva Thanks, yes, this will maintain SIZE_MAX saturation if it happens. Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] firmware: ti_sci: refactor deprecated strncpy

2023-09-15 Thread Kees Cook
On Fri, Sep 15, 2023 at 07:40:38AM -0500, Nishanth Menon wrote: > On 21:03-20230914, Kees Cook wrote: > > On Wed, Sep 13, 2023 at 08:23:02PM +, Justin Stitt wrote: > > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > > &

Re: [PATCH v4] kobject: Replace strlcpy with strscpy

2023-09-14 Thread Kees Cook
ffort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > > [...] Applied to for-next/hardening, thanks! [1/1] kobject: Replace strlcpy with strscpy https://git.kernel.org/kees/c/68a39dfd6f94 Take care, -- Kees Cook

Re: [PATCH] init/version.c: Replace strlcpy with strscpy

2023-09-14 Thread Kees Cook
ffort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > > [...] Applied to for-next/hardening, thanks! [1/1] init/version.c: Replace strlcpy with strscpy https://git.kernel.org/kees/c/ec23bc09c1c0 Take care, -- Kees Cook

Re: [PATCH] HID: uhid: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
g/linux-manual-4.8/strscpy.9.en.html > [2] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-harden...@vger.kernel.org > Cc: Kees Cook > Signed-off-by: Justin Stitt > --- > drivers/hid/uhid.c | 12 > 1 file changed, 4 insertions(+), 8 deletions(-)

Re: [PATCH] HID: prodikeys: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
>name, card->shortname, sizeof(rwmidi->name)); > + strscpy(rwmidi->name, card->shortname, sizeof(rwmidi->name)); > rwmidi->info_flags = SNDRV_RAWMIDI_INFO_INPUT; > rwmidi->private_data = pm; Same here. Reviewed-by: Kees Cook -Kees > > > --- > base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec > change-id: 20230914-strncpy-drivers-hid-hid-prodikeys-c-cf42614a21d4 > > Best regards, > -- > Justin Stitt > -- Kees Cook

Re: [PATCH] firmware: ti_sci: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
l/latest/process/deprecated.html#strncpy-on-nul-terminated-strings > [1] > Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html > [2] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-harden...@vger.kernel.org > Signed-off-by: Justin Stitt Looks right to me. Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] firmware: tegra: bpmp: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-harden...@vger.kernel.org > Signed-off-by: Justin Stitt This one looks weird because namevirt seems unused, but I assume there's some kind of DMA side-effect happening somewhere? But, yes, after digging around here, I think this all looks right. Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH v3] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
t dimmdev_label_store(struct device *dev, > if (copy_count == 0 || copy_count >= sizeof(dimm->label)) > return -EINVAL; > > - strncpy(dimm->label, data, copy_count); > + strscpy(dimm->label, data, copy_count); > dimm->label[copy_count] = '\0'; Same for this one: replace strncpy with memcpy. -Kees > > return count; > > --- > base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c > change-id: 20230913-strncpy-drivers-edac-edac_mc_sysfs-c-e619b00124a3 > > Best regards, > -- > Justin Stitt > -- Kees Cook

Re: [PATCH] dax: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
issues/90 > Cc: linux-harden...@vger.kernel.org > Signed-off-by: Justin Stitt Looks correct to me. Reviewed-by: Kees Cook -- Kees Cook

Re: [PATCH] cpuidle: dt: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
ages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html > [2] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-harden...@vger.kernel.org > Signed-off-by: Justin Stitt A very regular strncpy/strscpy conversion. :) Reviewed-by: Kees Cook -- Kees Cook

  1   2   3   4   5   6   7   8   9   10   >