[PATCH 2/3] selftests/seccomp: Change the syscall used in KILL_THREAD test

2024-01-24 Thread Terry Tritton
The Bionic version of pthread_create used on Android calls the prctl function to give the stack and thread local storage a useful name. This will cause the KILL_THREAD test to fail as it will kill the thread as soon as it is created. change the test to use getpid instead of prctl. Signed-off-by:

[PATCH 1/3] selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)

2024-01-24 Thread Terry Tritton
unshare(CLONE_NEWPID) can return EINVAL if the kernel does not have the CONFIG_PID_NS option enabled. Add a check on these calls to skip the test if we receive EINVAL. Signed-off-by: Terry Tritton --- tools/testing/selftests/seccomp/seccomp_bpf.c | 9 - 1 file changed, 8 insertions(+),

[PATCH 0/3] selftests/seccomp seccomp_bpf test fixes

2024-01-24 Thread Terry Tritton
Hi, Here are a few fixes for seccomp_bpf tests found when testing on Android: user_notification_sibling_pid_ns: unshare(CLONE_NEWPID) can return EINVAL so have added a check for this. KILL_THREAD: This one is a bit more Android specific. In Bionic pthread_create is calling prctl, this is

[PATCH v4 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-24 Thread Mark Brown
The seccomp benchmark test makes a number of checks on the performance it measures and logs them to the output but does so in a custom format which none of the automated test runners understand meaning that the chances that anyone is paying attention are slim. Let's additionally log each result in

[PATCH v4 1/2] kselftest/seccomp: Use kselftest output functions for benchmark

2024-01-24 Thread Mark Brown
In preparation for trying to output the test results themselves in TAP format rework all the prints in the benchmark to use the kselftest output functions. The uses of system() all produce single line output so we can avoid having to deal with fully managing the child process and continue to use

[PATCH v4 0/2] kselftest/seccomp: Convert to KTAP output

2024-01-24 Thread Mark Brown
Currently the seccomp benchmark selftest produces non-standard output, meaning that while it makes a number of checks of the performance it observes this has to be parsed by humans. This means that automated systems running this suite of tests are almost certainly ignoring the results which isn't

Re: [PATCH] selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag

2024-01-24 Thread Audra Mitchell
On Sun, Jan 21, 2024 at 02:31:53PM -0800, Andrew Morton wrote: > On Fri, 19 Jan 2024 15:58:01 -0500 Audra Mitchell wrote: > > > In order for the page table level 5 to be in use, the CPU must have the > > setting enabled in addition to the CONFIG option. Check for the flag to be > > set to avoid

[PATCH 3/3] selftests/seccomp: user_notification_addfd check nextfd is available

2024-01-24 Thread Terry Tritton
Currently the user_notification_addfd test checks what the next expected file descriptor will be by incrementing a variable nextfd. This does not account for file descriptors that may already be open before the test is started and will cause the test to fail if any exist. Replace nextfd++ with a

Re: [PATCH] selftests/landlock:Fix fs_test build issues with old libc

2024-01-24 Thread Mickaël Salaün
Thanks, it's merged with some fixes: https://git.kernel.org/mic/c/82852a3cc2152eb7c7b7007b6430faa979b08fad On Wed, Jan 24, 2024 at 10:29:08AM +0800, Hu Yadi wrote: > From: "Hu.Yadi" You might want to fix the extra dot in your name. > > Fixes: 04f9070e99a4 ("selftests/landlock: Add tests for

Re: [PATCH net-next 2/4] selftests: tc-testing: check if 'jq' is available in taprio script

2024-01-24 Thread Pedro Tammela
On 24/01/2024 07:31, Davide Caratti wrote: hello Pedro, thanks for your answer! On Tue, Jan 23, 2024 at 5:47 PM Pedro Tammela wrote: On 23/01/2024 10:17, Davide Caratti wrote: hi Pedro, On Tue, Jan 23, 2024 at 1:28 PM Pedro Tammela wrote: If 'jq' is not available the taprio tests that

Re: Re: Re: [PATCH v2] kunit: Mark filter* params as rw

2024-01-24 Thread Lucas De Marchi
On Wed, Jan 24, 2024 at 11:49:43AM +0800, David Gow wrote: On Wed, 24 Jan 2024 at 00:31, Lucas De Marchi wrote: On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: >On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi wrote: >> >> By allowing the filter_glob parameter to be written to, it's

[PATCH net-next 6/6] selftests: forwarding: Remove duplicated lib.sh content

2024-01-24 Thread Benjamin Poirier
From: Petr Machata commit 25ae948b4478 ("selftests/net: add lib.sh") added net/lib.sh to contain code shared by tests under net/ and net/forwarding/. However, this caused issues with selftests from directories other than net/forwarding/, in particular those under drivers/net/. Those issues were

[PATCH net-next 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES

2024-01-24 Thread Benjamin Poirier
In order to avoid duplicated files when both the bonding and forwarding tests are exported together, add net/forwarding/lib.sh to TEST_INCLUDES and include it via its relative path. Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier ---

[PATCH net-next 0/6] selftests: Add TEST_INCLUDES directive and adjust tests to use it

2024-01-24 Thread Benjamin Poirier
After commit 25ae948b4478 ("selftests/net: add lib.sh") but before commit 2114e83381d3 ("selftests: forwarding: Avoid failures to source net/lib.sh"), some net selftests encountered errors when they were being exported and run. This was because the new net/lib.sh was not exported along with the

[PATCH net-next 3/6] selftests: team: Add shared library scripts to TEST_INCLUDES

2024-01-24 Thread Benjamin Poirier
In order to avoid duplicated files when both the team and bonding tests are exported together, add lag_lib.sh to TEST_INCLUDES. Do likewise for net/forwarding/lib.sh regarding team and forwarding tests. Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier ---

Re: [PATCH 0/3] selftests/net: A couple of typos fixes in key-management test

2024-01-24 Thread Dmitry Safonov
Hi Jakub, On 1/24/24 15:12, Jakub Kicinski wrote: > On Fri, 19 Jan 2024 18:39:14 + Dmitry Safonov wrote: >>> You probably want something smaller to be honest. >>> tools/testing/selftests/net/config has a lot of stuff in it >>> and it's actually missing a lot more. I'm working thru adding >>>

[PATCH net-next v2 3/5] selftests: tc-testing: adjust fq test to latest iproute2

2024-01-24 Thread Pedro Tammela
Adjust the fq verify regex to the latest iproute2 Signed-off-by: Pedro Tammela --- tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json

[PATCH net-next v2 4/5] selftests: tc-testing: enable all tdc tests

2024-01-24 Thread Pedro Tammela
For the longest time tdc ran only actions and qdiscs tests. It's time to enable all the remaining tests so every user visible piece of TC is tested by the downstream CIs. Signed-off-by: Pedro Tammela --- tools/testing/selftests/tc-testing/tdc.sh | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH net-next v2 2/5] selftests: tc-testing: check if 'jq' is available in taprio tests

2024-01-24 Thread Pedro Tammela
If 'jq' is not available the taprio tests might enter an infinite loop, use the "dependsOn" feature from tdc to check if jq is present. If it's not the test is skipped. Suggested-by: Davide Caratti Signed-off-by: Pedro Tammela --- tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json

[PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc

2024-01-24 Thread Pedro Tammela
Patches 1 and 3 are fixes for tdc that were discovered when running it using defconfig + tc-testing config and against the latest iproute2. Patch 2 improves the taprio tests. Patch 4 enables all tdc tests. Patch 5 fixes the return code of tdc for when a test fails setup/teardown. v1->v2:

[PATCH net-next v2 1/5] selftests: tc-testing: add missing netfilter config

2024-01-24 Thread Pedro Tammela
On a default config + tc-testing config build, tdc will miss all the netfilter related tests because it's missing: CONFIG_NETFILTER=y Signed-off-by: Pedro Tammela --- tools/testing/selftests/tc-testing/config | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net-next v2 5/5] selftests: tc-testing: return fail if a test fails in setup/teardown

2024-01-24 Thread Pedro Tammela
As of today tests throwing exceptions in setup/teardown phase are treated as skipped but they should really be failures. Signed-off-by: Pedro Tammela --- tools/testing/selftests/tc-testing/tdc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH net-next 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES

2024-01-24 Thread Jay Vosburgh
Benjamin Poirier wrote: >In order to avoid duplicated files when both the bonding and forwarding >tests are exported together, add net/forwarding/lib.sh to TEST_INCLUDES and >include it via its relative path. > >Reviewed-by: Petr Machata >Tested-by: Petr Machata >Signed-off-by: Benjamin

Re: [PATCH 0/3] selftests/net: A couple of typos fixes in key-management test

2024-01-24 Thread Jakub Kicinski
On Fri, 19 Jan 2024 18:39:14 + Dmitry Safonov wrote: > > You probably want something smaller to be honest. > > tools/testing/selftests/net/config has a lot of stuff in it > > and it's actually missing a lot more. I'm working thru adding > > the missing options to

[PATCH net-next 4/6] selftests: dsa: Replace test symlinks by wrapper script

2024-01-24 Thread Benjamin Poirier
The dsa tests which are symlinks of tests from net/forwarding/ (like tc_actions.sh) become regular files after export (because `rsync --copy-unsafe-links` is used) and expect to source lib.sh (net/forwarding/lib.sh) from the same directory. In the last patch of this series, net/forwarding/lib.sh

[PATCH net-next 1/6] selftests: Introduce Makefile variable to list shared bash scripts

2024-01-24 Thread Benjamin Poirier
Some tests written in bash source other files in a parent directory. For example, drivers/net/bonding/dev_addr_lists.sh sources net/forwarding/lib.sh. If a subset of tests is exported and run outside the source tree (for example by using `make -C tools/testing/selftests gen_tar

[PATCH net-next 5/6] selftests: forwarding: Redefine relative_path variable

2024-01-24 Thread Benjamin Poirier
The following code which is part of lib.sh: relative_path="${BASH_SOURCE%/*}" if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then relative_path="." fi reimplements functionality that is part of `dirname`: $ dirname "" . To avoid this duplication, replace "relative_path" by

Re: [PATCH 0/3] selftests/seccomp seccomp_bpf test fixes

2024-01-24 Thread Kees Cook
On Wed, 24 Jan 2024 14:13:54 +, Terry Tritton wrote: > Here are a few fixes for seccomp_bpf tests found when testing on > Android: > > user_notification_sibling_pid_ns: > unshare(CLONE_NEWPID) can return EINVAL so have added a check for this. > > KILL_THREAD: > This one is a bit more

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Jeff Xu
On Tue, Jan 23, 2024 at 10:15 AM Liam R. Howlett wrote: > > * jef...@chromium.org [240122 10:29]: > > From: Jeff Xu > > > > The new mseal() is an syscall on 64 bit CPU, and with > > following signature: > > > > int mseal(void addr, size_t len, unsigned long flags) > > addr/len: memory range. >

Re: [PATCH net-next 2/4] selftests: tc-testing: check if 'jq' is available in taprio script

2024-01-24 Thread Davide Caratti
hello Pedro, thanks for your answer! On Tue, Jan 23, 2024 at 5:47 PM Pedro Tammela wrote: > > On 23/01/2024 10:17, Davide Caratti wrote: > > hi Pedro, > > > > On Tue, Jan 23, 2024 at 1:28 PM Pedro Tammela > > wrote: > >> > >> If 'jq' is not available the taprio tests that use this script will

Re: [PATCH net] selftests: netdevsim: fix the udp_tunnel_nic test

2024-01-24 Thread Simon Horman
On Mon, Jan 22, 2024 at 10:05:29PM -0800, Jakub Kicinski wrote: > This test is missing a whole bunch of checks for interface > renaming and one ifup. Presumably it was only used on a system > with renaming disabled and NetworkManager running. > > Fixes: 91f430b2c49d ("selftests: net: add a test

Re: [PATCH net-next 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES

2024-01-24 Thread Benjamin Poirier
On 2024-01-24 10:24 -0800, Jay Vosburgh wrote: [...] > >diff --git a/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh > >b/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh > >index a509ef949dcf..0eb7edfb584c 100644 > >---

Re: [PATCH net] selftests: tcp_ao: add a config file

2024-01-24 Thread Dmitry Safonov
On 1/24/24 19:25, Jakub Kicinski wrote: > Still a bit unclear whether each directory should have its own > config file, but assuming they should lets add one for tcp_ao. > > The following tests still fail with this config in place: > - rst_ipv4, > - rst_ipv6, > - bench-lookups_ipv6. > other 21

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Theo de Raadt
Theo de Raadt wrote: > This discussion about the malloc heap is ridiculous. Obviously it is > programmer error to lock the permissions on memory you will free for > reuse. But you can't fix this problem with malloc(), without breaking > other extremely common circumstances where the allocation

[PATCH net 2/3] selftests: net: included needed helper in the install targets

2024-01-24 Thread Paolo Abeni
The blamed commit below introduce a dependency in some net self-tests towards a newly introduce helper script. Such script is currently not included into the TEST_PROGS_EXTENDED list and thus is not installed, causing failure for the relevant tests when executed from the install dir. Fix the

[PATCH net 3/3] selftests: net: explicitly wait for listener ready

2024-01-24 Thread Paolo Abeni
The UDP GRO forwarding test still hard-code an arbitrary pause to wait for the UDP listener becoming ready in background. That causes sporadic failures depending on the host load. Replace the sleep with the existing helper waiting for the desired port being exposed. Fixes: a062260a9d5f

[PATCH net 0/3] selftests: net: a few fixes

2024-01-24 Thread Paolo Abeni
This series address self-tests failures for udp gro-related tests. The first patch addresses the main problem I observe locally - the XDP program required by such tests, xdp_dummy, is currently build in the ebpf self-tests directory, not available if/when the user targets net only. Arguably is

[PATCH net 1/3] selftests: net: remove dependency on ebpf tests

2024-01-24 Thread Paolo Abeni
Several net tests requires an XDP program build under the ebpf directory, and error out if such program is not available. That makes running successful net test hard, let's duplicate into the net dir the [very small] program, re-using the existing rules to build it, and finally dropping the bogus

[PATCH net] selftests: tcp_ao: add a config file

2024-01-24 Thread Jakub Kicinski
Still a bit unclear whether each directory should have its own config file, but assuming they should lets add one for tcp_ao. The following tests still fail with this config in place: - rst_ipv4, - rst_ipv6, - bench-lookups_ipv6. other 21 pass. Fixes: d11301f65977 ("selftests/net: Add TCP-AO

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Liam R. Howlett
* Jeff Xu [240124 12:50]: > On Tue, Jan 23, 2024 at 10:15 AM Liam R. Howlett > wrote: > > > > * jef...@chromium.org [240122 10:29]: > > > From: Jeff Xu > > > > > > The new mseal() is an syscall on 64 bit CPU, and with > > > following signature: > > > > > > int mseal(void addr, size_t len,

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-24 Thread Jeff Xu
On Mon, Jan 22, 2024 at 2:34 PM Theo de Raadt wrote: > > Jeff Xu wrote: > > > On Mon, Jan 22, 2024 at 7:49 AM Theo de Raadt wrote: > > > > > > Regarding these pieces > > > > > > > The PROT_SEAL bit in prot field of mmap(). When present, it marks > > > > the map sealed since creation. > > > > >

Re: [PATCH 0/3] selftests/net: A couple of typos fixes in key-management test

2024-01-24 Thread Jakub Kicinski
On Wed, 24 Jan 2024 17:46:10 + Dmitry Safonov wrote: > >> Thanks! > >> > >> I'll send a patch for it in version 2 (as I anyway need to address > >> Simon's feedback). > > > > Hi Dmitry! > > > > I put TCP_AO and VETH in the config and the tests seem to fail with > > Thanks for wiring it

Re: [PATCH 0/3] selftests/net: A couple of typos fixes in key-management test

2024-01-24 Thread Dmitry Safonov
On 1/24/24 19:04, Jakub Kicinski wrote: > On Wed, 24 Jan 2024 17:46:10 + Dmitry Safonov wrote: Thanks! I'll send a patch for it in version 2 (as I anyway need to address Simon's feedback). >>> >>> Hi Dmitry! >>> >>> I put TCP_AO and VETH in the config and the tests seem

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Theo de Raadt
Liam R. Howlett wrote: > > Adding mseal() into picture, however, the heap is then sealed > > partially, user can still free it, but the memory remains to be RO, > > and the result of brk-shrink is nondeterministic, depending on if > > munmap() will try to free the sealed memory.(brk uses munmap

Re: [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs

2024-01-24 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Mon, 22 Jan 2024 11:58:15 -0800 you wrote: > If there is more than 32 cpus the bitmask will start to contain > commas, leading to: > > ./rps_default_mask.sh: line 36: [: ,: integer expression >

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-24 Thread Jeff Xu
On Tue, Jan 23, 2024 at 10:58 AM Theo de Raadt wrote: > > It's the same with MAP_MSEALABLE. I don't get it. So now there are 3 > memory types: >- cannot be sealed, ever >- not yet sealed >- sealed > > What purpose does the first type serve? Please explain the use case. >

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-24 Thread Theo de Raadt
Jeff Xu wrote: > > I don't have a feeling about it. > > > > I spent a year engineering a complete system which exercises the maximum > > amount of memory you can lock. > > > > I saw nothing like what you are describing. I had PROT_IMMUTABLE in my > > drafts, and saw it turning into a dangerous

Re: [PATCHv2 net] selftests/net/lib: update busywait timeout value

2024-01-24 Thread Simon Horman
On Wed, Jan 24, 2024 at 02:13:44PM +0800, Hangbin Liu wrote: > The busywait timeout value is a millisecond, not a second. So the > current setting 2 is too small. On slow/busy host (or VMs) the > current timeout can expire even on "correct" execution, causing random > failures. Let's copy the

Re: [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs

2024-01-24 Thread Simon Horman
On Mon, Jan 22, 2024 at 11:58:15AM -0800, Jakub Kicinski wrote: > If there is more than 32 cpus the bitmask will start to contain > commas, leading to: > > ./rps_default_mask.sh: line 36: [: ,: integer expression > expected > > Remove the commas, bash doesn't interpret leading

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Jeff Xu
On Wed, Jan 24, 2024 at 12:06 PM Liam R. Howlett wrote: > > * Jeff Xu [240124 12:50]: > > On Tue, Jan 23, 2024 at 10:15 AM Liam R. Howlett > > wrote: > > > > > > * jef...@chromium.org [240122 10:29]: > > > > From: Jeff Xu > > > > > > > > The new mseal() is an syscall on 64 bit CPU, and with >

Re: [PATCH net-next 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES

2024-01-24 Thread Jay Vosburgh
Benjamin Poirier wrote: >On 2024-01-24 10:24 -0800, Jay Vosburgh wrote: >[...] >> >diff --git a/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh >> >b/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh >> >index a509ef949dcf..0eb7edfb584c 100644 >> >---

[PATCH v6 3/4] KVM: selftests: Add ucall test support for LoongArch

2024-01-24 Thread Bibo Mao
From: Tianrui Zhao Add ucall test support for LoongArch, ucall method on LoongArch uses undefined mmio area. It will cause causes vcpu exits to hypervisor so that hypervisor can communicate with vcpu. Signed-off-by: Tianrui Zhao Signed-off-by: Bibo Mao ---

[PATCH v6 2/4] KVM: selftests: Add core KVM selftests support for LoongArch

2024-01-24 Thread Bibo Mao
From: Tianrui Zhao Add core KVM selftests support for LoongArch, it includes exception handler, mmu page table setup and vcpu startup entry supporting etc. Signed-off-by: Tianrui Zhao Signed-off-by: Bibo Mao --- .../selftests/kvm/lib/loongarch/exception.S | 59

[PATCH v6 0/4] VM: selftests: Add LoongArch support

2024-01-24 Thread Bibo Mao
This patchset adds KVM selftests for LoongArch system, currently only some common test cases are supported and pass to run. These testcase are listed as following: demand_paging_test dirty_log_perf_test dirty_log_test guest_print_test hardware_disable_test

[PATCH v6 1/4] KVM: selftests: Add KVM selftests header files for LoongArch

2024-01-24 Thread Bibo Mao
Add KVM selftests header files for LoongArch, including processor.h and kvm_util_base.h. It mainly contains LoongArch CSR register definition and page table entry definition. Signed-off-by: Tianrui Zhao Signed-off-by: Bibo Mao --- .../selftests/kvm/include/kvm_util_base.h | 5 +

[PATCH v6 4/4] KVM: selftests: Add test cases for LoongArch

2024-01-24 Thread Bibo Mao
From: Tianrui Zhao Some common KVM testcases are supported on LoongArch now as following: demand_paging_test dirty_log_perf_test dirty_log_test guest_print_test hardware_disable_test kvm_binary_stats_test kvm_create_max_vcpus

Re: [PATCH net-next v2 0/5] selftests: tc-testing: misc changes for tdc

2024-01-24 Thread Jamal Hadi Salim
On Wed, Jan 24, 2024 at 1:19 PM Pedro Tammela wrote: > > Patches 1 and 3 are fixes for tdc that were discovered when running it > using defconfig + tc-testing config and against the latest iproute2. > > Patch 2 improves the taprio tests. > > Patch 4 enables all tdc tests. > > Patch 5 fixes the

Re: [PATCH net] selftests: tcp_ao: set the timeout to 2 minutes

2024-01-24 Thread Dmitry Safonov
On 1/24/24 23:36, Jakub Kicinski wrote: > The default timeout for tests is 45sec, bench-lookups_ipv6 > seems to take around 50sec when running in a VM without > HW acceleration. Give it a 2x margin and set the timeout > to 120sec. > > Fixes: d1066c9c58d4 ("selftests/net: Add test/benchmark for

Re: [PATCH net 3/3] selftests: net: explicitly wait for listener ready

2024-01-24 Thread Willem de Bruijn
Paolo Abeni wrote: > The UDP GRO forwarding test still hard-code an arbitrary pause > to wait for the UDP listener becoming ready in background. > > That causes sporadic failures depending on the host load. > > Replace the sleep with the existing helper waiting for the desired > port being

Re: [PATCH net 2/3] selftests: net: included needed helper in the install targets

2024-01-24 Thread Willem de Bruijn
Paolo Abeni wrote: > The blamed commit below introduce a dependency in some net self-tests > towards a newly introduce helper script. > > Such script is currently not included into the TEST_PROGS_EXTENDED list > and thus is not installed, causing failure for the relevant tests when > executed

Re: [PATCH net 0/3] selftests: net: a few fixes

2024-01-24 Thread Jakub Kicinski
On Wed, 24 Jan 2024 22:33:19 +0100 Paolo Abeni wrote: > This series address self-tests failures for udp gro-related tests. > > The first patch addresses the main problem I observe locally - the XDP > program required by such tests, xdp_dummy, is currently build in the > ebpf self-tests directory,

Re: [PATCH v7 2/4] mseal: add mseal syscall

2024-01-24 Thread Jeff Xu
On Wed, Jan 24, 2024 at 2:49 PM Jeff Xu wrote: > > On Wed, Jan 24, 2024 at 12:06 PM Liam R. Howlett > wrote: > > > > > Considering this is the MAP_FIXED case, and maybe that is not used > > > that often in practice, I think this is acceptable performance-wise, > > > unless you know another

[PATCH 01/28] riscv: abstract envcfg CSR

2024-01-24 Thread Deepak Gupta
This patch abstracts envcfg CSR in kernel (as is done for other homonyn CSRs). CSR_ENVCFG is used as alias for CSR_SENVCFG or CSR_MENVCFG depending on how kernel is compiled. Additionally it changes CBZE enabling to start using CSR_ENVCFG instead of CSR_SENVCFG. Signed-off-by: Deepak Gupta ---

Re: [PATCH net] selftests: netdevsim: fix the udp_tunnel_nic test

2024-01-24 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Mon, 22 Jan 2024 22:05:29 -0800 you wrote: > This test is missing a whole bunch of checks for interface > renaming and one ifup. Presumably it was only used on a system > with renaming disabled and NetworkManager

[PATCH net] selftests: tcp_ao: set the timeout to 2 minutes

2024-01-24 Thread Jakub Kicinski
The default timeout for tests is 45sec, bench-lookups_ipv6 seems to take around 50sec when running in a VM without HW acceleration. Give it a 2x margin and set the timeout to 120sec. Fixes: d1066c9c58d4 ("selftests/net: Add test/benchmark for removing MKTs") Signed-off-by: Jakub Kicinski ---

[PATCH 1/2] userfaultfd: handle zeropage moves by UFFDIO_MOVE

2024-01-24 Thread Suren Baghdasaryan
Current implementation of UFFDIO_MOVE fails to move zeropages and returns EBUSY when it encounters one. We can handle them by mapping a zeropage at the destination and clearing the mapping at the source. This is done both for ordinary and for huge zeropages. Signed-off-by: Suren Baghdasaryan ---

Re: [PATCH net 1/3] selftests: net: remove dependency on ebpf tests

2024-01-24 Thread Willem de Bruijn
Paolo Abeni wrote: > Several net tests requires an XDP program build under the ebpf > directory, and error out if such program is not available. > > That makes running successful net test hard, let's duplicate into the > net dir the [very small] program, re-using the existing rules to build > it,

Re: [PATCH net-next 1/6] selftests: Introduce Makefile variable to list shared bash scripts

2024-01-24 Thread Jakub Kicinski
On Wed, 24 Jan 2024 12:02:17 -0500 Benjamin Poirier wrote: > --- a/Documentation/dev-tools/kselftest.rst > +++ b/Documentation/dev-tools/kselftest.rst > @@ -255,9 +255,19 @@ Contributing new tests (details) > > TEST_PROGS_EXTENDED, TEST_GEN_PROGS_EXTENDED mean it is the > executable

[RFC PATCH v1 00/28] riscv control-flow integrity for usermode

2024-01-24 Thread debug
From: Deepak Gupta It's been almost an year since I posted my last patch series [1] to enable CPU assisted control-flow integrity for usermode on riscv. A lot has changed since then and so has the patches. It's been a while and since this is a reboot of series, starting with RFC and v1.

[RFC PATCH v1 03/28] riscv: define default value for envcfg

2024-01-24 Thread debug
From: Deepak Gupta Defines a base default value for envcfg per task. By default all tasks should have cache zeroing capability. Any future capabilities can be turned on. Signed-off-by: Deepak Gupta --- arch/riscv/include/asm/csr.h | 2 ++ arch/riscv/kernel/process.c | 1 + 2 files changed, 3

[RFC PATCH v1 02/28] riscv: envcfg save and restore on trap entry/exit

2024-01-24 Thread debug
From: Deepak Gupta envcfg CSR defines enabling bits for cache management instructions and soon will control enabling for control flow integrity and pointer masking features. Control flow integrity enabling for forward cfi and backward cfi is controlled via envcfg and thus need to be enabled on

[RFC PATCH v1 01/28] riscv: abstract envcfg CSR

2024-01-24 Thread debug
From: Deepak Gupta This patch abstracts envcfg CSR in kernel (as is done for other homonyn CSRs). CSR_ENVCFG is used as alias for CSR_SENVCFG or CSR_MENVCFG depending on how kernel is compiled. Additionally it changes CBZE enabling to start using CSR_ENVCFG instead of CSR_SENVCFG.

[RFC PATCH v1 04/28] riscv/Kconfig: enable HAVE_EXIT_THREAD for riscv

2024-01-24 Thread debug
From: Deepak Gupta riscv will need an implementation for exit_thread to clean up shadow stack when thread exits. If current thread had shadow stack enabled, shadow stack is allocated by default for any new thread. Signed-off-by: Deepak Gupta --- arch/riscv/Kconfig | 1 +

Re: [PATCH net-next 0/6] selftests: Add TEST_INCLUDES directive and adjust tests to use it

2024-01-24 Thread Hangbin Liu
On Wed, Jan 24, 2024 at 12:02:16PM -0500, Benjamin Poirier wrote: > After commit 25ae948b4478 ("selftests/net: add lib.sh") but before commit > 2114e83381d3 ("selftests: forwarding: Avoid failures to source > net/lib.sh"), some net selftests encountered errors when they were being > exported and

[RFC PATCH v1 07/28] riscv: kernel handling on trap entry/exit for user cfi

2024-01-24 Thread debug
From: Deepak Gupta Carves out space in arch specific thread struct for cfi status and shadow stack in usermode on riscv. This patch does following - defines a new structure cfi_status with status bit for cfi feature - defines shadow stack pointer, base and size in cfi_status structure - defines

[RFC PATCH v1 06/28] riscv: zicfiss/zicfilp extension csr and bit definitions

2024-01-24 Thread debug
From: Deepak Gupta zicfiss and zicfilp extension gets enabled via b3 and b2 in xenvcfg CSR. menvcfg controls enabling for S/HS mode. henvcfg control enabling for VS while senvcfg controls enabling for U/VU mode. zicfilp extension extends xstatus CSR to hold `expected landing pad` bit. A trap or

[RFC PATCH v1 05/28] riscv: zicfiss/zicfilp enumeration

2024-01-24 Thread debug
From: Deepak Gupta This patch adds support for detecting zicfiss and zicfilp. zicfiss and zicfilp stands for unprivleged integer spec extension for shadow stack and branch tracking on indirect branches, respectively. This patch looks for zicfiss and zicfilp in device tree and accordinlgy lights

[RFC PATCH v1 09/28] mm: abstract shadow stack vma behind `arch_is_shadow_stack`

2024-01-24 Thread debug
From: Deepak Gupta x86 has used VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) to encode shadow stack VMA. VM_SHADOW_STACK is thus not possible on 32bit. Some arches may need a way to encode shadow stack on 32bit and 64bit both and they may encode this information differently in VMAs. This patch

[RFC PATCH v1 10/28] riscv/mm : Introducing new protection flag "PROT_SHADOWSTACK"

2024-01-24 Thread debug
From: Deepak Gupta x86 and arm64 are using VM_SHADOW_STACK (which actually is VM_HIGH_ARCH_5) vma flag and thus restrict it to 64bit implementation only. RISC-V is choosing to encode presence of only VM_WRITE in vma flags as shadow stack vma. This allows 32bit RISC-V ecosystem leverage shadow

[RFC PATCH v1 12/28] riscv mm: manufacture shadow stack pte

2024-01-24 Thread debug
From: Deepak Gupta This patch implements creating shadow stack pte (on riscv). Creating shadow stack PTE on riscv means that clearing RWX and then setting W=1. Signed-off-by: Deepak Gupta --- arch/riscv/include/asm/pgtable.h | 12 1 file changed, 12 insertions(+) diff --git

[RFC PATCH v1 15/28] riscv/mm: Implement map_shadow_stack() syscall

2024-01-24 Thread debug
From: Deepak Gupta As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entirely well onto the security requirements for guarded control stacks since they lead to

[RFC PATCH v1 08/28] mm: Define VM_SHADOW_STACK for RISC-V

2024-01-24 Thread debug
From: Deepak Gupta VM_SHADOW_STACK is defined by x86 as vm flag to mark a shadow stack vma. x86 uses VM_HIGH_ARCH_5 bit but that limits shadow stack vma to 64bit only. arm64 follows same path https://lore.kernel.org/lkml/20231009-arm64-gcs-v6-12-78e55deaa...@kernel.org/#r On RISC-V, write-only

[RFC PATCH v1 11/28] riscv: Implementing "PROT_SHADOWSTACK" on riscv

2024-01-24 Thread debug
From: Deepak Gupta This patch implements new risc-v specific protection flag `PROT_SHADOWSTACK` (only for kernel) on riscv. `PROT_SHADOWSTACK` protection flag is only limited to kernel and not exposed to userspace. Shadow stack is a security construct to prevent against ROP attacks.

[RFC PATCH v1 14/28] riscv mmu: write protect and shadow stack

2024-01-24 Thread debug
From: Deepak Gupta `fork` implements copy on write (COW) by making pages readonly in child and parent both. ptep_set_wrprotect and pte_wrprotect clears _PAGE_WRITE in PTE. Assumption is that page is readable and on fault copy on write happens. To implement COW on such pages, clearing up W bit

[RFC PATCH v1 13/28] riscv mmu: teach pte_mkwrite to manufacture shadow stack PTEs

2024-01-24 Thread debug
From: Deepak Gupta pte_mkwrite creates PTEs with WRITE encodings for underlying arch. Underlying arch can have two types of writeable mappings. One that can be written using regular store instructions. Another one that can only be written using specialized store instructions (like shadow stack

[RFC PATCH v1 19/28] riscv: Implements arch agnostic shadow stack prctls

2024-01-24 Thread debug
From: Deepak Gupta Implement architecture agnostic prctls() interface for setting and getting shadow stack status. prctls implemented are PR_GET_SHADOW_STACK_STATUS, PR_SET_SHADOW_STACK_STATUS and PR_LOCK_SHADOW_STACK_STATUS. As part of PR_SET_SHADOW_STACK_STATUS/PR_GET_SHADOW_STACK_STATUS,

[RFC PATCH v1 20/28] riscv: Implements arch argnostic indirect branch tracking prctls

2024-01-24 Thread debug
From: Deepak Gupta prctls implemented are PR_SET_INDIR_BR_LP_STATUS / PR_GET_INDIR_BR_LP_STATUS and PR_LOCK_INDIR_BR_LP_STATUS. Signed-off-by: Deepak Gupta --- arch/riscv/include/asm/usercfi.h | 17 +++- arch/riscv/kernel/usercfi.c | 74 2 files

[RFC PATCH v1 21/28] riscv/traps: Introduce software check exception

2024-01-24 Thread debug
From: Deepak Gupta zicfiss / zicfilp introduces a new exception to priv isa `software check exception` with cause code = 18. This patch implements software check exception. Additionally it implements a cfi violation handler which checks for code in xtval If xtval=2, it means that sw check

Re: [RFC PATCH v1 02/28] riscv: envcfg save and restore on trap entry/exit

2024-01-24 Thread Stefan O'Rear
On Thu, Jan 25, 2024, at 1:21 AM, de...@rivosinc.com wrote: > From: Deepak Gupta > > envcfg CSR defines enabling bits for cache management instructions and soon > will control enabling for control flow integrity and pointer masking features. > > Control flow integrity enabling for forward cfi and

[RFC PATCH v1 16/28] riscv/shstk: If needed allocate a new shadow stack on clone

2024-01-24 Thread debug
From: Deepak Gupta Userspace specifies VM_CLONE to share address space and spawn new thread. `clone` allow userspace to specify a new stack for new thread. However there is no way to specify new shadow stack base address without changing API. This patch allocates a new shadow stack whenever

[RFC PATCH v1 17/28] prctl: arch-agnostic prctl for shadow stack

2024-01-24 Thread debug
From: Mark Brown Three architectures (x86, aarch64, riscv) have announced support for shadow stacks with fairly similar functionality. While x86 is using arch_prctl() to control the functionality neither arm64 nor riscv uses that interface so this patch adds arch-agnostic prctl() support to get

[RFC PATCH v1 18/28] prctl: arch-agnostic prtcl for indirect branch tracking

2024-01-24 Thread debug
From: Deepak Gupta Three architectures (x86, aarch64, riscv) have support for indirect branch tracking feature in a very similar fashion. On a very high level, indirect branch tracking is a CPU feature where CPU tracks branches which uses memory operand to perform control transfer in program. As

[RFC PATCH v1 23/28] riscv signal: Save and restore of shadow stack for signal

2024-01-24 Thread debug
From: Deepak Gupta Save shadow stack pointer in sigcontext structure while delivering signal. Restore shadow stack pointer from sigcontext on sigreturn. Signed-off-by: Deepak Gupta --- arch/riscv/include/asm/usercfi.h | 18 arch/riscv/kernel/signal.c | 45

[RFC PATCH v1 24/28] riscv: select config for shadow stack and landing pad instr support

2024-01-24 Thread debug
From: Deepak Gupta This patch selects config shadow stack support and landing pad instr support. Shadow stack support and landing instr support is hidden behind `CONFIG_RISCV_USER_CFI`. Selecting `CONFIG_RISCV_USER_CFI` wires up path to enumerate CPU support and if cpu support exists, kernel

[RFC PATCH v1 25/28] riscv/ptrace: riscv cfi status and state via ptrace and in core files

2024-01-24 Thread debug
From: Deepak Gupta Expose a new register type NT_RISCV_USER_CFI for risc-v cfi status and state. Intentionally both landing pad and shadow stack status and state are rolled into cfi state. Creating two different NT_RISCV_USER_XXX would not be useful and wastage of a note type. Enabling or

[RFC PATCH v1 22/28] riscv sigcontext: adding cfi state field in sigcontext

2024-01-24 Thread debug
From: Deepak Gupta Shadow stack needs to be saved and restored on signal delivery and signal return. sigcontext embedded in ucontext is extendible. Adding cfi state in there which can be used to save cfi state before signal delivery and restore cfi state on sigreturn Signed-off-by: Deepak

[RFC PATCH v1 28/28] kselftest/riscv: kselftest for user mode cfi

2024-01-24 Thread debug
From: Deepak Gupta Adds kselftest for RISC-V control flow integrity implementation for user mode. There is not a lot going on in kernel for enabling landing pad for user mode. Thus kselftest simply enables landing pad for the binary and a signal handler is registered for SIGSEGV. Any control

[RFC PATCH v1 27/28] riscv: Documentation for shadow stack on riscv

2024-01-24 Thread debug
From: Deepak Gupta Adding documentation on shadow stack for user mode on riscv and kernel interfaces exposed so that user tasks can enable it. Signed-off-by: Deepak Gupta --- Documentation/arch/riscv/zicfiss.rst | 169 +++ 1 file changed, 169 insertions(+) create mode

[RFC PATCH v1 26/28] riscv: Documentation for landing pad / indirect branch tracking

2024-01-24 Thread debug
From: Deepak Gupta Adding documentation on landing pad aka indirect branch tracking on riscv and kernel interfaces exposed so that user tasks can enable it. Signed-off-by: Deepak Gupta --- Documentation/arch/riscv/zicfilp.rst | 104 +++ 1 file changed, 104

Re: pull-request: wireless-2024-01-22

2024-01-24 Thread David Gow
On Wed, 24 Jan 2024 at 02:22, Johannes Berg wrote: > > On Tue, 2024-01-23 at 19:19 +0100, Johannes Berg wrote: > > > > We're also adding unit tests to iwlwifi (slowly), any idea if we should > > enable that here also? It _is_ now possible to build PCI stuff on kunit, > > but it requires some

  1   2   >