Re: [RFC bpf-next 5/6] bpf: selftests: test_tunnel: Disable CO-RE relocations

2023-10-30 Thread Andrii Nakryiko
On Sun, Oct 29, 2023 at 4:22 PM Daniel Xu wrote: > > On Fri, Oct 27, 2023 at 01:33:09PM -0700, Andrii Nakryiko wrote: > > On Fri, Oct 27, 2023 at 11:46 AM Daniel Xu wrote: > > > > > > Switching to vmlinux.h definitions seems to make the verifier very > > > unhappy with bitfield accesses. The erro

Re: [PATCHv2 net] selftests: pmtu.sh: fix result checking

2023-10-30 Thread Po-Hsu Lin
On Tue, Oct 31, 2023 at 11:47 AM Hangbin Liu wrote: > > In the PMTU test, when all previous tests are skipped and the new test > passes, the exit code is set to 0. However, the current check mistakenly > treats this as an assignment, causing the check to pass every time. > > Consequently, regardle

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Steven Rostedt
[ Adding Masami and stable ] On Tue, 31 Oct 2023 00:27:07 + Beau Belgrave wrote: > On Mon, Oct 30, 2023 at 05:31:51PM -0400, Steven Rostedt wrote: > > On Mon, 30 Oct 2023 12:42:23 -0400 > > Steven Rostedt wrote: > > > > > > I still get the splat about the trace_array_put when running > >

[PATCHv2 net] selftests: pmtu.sh: fix result checking

2023-10-30 Thread Hangbin Liu
In the PMTU test, when all previous tests are skipped and the new test passes, the exit code is set to 0. However, the current check mistakenly treats this as an assignment, causing the check to pass every time. Consequently, regardless of how many tests have failed, if the latest test passes, the

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Beau Belgrave
On Mon, Oct 30, 2023 at 05:31:51PM -0400, Steven Rostedt wrote: > On Mon, 30 Oct 2023 12:42:23 -0400 > Steven Rostedt wrote: > > > > I still get the splat about the trace_array_put when running > > > user_event's ftrace selftest: > > > > > > [ 26.665931] [ cut here ] >

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Steven Rostedt
On Mon, 30 Oct 2023 12:42:23 -0400 Steven Rostedt wrote: > > I still get the splat about the trace_array_put when running > > user_event's ftrace selftest: > > > > [ 26.665931] [ cut here ] > > [ 26.63] WARNING: CPU: 12 PID: 291 at kernel/trace/trace.c:516 > > tr

Re: [PATCH v4 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-10-30 Thread Suren Baghdasaryan
On Mon, Oct 30, 2023 at 1:35 PM Peter Xu wrote: > > On Mon, Oct 30, 2023 at 01:22:02PM -0700, Suren Baghdasaryan wrote: > > > > +static int adjust_page_size(void) > > > > +{ > > > > + page_size = default_huge_page_size(); > > > > > > This is hacky too, currently page_size is the real page_size

Re: [PATCH v4 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-10-30 Thread Peter Xu
On Mon, Oct 30, 2023 at 01:22:02PM -0700, Suren Baghdasaryan wrote: > > > +static int adjust_page_size(void) > > > +{ > > > + page_size = default_huge_page_size(); > > > > This is hacky too, currently page_size is the real page_size backing the > > memory. > > > > To make thp test simple, maybe

Re: [PATCH v4 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-10-30 Thread Suren Baghdasaryan
On Mon, Oct 30, 2023 at 1:14 PM Peter Xu wrote: > > On Fri, Oct 27, 2023 at 05:38:15PM -0700, Suren Baghdasaryan wrote: > > Add tests for new UFFDIO_MOVE ioctl which uses uffd to move source > > into destination buffer while checking the contents of both after > > the move. After the operation the

Re: [PATCH v4 1/5] mm/rmap: support move to different root anon_vma in folio_move_anon_rmap()

2023-10-30 Thread Peter Xu
On Fri, Oct 27, 2023 at 05:38:11PM -0700, Suren Baghdasaryan wrote: > From: Andrea Arcangeli > > For now, folio_move_anon_rmap() was only used to move a folio to a > different anon_vma after fork(), whereby the root anon_vma stayed > unchanged. For that, it was sufficient to hold the folio lock w

Re: [PATCH v4 3/5] selftests/mm: call uffd_test_ctx_clear at the end of the test

2023-10-30 Thread Peter Xu
On Fri, Oct 27, 2023 at 05:38:13PM -0700, Suren Baghdasaryan wrote: > uffd_test_ctx_clear() is being called from uffd_test_ctx_init() to unmap > areas used in the previous test run. This approach is problematic because > while unmapping areas uffd_test_ctx_clear() uses page_size and nr_pages > whic

Re: [PATCH v4 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-10-30 Thread Peter Xu
On Fri, Oct 27, 2023 at 05:38:15PM -0700, Suren Baghdasaryan wrote: > Add tests for new UFFDIO_MOVE ioctl which uses uffd to move source > into destination buffer while checking the contents of both after > the move. After the operation the content of the destination buffer > should match the origi

Re: [PATCH bpf-next v3 2/2] selftests/bpf: Add malloc failure checks in bpf_iter

2023-10-30 Thread Kui-Feng Lee
Acked-by: Kui-Feng Lee On 10/27/23 22:24, Yuran Pereira wrote: Since some malloc calls in bpf_iter may at times fail, this patch adds the appropriate fail checks, and ensures that any previously allocated resource is appropriately destroyed before returning the function. Signed-off-by: Yuran P

Re: [PATCH bpf-next v3 1/2] selftests/bpf: Convert CHECK macros to ASSERT_* macros in bpf_iter

2023-10-30 Thread Kui-Feng Lee
Acked-by: Kui-Feng Lee On 10/27/23 22:24, Yuran Pereira wrote: As it was pointed out by Yonghong Song [1], in the bpf selftests the use of the ASSERT_* series of macros is preferred over the CHECK macro. This patch replaces all CHECK calls in bpf_iter with the appropriate ASSERT_* macros. [1]

Re: [PATCH v2 22/24] kselftest/arm64: parse POE_MAGIC in a signal frame

2023-10-30 Thread Mark Brown
On Fri, Oct 27, 2023 at 07:08:48PM +0100, Joey Gouly wrote: > Teach the signal frame parsing about the new POE frame, avoids warning when it > is generated. Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v2 21/24] kselftest/arm64: add HWCAP test for FEAT_S1POE

2023-10-30 Thread Mark Brown
On Fri, Oct 27, 2023 at 07:08:47PM +0100, Joey Gouly wrote: > + { > + .name = "POE", > + .at_hwcap = AT_HWCAP2, > + .hwcap_bit = HWCAP2_POE, > + .cpuinfo = "poe", > + .sigill_fn = poe_sigill, > + }, We should set sigill_reliable

Re: [PATCH v2 15/24] arm64: add POE signal support

2023-10-30 Thread Mark Brown
On Fri, Oct 27, 2023 at 07:08:41PM +0100, Joey Gouly wrote: > Add PKEY support to signals, by saving and restoring POR_EL0 from the > stackframe. Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH RFC RFT 2/5] fork: Add shadow stack support to clone3()

2023-10-30 Thread Deepak Gupta
On Mon, Oct 30, 2023 at 11:39:17AM +, szabolcs.n...@arm.com wrote: The 10/27/2023 16:24, Deepak Gupta wrote: On Fri, Oct 27, 2023 at 12:49:59PM +0100, szabolcs.n...@arm.com wrote: > no. the lifetime is the issue: a stack in principle can outlive > a thread and resumed even after the original

Re: [PATCH v4 2/5] zswap: make shrinking memcg-aware

2023-10-30 Thread Yosry Ahmed
> > [..] > > > +/* > > > +* lru functions > > > +**/ > > > +static bool zswap_lru_add(struct list_lru *list_lru, struct zswap_entry > > > *entry) > > > +{ > > > + struct mem_cgroup *memcg = get_mem_cgroup_from_entry(entry); > >

[PATCH v2] selftests/net: synchronize udpgso_bench rx and tx

2023-10-30 Thread Lucas Karpinski
The sockets used by udpgso_bench_tx aren't always ready when udpgso_bench_tx transmits packets. This issue is more prevalent in -rt kernels, but can occur in both. Replace the hacky sleep calls with a function that checks whether the ports in the namespace are ready for use. Suggested-by: Paolo Ab

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Beau Belgrave
On Mon, Oct 30, 2023 at 12:42:23PM -0400, Steven Rostedt wrote: > On Mon, 30 Oct 2023 09:31:02 -0700 > Beau Belgrave wrote: > > > I applied both [1][2] patches, and I no longer get any panics. However, > > Great! Can I add "Tested-by" from you on those patches? > Yep, please do. > > I still g

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Steven Rostedt
On Mon, 30 Oct 2023 09:31:02 -0700 Beau Belgrave wrote: > I applied both [1][2] patches, and I no longer get any panics. However, Great! Can I add "Tested-by" from you on those patches? > I still get the splat about the trace_array_put when running > user_event's ftrace selftest: > > [ 26.66

Re: selftests: user_events: ftrace_test - RIP: 0010:tracing_update_buffers (kernel/trace/trace.c:6470)

2023-10-30 Thread Beau Belgrave
On Fri, Oct 27, 2023 at 10:33:44PM -0400, Steven Rostedt wrote: > On Fri, 27 Oct 2023 18:36:40 -0400 > Steven Rostedt wrote: > > > On Fri, 27 Oct 2023 12:20:11 -0700 > > Beau Belgrave wrote: > > > > > On Fri, Oct 27, 2023 at 05:38:41PM +0530, Naresh Kamboju wrote: > > > > Following kernel cra

Re: [PATCH net] selftests: pmtu.sh: fix result checking

2023-10-30 Thread Po-Hsu Lin
On Mon, Oct 30, 2023 at 5:46 PM Hangbin Liu wrote: > > In the PMTU test, when all previous tests are skipped and the new test > passes, the exit code is set to 0. However, the current check mistakenly > treats this as an assignment, causing the check to pass every time. > > Consequently, regardles

Re: [PATCH RFC RFT 2/5] fork: Add shadow stack support to clone3()

2023-10-30 Thread szabolcs.n...@arm.com
The 10/27/2023 16:24, Deepak Gupta wrote: > On Fri, Oct 27, 2023 at 12:49:59PM +0100, szabolcs.n...@arm.com wrote: > > no. the lifetime is the issue: a stack in principle can outlive > > a thread and resumed even after the original thread exited. > > for that to work the shadow stack has to outlive

[PATCH RESEND] kunit: debugfs: Fix unchecked dereference in debugfs_print_results()

2023-10-30 Thread Richard Fitzgerald
Move the call to kunit_suite_has_succeeded() after the check that the kunit_suite pointer is valid. This was found by smatch: lib/kunit/debugfs.c:66 debugfs_print_results() warn: variable dereferenced before check 'suite' (see line 63) Signed-off-by: Richard Fitzgerald Reported-by: Dan Carpen

[PATCH RESEND] kunit: string-stream: Allow ERR_PTR to be passed to string_stream_destroy()

2023-10-30 Thread Richard Fitzgerald
Check the stream pointer passed to string_stream_destroy() for IS_ERR_OR_NULL() instead of only NULL. Whatever alloc_string_stream() returns should be safe to pass to string_stream_destroy(), and that will be an ERR_PTR. It's obviously good practise and generally helpful to also check for NULL po

[PATCH v2 RESEND] kunit: debugfs: Handle errors from alloc_string_stream()

2023-10-30 Thread Richard Fitzgerald
In kunit_debugfs_create_suite() give up and skip creating the debugfs file if any of the alloc_string_stream() calls return an error or NULL. Only put a value in the log pointer of kunit_suite and kunit_test if it is a valid pointer to a log. This prevents the potential invalid dereference reporte

Re: [PATCH] KVM: selftests: add -MP to CFLAGS

2023-10-30 Thread David Woodhouse
On Mon, 2023-10-30 at 10:08 +, David Laight wrote: > From: David Woodhouse > > Sent: 30 October 2023 09:46 > > > > On Sun, 2023-10-29 at 21:13 +, David Laight wrote: > > > From: David Woodhouse > > > > Sent: 28 October 2023 20:35 > > > > > > > > Using -MD without -MP causes build failures

RE: [PATCH] KVM: selftests: add -MP to CFLAGS

2023-10-30 Thread David Laight
From: David Woodhouse > Sent: 30 October 2023 09:46 > > On Sun, 2023-10-29 at 21:13 +, David Laight wrote: > > From: David Woodhouse > > > Sent: 28 October 2023 20:35 > > > > > > Using -MD without -MP causes build failures when a header file is deleted > > > or moved. With -MP, the compiler wi

[PATCH net] selftests: pmtu.sh: fix result checking

2023-10-30 Thread Hangbin Liu
In the PMTU test, when all previous tests are skipped and the new test passes, the exit code is set to 0. However, the current check mistakenly treats this as an assignment, causing the check to pass every time. Consequently, regardless of how many tests have failed, if the latest test passes, the

Re: [PATCH] KVM: selftests: add -MP to CFLAGS

2023-10-30 Thread David Woodhouse
On Sun, 2023-10-29 at 21:13 +, David Laight wrote: > From: David Woodhouse > > Sent: 28 October 2023 20:35 > > > > Using -MD without -MP causes build failures when a header file is deleted > > or moved. With -MP, the compiler will emit phony targets for the header > > files it lists as depende

[RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-10-30 Thread Dan Carpenter
We have started printing more and more intentional stack traces. Whether it's testing KASAN is able to detect use after frees or it's part of a kunit test. These stack traces can be problematic. They suddenly show up as a new failure. Now the test team has to contact the developers. A bunch of

Re: [PATCH v12] exec: Fix dead-lock in de_thread with ptrace_attach

2023-10-30 Thread kernel test robot
Hi Bernd, kernel test robot noticed the following build warnings: [auto build test WARNING on kees/for-next/execve] [also build test WARNING on kees/for-next/seccomp shuah-kselftest/next shuah-kselftest/fixes linus/master v6.6] [cannot apply to next-20231030] [If your patch is applied to the

[PATCH] Lower the ptrace permissions so that the memfd_secrect test program runs without an issue.

2023-10-30 Thread Itaru Kitayama
ecret" run_test ./memfd_secret # KSM KSM_MERGE_TIME_HUGE_PAGES test with size of 100 --- base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa change-id: 20231030-selftest-c75b1b460817 Best regards, -- Itaru Kitayama