Re: [PATCH v2] kunit: Introduce autorun option

2025-01-14 Thread David Gow
On Tue, 29 Oct 2024 at 05:54, Stanislav Kinsburskii wrote: > > The new option controls tests run on boot or module load. With the new > debugfs "run" dentry allowing to run tests on demand, an ability to disable > automatic tests run becomes a useful option in case of intrusive tests. > > The opti

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-14 Thread Danilo Krummrich
On Tue, Jan 14, 2025 at 05:33:45PM +0100, Danilo Krummrich wrote: > > > +impl Drop for Devres { > > > +fn drop(&mut self) { > > > +// Revoke the data, such that it gets dropped already and the > > > actual resource is freed. > > > +// > > > +// `DevresInner` has to stay

Re: [PATCH] selftests/mm/cow : Fix memory leak in child_vmsplice_memcmp_fn()

2025-01-14 Thread liuye
在 2025/1/14 18:23, David Hildenbrand 写道: On 14.01.25 03:29, liuye wrote: Release memory before exception branch returns to prevent memory leaks. Signed-off-by: liuye ---   tools/testing/selftests/mm/cow.c | 21 -   1 file changed, 16 insertions(+), 5 deletions(-) di

Re: [PATCH RFCv2 07/13] iommufd: Implement sw_msi support natively

2025-01-14 Thread Yury Norov
On Fri, Jan 10, 2025 at 07:32:23PM -0800, Nicolin Chen wrote: > From: Jason Gunthorpe > > iommufd has a model where the iommu_domain can be changed while the VFIO > device is attached. In this case the MSI should continue to work. This > corner case has not worked because the dma-iommu implementa

[PATCH net V2] selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()

2025-01-14 Thread Liu Ye
From: liuye From: Liu Ye Address Null pointer dereference in rtattr_pack. Flagged by cppcheck as: tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer dereference: payload [nullPointer] memcpy(RTA_DATA(attr), payload, size); ^ to

"WARNING in rcu_sr_normal_complete" in Linux Kernel v6.12-rc4

2025-01-14 Thread cheung wall
Hello, I am writing to report a potential vulnerability identified in the Linux Kernel version v6.12-rc4. This vulnerability was discovered while i was testing the kernel. Linux Kernel Repository Git Commit: 42f7652d3eb527d03665b09edac47f85fb600924 (tag: v6.12-rc4) Bug Location: 0010:rcu_sr_norm

Re: [PATCH for-next v2] selftests/Makefile: override the srctree for out-of-tree builds

2025-01-14 Thread Zhijian Li (Fujitsu)
Hi Andrii I am delighted to hear from you. I will rebase and resent it to bpf soon. On 15/01/2025 06:35, Andrii Nakryiko wrote: > On Mon, Dec 23, 2024 at 12:33 AM Li Zhijian wrote: >> Fixes an issue where out-of-tree kselftest builds fail when building >> the BPF and bpftools components. The fa

[PATCH bpf-next v3] selftests/Makefile: override the srctree for out-of-tree builds

2025-01-14 Thread Li Zhijian
Fixes an issue where out-of-tree kselftest builds fail when building the BPF and bpftools components. The failure occurs because the top-level Makefile passes a relative srctree path to its sub-Makefiles, which leads to errors in locating necessary files. For example, the following error is encoun

Re: [PATCH] selftests/rseq: Fix handling of glibc without rseq support

2025-01-14 Thread Mathieu Desnoyers
On 2025-01-14 19:14, Shuah Khan wrote: On 1/14/25 07:51, Mathieu Desnoyers wrote: When porting librseq commit: commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") from librseq to the kernel selftests, the following line was missed at the end of rseq_init():    rseq_size = get

Re: [PATCH net-next 1/1] selftests: drv-net-hw: inject pp_alloc_fail errors in the right place

2025-01-14 Thread Jakub Kicinski
On Tue, 14 Jan 2025 14:31:59 -0800 John Daley wrote: > The tool pp_alloc_fail.py tested error recovery by injecting errors > into the function page_pool_alloc_pages(). The page pool allocation > function page_pool_dev_alloc() does not end up calling > page_pool_alloc_pages(). page_pool_alloc_netmem

Re: [PATCH] selftests/rseq: Fix handling of glibc without rseq support

2025-01-14 Thread Shuah Khan
On 1/14/25 07:51, Mathieu Desnoyers wrote: When porting librseq commit: commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") from librseq to the kernel selftests, the following line was missed at the end of rseq_init(): rseq_size = get_rseq_kernel_feature_size(); which effe

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2025-01-14 Thread Shuah Khan
On 1/14/25 16:28, Reinette Chatre wrote: On 1/14/25 3:25 PM, Shuah Khan wrote: Thank you for bumping it up to top of my Inbox. I will apply these for 6.14-rc1 now. Thank you very much Shuah. Reinette Done. These two patches are now in linux-kselftest next. thanks, -- Shuah

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

2025-01-14 Thread Jeff Xu
On Tue, Jan 14, 2025 at 3:41 PM Jeff Xu wrote: > > On Tue, Jan 14, 2025 at 2:42 PM Isaac Manjarres > wrote: > > > > On Tue, Jan 14, 2025 at 01:29:44PM -0800, Kees Cook wrote: > > > On Tue, Jan 14, 2025 at 12:02:28PM -0800, Isaac Manjarres wrote: > > > Alternatively, MFD_NOEXEC_SEAL could be exten

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

2025-01-14 Thread Jeff Xu
On Tue, Jan 14, 2025 at 2:42 PM Isaac Manjarres wrote: > > On Tue, Jan 14, 2025 at 01:29:44PM -0800, Kees Cook wrote: > > On Tue, Jan 14, 2025 at 12:02:28PM -0800, Isaac Manjarres wrote: > Alternatively, MFD_NOEXEC_SEAL could be extended > to prevent executable mappings, and MEMFD_NOEXEC_SCOPE_NO

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2025-01-14 Thread Reinette Chatre
On 1/14/25 3:25 PM, Shuah Khan wrote: > > Thank you for bumping it up to top of my Inbox. > I will apply these for 6.14-rc1 now. > Thank you very much Shuah. Reinette

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2025-01-14 Thread Shuah Khan
On 1/14/25 15:30, Reinette Chatre wrote: Hi Shuah, On 12/19/24 10:35 AM, Reinette Chatre wrote: Hi Shuah, On 12/16/24 7:18 AM, Maciej Wieczor-Retman wrote: Sub-Numa Clustering (SNC) allows splitting CPU cores, caches and memory into multiple NUMA nodes. When enabled, NUMA-aware applications

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

2025-01-14 Thread Isaac Manjarres
On Tue, Jan 14, 2025 at 01:29:44PM -0800, Kees Cook wrote: > On Tue, Jan 14, 2025 at 12:02:28PM -0800, Isaac Manjarres wrote: > > I think the main issue in the threat model that I described is that > > an attacking process can gain control of a more priveleged process. > > I understood it to be ab

Re: [PATCH 2/3] libbpf: Remove powerpc prefix from syscall function names

2025-01-14 Thread Andrii Nakryiko
On Sat, Jan 11, 2025 at 11:53 AM Saket Kumar Bhaskar wrote: > > CCing Maddy and MPE > On Fri, Jan 10, 2025 at 02:29:42PM -0800, Andrii Nakryiko wrote: > > On Fri, Jan 10, 2025 at 2:49 AM Saket Kumar Bhaskar > > wrote: > > > > > > On Thu, Nov 21, 2024 at 04:00:13PM -0800, Andrii Nakryiko wrote: >

Re: Unaligned accesses when loading modules

2025-01-14 Thread Sami Tolvanen
Hi Mikulas, On Tue, Jan 14, 2025 at 6:07 PM Mikulas Patocka wrote: > > Hi > > On PA-RISC, with the kernel 6.12.9, I get unaligned pointer warnings when > a module is loaded. The warnings are caused by the fact that the > .gnu.linkonce.this_module section is not aligned to the appropriate > bounda

Re: [PATCH for-next v2] selftests/Makefile: override the srctree for out-of-tree builds

2025-01-14 Thread Andrii Nakryiko
On Mon, Dec 23, 2024 at 12:33 AM Li Zhijian wrote: > > Fixes an issue where out-of-tree kselftest builds fail when building > the BPF and bpftools components. The failure occurs because the top-level > Makefile passes a relative srctree path to its sub-Makefiles, which > leads to errors in locatin

[PATCH net-next 1/1] selftests: drv-net-hw: inject pp_alloc_fail errors in the right place

2025-01-14 Thread John Daley
The tool pp_alloc_fail.py tested error recovery by injecting errors into the function page_pool_alloc_pages(). The page pool allocation function page_pool_dev_alloc() does not end up calling page_pool_alloc_pages(). page_pool_alloc_netmems() seems to be the function that is called by all of the pag

[PATCH net-next 0/1] selftests: drv-net-hw: fix pp_alloc_fail test error

2025-01-14 Thread John Daley
The tool pp_alloc_fail.py tested error recovery by injecting errors into page_pool_alloc_pages(). Perhaps due to the netmems conversion, page_pool_put_full_page() does not end up calling that function. page_pool_alloc_netmems() seems to be the base function for all the the allocation functions in

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2025-01-14 Thread Reinette Chatre
Hi Shuah, On 12/19/24 10:35 AM, Reinette Chatre wrote: > Hi Shuah, > > On 12/16/24 7:18 AM, Maciej Wieczor-Retman wrote: >> >> Sub-Numa Clustering (SNC) allows splitting CPU cores, caches and memory >> into multiple NUMA nodes. When enabled, NUMA-aware applications can >> achieve better performan

Re: [PATCH net 0/3] mptcp: fixes for connect selftest flakes

2025-01-14 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Jakub Kicinski : On Mon, 13 Jan 2025 16:44:55 +0100 you wrote: > Last week, Jakub reported [1] that the MPTCP Connect selftest was > unstable. It looked like it started after the introduction of some fixes > [2]. After analysis from Paolo

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

2025-01-14 Thread Kees Cook
On Tue, Jan 14, 2025 at 12:02:28PM -0800, Isaac Manjarres wrote: > I think the main issue in the threat model that I described is that > an attacking process can gain control of a more priveleged process. I understood it to be about an attacker gaining execution control through a rewritten functio

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2025-01-14 Thread Celeste Liu
On 2025-01-10 11:34, Charlie Jenkins wrote: > On Thu, Dec 26, 2024 at 11:21:59PM +0800, Celeste Liu wrote: >> >> On 2024-12-26 21:35, Dmitry V. Levin wrote: >>> On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: This test checks that orig_a0 allows a syscall argument to be modified,

[PATCH bpf-next v7 5/5] bpf: selftests: verifier: Add nullness elision tests

2025-01-14 Thread Daniel Xu
Test that nullness elision works for common use cases. For example, we want to check that both constant scalar spills and STACK_ZERO functions. As well as when there's both const and non-const values of R2 leading up to a lookup. And obviously some bound checks. Particularly tricky are spills both

[PATCH bpf-next v7 3/5] bpf: verifier: Refactor helper access type tracking

2025-01-14 Thread Daniel Xu
Previously, the verifier was treating all PTR_TO_STACK registers passed to a helper call as potentially written to by the helper. However, all calls to check_stack_range_initialized() already have precise access type information available. Rather than treat ACCESS_HELPER as a proxy for BPF_WRITE,

[PATCH bpf-next v7 4/5] bpf: verifier: Support eliding map lookup nullness

2025-01-14 Thread Daniel Xu
This commit allows progs to elide a null check on statically known map lookup keys. In other words, if the verifier can statically prove that the lookup will be in-bounds, allow the prog to drop the null check. This is useful for two reasons: 1. Large numbers of nullness checks (especially when t

[PATCH bpf-next v7 0/5] Support eliding map lookup nullness

2025-01-14 Thread Daniel Xu
This patch allows progs to elide a null check on statically known map lookup keys. In other words, if the verifier can statically prove that the lookup will be in-bounds, allow the prog to drop the null check. This is useful for two reasons: 1. Large numbers of nullness checks (especially when th

[PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-14 Thread Celeste Liu
This test checks that orig_a0 and a0 can be modified and accessed independently. Co-developed-by: Quan Zhou Signed-off-by: Quan Zhou Co-developed-by: Charlie Jenkins Signed-off-by: Charlie Jenkins Reviewed-by: Björn Töpel Signed-off-by: Celeste Liu --- tools/testing/selftests/riscv/abi/.git

[PATCH v5 1/2] riscv/ptrace: add new regset to access original a0 register

2025-01-14 Thread Celeste Liu
The orig_a0 is missing in struct user_regs_struct of riscv, and there is no way to add it without breaking UAPI. (See Link tag below) Like NT_ARM_SYSTEM_CALL do, we add a new regset name NT_RISCV_ORIG_A0 to access original a0 register from userspace via ptrace API. Fixes: e2c0cdfba7f6 ("RISC-V: U

[PATCH v5 0/2] riscv/ptrace: add new regset to access original a0 register

2025-01-14 Thread Celeste Liu
The orig_a0 is missing in struct user_regs_struct of riscv, and there is no way to add it without breaking UAPI. (See Link tag below) Like NT_ARM_SYSTEM_CALL do, we add a new regset name NT_RISCV_ORIG_A0 to access original a0 register from userspace via ptrace API. Link: https://lore.kernel.org/

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

2025-01-14 Thread Isaac Manjarres
On Thu, Jan 09, 2025 at 03:30:36PM -0800, Jeff Xu wrote: > On Wed, Jan 8, 2025 at 11:06 AM 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

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Paul E. McKenney
On Tue, Jan 14, 2025 at 08:13:37PM +0800, Chen Ridong wrote: > > > On 2025/1/14 17:20, Vlastimil Babka wrote: > > On 1/14/25 09:40, Michal Hocko wrote: > >> On Mon 13-01-25 19:45:46, Andrew Morton wrote: > >>> On Mon, 13 Jan 2025 14:51:55 +0800 Chen Ridong > >>> wrote: > >>> > >> @@ -430,10

[PATCH net-next 4/6] selftests: mptcp: add -m with ss in case of errors

2025-01-14 Thread Matthieu Baerts (NGI0)
Recently, we had an issue where getting info about the memory would have helped better understanding what went wrong. Let add it just in case for later. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 ++-- 1 file changed,

Re: [PATCH 0/3] selftests: mptcp: Fix various issues in main_loop

2025-01-14 Thread Matthieu Baerts
Hi Cong Liu, On 13/01/2025 09:52, Cong Liu wrote: > Fix several issues in the mptcp connect test's main_loop function. > > - Fix a bug where the wrong file descriptor was being checked for errors > - Fix the input file descriptor lifecycle in the reconnection loop to >prevent use of invalid

Unaligned accesses when loading modules

2025-01-14 Thread Mikulas Patocka
Hi On PA-RISC, with the kernel 6.12.9, I get unaligned pointer warnings when a module is loaded. The warnings are caused by the fact that the .gnu.linkonce.this_module section is not aligned to the appropriate boundary. If I dump the module content with "objdump -h configs.ko", I get this. Not

[PATCH net-next 6/6] selftests: mptcp: connect: better display the files size

2025-01-14 Thread Matthieu Baerts (NGI0)
'du' will print the name of the file, which was already displayed before, e.g. Created /tmp/tmp.UOyy0ghfmQ (size 4703740/tmp/tmp.UOyy0ghfmQ) containing data sent by client Created /tmp/tmp.xq3zvFinGo (size 1391724/tmp/tmp.xq3zvFinGo) containing data sent by server 'stat' can be used instead

[PATCH net-next 5/6] selftests: mptcp: connect: remove unused variable

2025-01-14 Thread Matthieu Baerts (NGI0)
'cin_disconnect' is used in run_tests_disconnect(), but not 'cout_disconnect', so it is safe to drop it. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/t

[PATCH net-next 3/6] selftests: mptcp: move stats info in case of errors to lib.sh

2025-01-14 Thread Matthieu Baerts (NGI0)
A few MPTCP selftests are using the same code to print stats in case of error. This code can then be moved to mptcp_lib.sh. No behaviour changes intended, except to print the error in red and to stderr, like most error messages. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --

[PATCH net-next 2/6] selftests: mptcp: sockopt: save nstat infos

2025-01-14 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Similar to the way nstat information is stored in mptcp_connect.sh and mptcp_join.sh scripts, this patch adds a similar way for mptcp_sockopt.sh and displays the nstat information when errors occur. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-b

[PATCH net-next 1/6] selftests: mptcp: simult_flows: unify errors msgs

2025-01-14 Thread Matthieu Baerts (NGI0)
In order to unify what is printed in case of error, similar to what is done in mptcp_connect.sh and mptcp_join.sh, it is interesting to do the following modifications in simult_flows.sh: - Print the rc errors at the end of the line. - Print the MIB counters. - Use the same ss options: add -M (MP

[PATCH net-next 0/6] mptcp: selftests: more debug in case of errors

2025-01-14 Thread Matthieu Baerts (NGI0)
ests/net/mptcp/simult_flows.sh | 21 ++--- 5 files changed, 53 insertions(+), 28 deletions(-) --- base-commit: 9c7ad35632297edc08d0f2c7b599137e9fb5f9ff change-id: 20250114-net-next-mptcp-st-more-debug-err-3f3f1aa15a10 Best regards, -- Matthieu Baerts (NGI0)

Re: [PATCH] vhost/scsi: Fix improper cleanup in vhost_scsi_set_endpoint()

2025-01-14 Thread Mike Christie
On 1/14/25 1:40 AM, 张浩然 wrote: > After reevaluating the PoC, I realized that my initial claim was incorrect. > The target WWN in the second vhost_scsi_set_endpoint() call is not the same > as in the first one. Below is my targetcli status: > > o- vhost . [

Re: [PATCH 3/3] rseq/selftests: Add support for OpenRISC

2025-01-14 Thread Stafford Horne
On Mon, Jan 13, 2025 at 03:58:31PM -0700, Shuah Khan wrote: > On 1/10/25 09:16, Mathieu Desnoyers wrote: > > On 2025-01-10 05:22, Stafford Horne wrote: > > > Add support for OpenRISC in the rseq selftests.  OpenRISC is 32-bit > > > only. > > > > > > Tested this with: > > > > > > Compiler:  g

Re: [PATCH v2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-14 Thread Marcos Paulo de Souza
On Sat, 2025-01-11 at 15:42 -0300, Filipe Xavier wrote: > This new test makes sure that ftrace can trace a > function that was introduced by a livepatch. > > Signed-off-by: Filipe Xavier Thanks for the new test Filipe! I have some nits below, but these don't need to be addressed for the test to

Re: [PATCH] vhost/scsi: Fix improper cleanup in vhost_scsi_set_endpoint()

2025-01-14 Thread Mike Christie
On 1/14/25 5:26 AM, Michael S. Tsirkin wrote: > > Wanna post the patch, Mike? > Yeah, I'll send a patch.

[PATCH v2] rseq/selftests: Fix riscv rseq_offset_deref_addv inline asm

2025-01-14 Thread Stafford Horne
When working on OpenRISC support for restartable sequences I noticed and fixed these two issues with the riscv support bits. 1 The 'inc' argument to RSEQ_ASM_OP_R_DEREF_ADDV was being implicitly passed to the macro. Fix this by adding 'inc' to the list of macro arguments. 2 The inline asm

Re: [PATCH] rseq/selftests: Fix riscv rseq_offset_deref_addv inline asm

2025-01-14 Thread Stafford Horne
On Mon, Jan 13, 2025 at 03:59:24PM -0700, Shuah Khan wrote: > On 1/10/25 09:22, Mathieu Desnoyers wrote: > > On 2025-01-02 23:03, Stafford Horne wrote: > > > When working on OpenRISC support for restartable sequences I noticed > > > and fixed these two issues with the riscv support bits. > > > > >

Re: [PATCH v4 4/4] selftests/mm: virtual_address_range: Avoid reading from VM_IO mappings

2025-01-14 Thread David Hildenbrand
On 14.01.25 17:06, Thomas Weißschuh wrote: The virtual_address_range selftest reads from the start of each mapping listed in /proc/self/maps. However not all mappings are valid to be arbitrarily accessed. For example the vvar data used for virtual clocks on x86 [vvar_vclock] can only be accessed

Re: [PATCH v4 0/4] selftests/mm: virtual_address_range: Reduce memory usage and avoid VM_IO access

2025-01-14 Thread David Hildenbrand
On 14.01.25 17:06, Thomas Weißschuh wrote: The selftest started failing since commit e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping") was merged. While debugging I stumbled upon some memory usage optimizations. With these test now runs on a VM with only 60MiB of memory

Re: [PATCH v7 08/16] rust: add devres abstraction

2025-01-14 Thread Danilo Krummrich
On Tue, Dec 24, 2024 at 09:53:23PM +, Gary Guo wrote: > On Thu, 19 Dec 2024 18:04:10 +0100 > Danilo Krummrich wrote: > > > Add a Rust abstraction for the kernel's devres (device resource > > management) implementation. > > > > The Devres type acts as a container to manage the lifetime and >

Re: [PATCH net v2 1/5] vsock/virtio: discard packets if the transport changes

2025-01-14 Thread Michal Luczaj
On 1/14/25 11:16, Stefano Garzarella wrote: > On Tue, Jan 14, 2025 at 01:09:24AM +0100, Michal Luczaj wrote: >> On 1/13/25 16:01, Stefano Garzarella wrote: >>> On Mon, Jan 13, 2025 at 02:51:58PM +0100, Michal Luczaj wrote: On 1/13/25 12:05, Stefano Garzarella wrote: > ... > An alternat

Re: [PATCH] selftests/rseq: Fix rseq for cases without glibc support

2025-01-14 Thread Shuah Khan
On 1/14/25 07:27, Mathieu Desnoyers wrote: On 2025-01-14 09:07, Mathieu Desnoyers wrote: On 2025-01-13 18:06, Shuah Khan wrote: On 12/10/24 15:44, Raghavendra Rao Ananta wrote: Currently the rseq constructor, rseq_init(), assumes that glibc always has the support for rseq symbols (__rseq_size

[PATCH v4 4/4] selftests/mm: virtual_address_range: Avoid reading from VM_IO mappings

2025-01-14 Thread Thomas Weißschuh
The virtual_address_range selftest reads from the start of each mapping listed in /proc/self/maps. However not all mappings are valid to be arbitrarily accessed. For example the vvar data used for virtual clocks on x86 [vvar_vclock] can only be accessed if 1) the kernel configuration enables virtu

[PATCH v4 3/4] selftests/mm: vm_util: Split up /proc/self/smaps parsing

2025-01-14 Thread Thomas Weißschuh
Upcoming changes want to reuse the /proc/self/smaps parsing logic to parse the VmFlags field. As that works differently from the currently parsed HugePage counters, split up the logic so common functionality can be shared. While reworking this code, also use the correct sscanf placeholder for the

[PATCH v4 1/4] selftests/mm: virtual_address_range: mmap() without PROT_WRITE

2025-01-14 Thread Thomas Weißschuh
When mapping a larger chunk than physical memory is available with PROT_WRITE and overcommit is disabled, the mapping will fail. This will prevent the test from running on systems with less then ~1GiB of memory and triggering an inscrutinable test failure. As the mappings are never written to anywa

[PATCH v4 0/4] selftests/mm: virtual_address_range: Reduce memory usage and avoid VM_IO access

2025-01-14 Thread Thomas Weißschuh
The selftest started failing since commit e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping") was merged. While debugging I stumbled upon some memory usage optimizations. With these test now runs on a VM with only 60MiB of memory. Signed-off-by: Thomas Weißschuh --- Chang

[PATCH v4 2/4] selftests/mm: virtual_address_range: Unmap chunks after validation

2025-01-14 Thread Thomas Weißschuh
For each accessed chunk a PTE is created. More than 1GiB of PTEs is used in this way. Remove each PTE after validating a chunk to reduce peak memory usage. It is important to only unmap memory that previously mmap()ed, as unmapping other mappings like the stack, heap or executable mappings will cr

Re: [PATCH] selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()

2025-01-14 Thread Simon Horman
On Tue, Jan 14, 2025 at 03:43:29PM +0800, liuye wrote: > Fix the following warning. I think it is a bit more than a warning, I'd phrase this more like, even as it repeats the subject. Also, it would be nice to cite the tool that generates the warning. Address Null pointer dereference in rtatt

Re: [syzbot] [net?] [virt?] general protection fault in vsock_stream_has_data

2025-01-14 Thread syzbot
Hello, syzbot has tested the proposed patch and the reproducer did not trigger any issue: Reported-by: syzbot+71613b464c8ef17ab...@syzkaller.appspotmail.com Tested-by: syzbot+71613b464c8ef17ab...@syzkaller.appspotmail.com Tested on: commit: 665bcfc9 Merge branch 'vsock-some-fixes-due-t

[PATCH] selftests/rseq: Fix handling of glibc without rseq support

2025-01-14 Thread Mathieu Desnoyers
When porting librseq commit: commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") from librseq to the kernel selftests, the following line was missed at the end of rseq_init(): rseq_size = get_rseq_kernel_feature_size(); which effectively leaves rseq_size initialized to -1U wh

Re: [syzbot] [net?] [virt?] general protection fault in vsock_stream_has_data

2025-01-14 Thread Stefano Garzarella
On Tue, Jan 14, 2025 at 06:48:23AM -0800, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:25cc469d6d34 net: phy: micrel: use helper phy_disable_eee git tree: net-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=15faeef858 kernel config: https:/

[syzbot] [net?] [virt?] general protection fault in vsock_stream_has_data

2025-01-14 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:25cc469d6d34 net: phy: micrel: use helper phy_disable_eee git tree: net-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=15faeef858 kernel config: https://syzkaller.appspot.com/x/.config?x=d50f1d63eac02308 dashbo

Re: [PATCH] selftests/rseq: Fix rseq for cases without glibc support

2025-01-14 Thread Mathieu Desnoyers
On 2025-01-14 09:07, Mathieu Desnoyers wrote: On 2025-01-13 18:06, Shuah Khan wrote: On 12/10/24 15:44, Raghavendra Rao Ananta wrote: Currently the rseq constructor, rseq_init(), assumes that glibc always has the support for rseq symbols (__rseq_size for instance). However, glibc supports rseq

Re: [PATCH] selftests/rseq: Fix rseq for cases without glibc support

2025-01-14 Thread Mathieu Desnoyers
On 2025-01-13 18:06, Shuah Khan wrote: On 12/10/24 15:44, Raghavendra Rao Ananta wrote: Currently the rseq constructor, rseq_init(), assumes that glibc always has the support for rseq symbols (__rseq_size for instance). However, glibc supports rseq from version 2.35 onwards. As a result, for the

Re: [PATCH v3 2/4] selftests/mm: virtual_address_range: Unmap chunks after validation

2025-01-14 Thread David Hildenbrand
On 13.01.25 14:15, Thomas Weißschuh wrote: For each accessed chunk a PTE is created. More than 1GiB of PTEs is used in this way. Remove each PTE after validating a chunk to reduce peak memory usage. It is important to only unmap memory that previously mmap()ed, as unmapping other mappings like t

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Chen Ridong
On 2025/1/14 17:30, Michal Hocko wrote: > On Tue 14-01-25 10:20:28, Vlastimil Babka wrote: >> On 1/14/25 09:40, Michal Hocko wrote: >>> On Mon 13-01-25 19:45:46, Andrew Morton wrote: > [...] > For global OOM, system is likely to struggle, do we have to do some > works to suppress RCU det

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Chen Ridong
On 2025/1/14 17:20, Vlastimil Babka wrote: > On 1/14/25 09:40, Michal Hocko wrote: >> On Mon 13-01-25 19:45:46, Andrew Morton wrote: >>> On Mon, 13 Jan 2025 14:51:55 +0800 Chen Ridong >>> wrote: >>> >> @@ -430,10 +431,15 @@ static void dump_tasks(struct oom_control *oc) >>

Re: [PATCH net v2 0/5] vsock: some fixes due to transport de-assignment

2025-01-14 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Paolo Abeni : On Fri, 10 Jan 2025 09:35:06 +0100 you wrote: > v1: > https://lore.kernel.org/netdev/20250108180617.154053-1-sgarz...@redhat.com/ > v2: > - Added patch 3 to cancel the virtio close delayed work when de-assigning > the tra

Re: [PATCH] vhost/scsi: Fix improper cleanup in vhost_scsi_set_endpoint()

2025-01-14 Thread Michael S. Tsirkin
On Sun, Jan 12, 2025 at 03:19:44PM -0600, Mike Christie wrote: > On 1/12/25 11:35 AM, michael.chris...@oracle.com wrote: > > So I think to fix the issue, we would want to: > > > > 1. move the > > > > memcpy(vs_tpg, vs->vs_tpg, len); > > > > to the end of the function after we do the vhost_scsi_f

Re: [PATCH] selftests/memfd/memfd_test: Fix possible NULL pointer dereference

2025-01-14 Thread Lorenzo Stoakes
On Tue, Jan 14, 2025 at 11:21:15AM +0800, liuye wrote: > If name is NULL, a NULL pointer may be accessed in printf. > > Signed-off-by: liuye Reviewed-by: Lorenzo Stoakes > --- > tools/testing/selftests/memfd/memfd_test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --gi

[PATCH] srcu: refactor __srcu_read_(un)lock_lite() declarations

2025-01-14 Thread Masahiro Yamada
For CONFIG_TREE_SRCU, __srcu_read_(un)lock_lite() are defined as static inline functions in . The later function declarations are redundant. Signed-off-by: Masahiro Yamada --- include/linux/srcu.h | 9 ++--- include/linux/srcutree.h | 4 ++-- 2 files changed, 4 insertions(+), 9 deletion

Re: [PATCH] selftests/mm/cow : Fix memory leak in child_vmsplice_memcmp_fn()

2025-01-14 Thread David Hildenbrand
On 14.01.25 03:29, liuye wrote: Release memory before exception branch returns to prevent memory leaks. Signed-off-by: liuye --- tools/testing/selftests/mm/cow.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b

Re: [PATCH] selftests/mm/mkdirty: Fix memory leak in test_uffdio_copy()

2025-01-14 Thread David Hildenbrand
On 14.01.25 03:38, liuye wrote: Release memory before exception branch returns to prevent memory leaks Checking tools/testing/selftests/mm/mkdirty.c ... tools/testing/selftests/mm/mkdirty.c:283:3: error: Memory leak: src [memleak] return; ^ Don't take this the wrong way: there must

Re: [PATCH net v2 1/5] vsock/virtio: discard packets if the transport changes

2025-01-14 Thread Stefano Garzarella
On Tue, Jan 14, 2025 at 01:09:24AM +0100, Michal Luczaj wrote: On 1/13/25 16:01, Stefano Garzarella wrote: On Mon, Jan 13, 2025 at 02:51:58PM +0100, Michal Luczaj wrote: On 1/13/25 12:05, Stefano Garzarella wrote: ... An alternative approach, which would perhaps allow us to avoid all this, is

Re: [PATCH v3 4/4] selftests/mm: virtual_address_range: Avoid reading from VM_IO mappings

2025-01-14 Thread David Hildenbrand
On 13.01.25 14:15, Thomas Weißschuh wrote: The virtual_address_range selftest reads from the start of each mapping listed in /proc/self/maps. However not all mappings are valid to be arbitrarily accessed. For example the vvar data used for virtual clocks on x86 [vvar_vclock] can only be accessed

Re: [PATCH v3 3/4] selftests/mm: vm_util: Split up /proc/self/smaps parsing

2025-01-14 Thread David Hildenbrand
On 13.01.25 14:15, Thomas Weißschuh wrote: Upcoming changes want to reuse the /proc/self/smaps parsing logic to parse the VmFlags field. As that works differently from the currently parsed HugePage counters, split up the logic so common functionality can be shared. While reworking this code, als

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Michal Hocko
On Tue 14-01-25 10:20:28, Vlastimil Babka wrote: > On 1/14/25 09:40, Michal Hocko wrote: > > On Mon 13-01-25 19:45:46, Andrew Morton wrote: [...] > >> > For global OOM, system is likely to struggle, do we have to do some > >> > works to suppress RCU detete? > >> > >> rcu_cpu_stall_reset()? > > >

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Vlastimil Babka
On 1/14/25 09:40, Michal Hocko wrote: > On Mon 13-01-25 19:45:46, Andrew Morton wrote: >> On Mon, 13 Jan 2025 14:51:55 +0800 Chen Ridong >> wrote: >> >> > >> @@ -430,10 +431,15 @@ static void dump_tasks(struct oom_control *oc) >> > >> mem_cgroup_scan_tasks(oc->memcg, dump_task, o

[PATCH 0/2] get_maintainer: report subsystem status separately from maintainer role

2025-01-14 Thread Vlastimil Babka
t_maintainer: decouple subsystem status from maintainer role get_maintainer: print subsystem status also for reviewers and lists scripts/get_maintainer.pl | 68 ++- 1 file changed, 38 insertions(+), 30 deletions(-) --- base-commit: 40384c84

[PATCH 2/2] get_maintainer: print subsystem status also for reviewers and lists

2025-01-14 Thread Vlastimil Babka
When reporting maintainers, the subsystem information includes its status (S: entry from MAINTAINERS) whenever it's not the most common one (Maintained). However this status information is missing for reviewers and especially for mailing lists, which may be often the only kind of e-mail address rep

[PATCH 1/2] get_maintainer: decouple subsystem status from maintainer role

2025-01-14 Thread Vlastimil Babka
The script currently uses the subystem's status (S: field in MAINTAINERS) to change how maintainers are reported. One prominent example is when the status is Supported, the maintainers are reported as "(supporter:SUBSYSTEM)". This is misleading, as the Supported status defined as "Someone is actua

[syzbot] Monthly virt report (Jan 2025)

2025-01-14 Thread syzbot
Hello virt maintainers/developers, This is a 31-day syzbot report for the virt subsystem. All related reports/information can be found at: https://syzkaller.appspot.com/upstream/s/virt During the period, 1 new issues were detected and 0 were fixed. In total, 8 issues are still open and 45 have al

Re: Re: [PATCH] vhost/scsi: Fix improper cleanup in vhost_scsi_set_endpoint()

2025-01-14 Thread 张浩然
Yes, and it also protects the kernel from the PoC, as I've tested. On 2025-01-14 10:17:50 Lei Yang wrote: > I tested this patch with virtio-net regression tests, everything works fine. > > Tested-by: Lei Yang > > > On Mon, Jan 13, 2025 at 5:20 AM Mike Christie > wrote: > > > > On 1/12/25 11:3

Re: [PATCH v3] memcg: fix soft lockup in the OOM process

2025-01-14 Thread Michal Hocko
On Mon 13-01-25 19:45:46, Andrew Morton wrote: > On Mon, 13 Jan 2025 14:51:55 +0800 Chen Ridong > wrote: > > > > > > > On 2025/1/6 16:45, Vlastimil Babka wrote: > > > On 12/24/24 03:52, Chen Ridong wrote: > > >> From: Chen Ridong > > > > > > +CC RCU > > > > > >> A soft lockup issue was foun

[PATCH] selftests/x86/lam: Fix Memory leak fi in do_uring

2025-01-14 Thread liuye
Exception branch returns without free fi. Signed-off-by: liuye --- tools/testing/selftests/x86/lam.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/x86/lam.c b/tools/testing/selftests/x86/lam.c index 0ea4f6813930..74f422e76dce 100644 --- a/tool

[PATCH] selftests/timens/procfs: Fix Resource leak proc in read_proc_uptime

2025-01-14 Thread liuye
Exception branch returns without closing proc. Signed-off-by: liuye --- tools/testing/selftests/timens/procfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/timens/procfs.c b/tools/testing/selftests/timens/procfs.c index 1833ca97eb24..e47844a73c31 100644 ---

[PATCH] selftests/prctl/set-process-name: Fix Resource leak fptr in check_name

2025-01-14 Thread liuye
Exception branch returns without closing fptr. Signed-off-by: liuye --- tools/testing/selftests/prctl/set-process-name.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/prctl/set-process-name.c b/tools/testing/selftests/prctl/set-process