[PATCH 0/2] exec: Add KUnit test for bprm_stack_limits()

2024-05-19 Thread Kees Cook
Hi, This adds a first KUnit test to the core exec code. With the ability to manipulate userspace memory from KUnit coming[1], I wanted to at least get the KUnit framework in place in exec.c. Most of the coming tests will likely be to binfmt_elf.c, but still, this serves as a reasonable first step.

[PATCH 2/2] exec: Avoid pathological argc, envc, and bprm->p values

2024-05-19 Thread Kees Cook
Make sure nothing goes wrong with the string counters or the bprm's belief about the stack pointer. Add checks and matching self-tests. For 32-bit validation, this was run under 32-bit UML: $ tools/testing/kunit/kunit.py run --make_options SUBARCH=i386 exec Signed-off-by: Kees Cook --- Cc: Eric

[PATCH 1/2] exec: Add KUnit test for bprm_stack_limits()

2024-05-19 Thread Kees Cook
Since bprm_stack_limits() operates with very limited side-effects, add it as the first exec.c KUnit test. Add to Kconfig and adjust MAINTAINERS file to include it. Tested on 64-bit UML: $ tools/testing/kunit/kunit.py run exec Signed-off-by: Kees Cook --- Cc: Eric Biederman Cc: Justin Stitt Cc:

Re: [PATCH v2] ntp: safeguard against time_constant overflow case

2024-05-19 Thread Thomas Gleixner
On Fri, May 17 2024 at 22:18, Justin Stitt wrote: > On Fri, May 17, 2024, 19:33 Thomas Gleixner wrote: > I accidentally sent a Frankstein-esque creation of two patches I was > working on. Not my brightest moment. It got past my testing because (as you > pointed out) I only ran the reproducer again

[PATCH 2/2 net-next] libceph: Use __counted_by() in struct ceph_snap_context

2024-05-19 Thread Christophe JAILLET
Annotate the 'snaps' flexible array in "struct ceph_snap_context" with __counted_by() so that additional checks can be made, if enabled. Signed-off-by: Christophe JAILLET --- Compile tested only --- include/linux/ceph/libceph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH] RDMA/irdma: Annotate flexible array with __counted_by() in struct irdma_qvlist_info

2024-05-19 Thread Christophe JAILLET
'num_vectors' is used to count the number of elements in the 'qv_info' flexible array in "struct irdma_qvlist_info". So annotate it with __counted_by() to make it explicit and enable some additional checks. This allocation is done in irdma_save_msix_info(). Signed-off-by: Christophe JAILLET ---