Re: [PATCH v2] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Markus Elfring
>… openat() and open() initialize > 'from' and 'to', and only 'from' validated with 'if' statement. Why do you find such information helpful? > If the > initialization of variable 'to' fails,

[PATCH] selftests/bpf:fix a resource leak

2024-06-26 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testi

selftests/ftrace kprobe_eventname test fails on s390x QEMU (KVM/Linux)

2024-06-26 Thread Yunseong Kim
Hi all, In my s390x archtecture, kprobe_eventname selftest have always failed because of rcu_sched stalls. My environment is QEMU Ubuntu 24.04 KVM Machine Linux version 6.8.0-36-generic (buildd@bos01-s390x-012) (s390x-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ub

[PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Dev Jain
This test asserts the relation between blocked signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block the corresponding signal. In the test description, I have also described signal delivery and blockag

[PATCH v4 1/2] selftests: Rename sigaltstack to generic signal

2024-06-26 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/testing/selftest

[PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-26 Thread Dev Jain
This patch series is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask of blocked signals. If you run a fresh minimalistic program doing this, this field is empty, even if yo

[PATCH] selftests/bpf:Delete extra blank Lines

2024-06-26 Thread Zhu Jun
Delete extra blank lines inside of test_selftest() Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 92752f5eeded..a34e95040994 10

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

2024-06-26 Thread zhouquan
From: Quan Zhou This test checks that orig_a0 allows a syscall argument to be modified, and that changing a0 does not change the syscall argument. Suggested-by: Charlie Jenkins Signed-off-by: Quan Zhou --- tools/testing/selftests/riscv/Makefile | 2 +- tools/testing/selftests/riscv/ab

[PATCH v1 1/2] riscv: Expose orig_a0 in the user_regs_struct structure

2024-06-26 Thread zhouquan
From: Quan Zhou Expose orig_a0 to userspace to ensure that users can modify the actual value of `a0` in the traced process through the ptrace(PTRACE_SETREGSET, ...) path. The addition of orig_a0 also requires the following adjustments: 1) Adjust the position of orig_a0 in pt_regs to ensure corre

[PATCH v1 0/2] riscv: Expose orig_a0 to userspace for ptrace to set the actual a0

2024-06-26 Thread zhouquan
From: Quan Zhou Due to the path that modifies a0 in syscall_enter_from_user_mode before the actual execution of syscall_handler [1], the kernel currently saves a0 to orig_a0 at the entry point of do_trap_ecall_u as an original copy of a0. Once the syscall is interrupted and later resumed, the res

[PATCH v2] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Ma Ke
The open() function returns -1 on error. openat() and open() initialize 'from' and 'to', and only 'from' validated with 'if' statement. If the initialization of variable 'to' fails, we should better check the value of 'to' and close 'from' to avoid possible file leak. Improve the checking of 'from'

Re: [PATCH net-next v14 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-26 Thread Jakub Kicinski
On Wed, 26 Jun 2024 15:08:22 -0700 Jakub Kicinski wrote: > On Tue, 25 Jun 2024 19:54:01 + Mina Almasry wrote: > > +CFLAGS += -I../../../net/ynl/generated/ > > +CFLAGS += -I../../../net/ynl/lib/ > > + > > +LDLIBS += ../../../net/ynl/lib/ynl.a ../../../net/ynl/generated/protos.a > > Not as eas

Re: [PATCH] selftests/bpf: improve file descriptor closure handling

2024-06-26 Thread Andrii Nakryiko
On Wed, Jun 26, 2024 at 5:19 AM Ma Ke wrote: > > serial_test_fexit_stress() has a non-robust handling of file descriptor > closure. If an error occurs, the function may exit without closing open > file descriptors, potentially causing resource leaks. > > Fix the issue by closing file descriptors i

Re: [PATCH] selftests/bpf: don't close(-1) in serial_test_fexit_stress()

2024-06-26 Thread Andrii Nakryiko
On Sun, Jun 23, 2024 at 6:18 AM Ma Ke wrote: > > Guard close() with extra link_fd[i] >= 0 and fexit_fd[i] >= 0 > check to prevent close(-1). > > Signed-off-by: Ma Ke > --- > tools/testing/selftests/bpf/prog_tests/fexit_stress.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff

Re: [PATCH] selftests/bpf: don't close(-1) in serial_test_fexit_stress()

2024-06-26 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko : On Sun, 23 Jun 2024 21:17:53 +0800 you wrote: > Guard close() with extra link_fd[i] >= 0 and fexit_fd[i] >= 0 > check to prevent close(-1). > > Signed-off-by: Ma Ke > --- > tools/testing/selftests/bpf/prog_tests/fe

Re: [PATCH] selftest: acct: Add selftest for the acct() syscall

2024-06-26 Thread Shuah Khan
On 6/22/24 11:24, Abdulrasaq Lawani wrote: Noticed that there was no selftest for the acct() syscall which enables the kernel to record terminated processes into a specified file. This patch provides a test for the acct() syscall. Describe the functionality being tested. Add testcases to test

Re: [PATCH net-next v14 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-26 Thread Jakub Kicinski
On Tue, 25 Jun 2024 19:54:01 + Mina Almasry wrote: > +CFLAGS += -I../../../net/ynl/generated/ > +CFLAGS += -I../../../net/ynl/lib/ > + > +LDLIBS += ../../../net/ynl/lib/ynl.a ../../../net/ynl/generated/protos.a Not as easy as this.. Please add this commit to your series: https://github.com/kub

Re: [PATCH v3] selftests/resctrl: Fix non-contiguous CBM for AMD

2024-06-26 Thread Reinette Chatre
On 6/26/24 12:25 PM, Shuah Khan wrote: Applied to linux-kselftest fixes branch for 6.10-rc6 Thank you very much Shuah. Reinette

Re: [PATCH] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Shuah Khan
On 6/26/24 13:33, Shuah Khan wrote: On 6/26/24 01:20, Ma Ke wrote: The open() function returns -1 on error. openat() and open() initialize 'from' and 'to', and only 'from' validated with 'if' statement. If the initialization of variable 'to' fails, we should better check the value of 'to' and cl

Re: [PATCH] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Shuah Khan
On 6/26/24 01:20, Ma Ke wrote: The open() function returns -1 on error. openat() and open() initialize 'from' and 'to', and only 'from' validated with 'if' statement. If the initialization of variable 'to' fails, we should better check the value of 'to' and close 'from' to avoid possible file lea

Re: [PATCH v3] selftests/resctrl: Fix non-contiguous CBM for AMD

2024-06-26 Thread Shuah Khan
On 6/26/24 10:55, Reinette Chatre wrote: Hi Shuah, Could you please consider this fix for inclusion into kselftests? Thank you very much. Reinette On 6/11/24 3:18 PM, Babu Moger wrote: The non-contiguous CBM test fails on AMD with: Starting L3_NONCONT_CAT test ... Mounting resctrl to "/sys/f

Re: [PATCH v3] selftests/resctrl: Fix non-contiguous CBM for AMD

2024-06-26 Thread Reinette Chatre
Hi Shuah, Could you please consider this fix for inclusion into kselftests? Thank you very much. Reinette On 6/11/24 3:18 PM, Babu Moger wrote: The non-contiguous CBM test fails on AMD with: Starting L3_NONCONT_CAT test ... Mounting resctrl to "/sys/fs/resctrl" CPUID output doesn't match 'spa

Re: [PATCH net-next v3 4/7] selftests: openvswitch: Add support for tunnel() key.

2024-06-26 Thread Simon Horman
On Tue, Jun 25, 2024 at 01:22:42PM -0400, Aaron Conole wrote: > This will be used when setting details about the tunnel to use as > transport. There is a difference between the ODP format between tunnel(): > the 'key' flag is not actually a flag field, so we don't support it in the > same way that

Re: [PATCH net-next v3 6/7] selftests: net: Use the provided dpctl rather than the vswitchd for tests.

2024-06-26 Thread Simon Horman
On Tue, Jun 25, 2024 at 01:22:44PM -0400, Aaron Conole wrote: > The current pmtu test infrastucture requires an installed copy of the > ovs-vswitchd userspace. This means that any automated or constrained > environments may not have the requisite tools to run the tests. However, > the pmtu tests

Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-06-26 Thread Reinette Chatre
Hi Maciej, On 6/26/24 12:09 AM, Maciej Wieczor-Retman wrote: Hello!, On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote: Hi Maciej, On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote: Hello, sorry it took me so long to get back to this. I prepared the next version with your comments applied

Re: [PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Mark Brown
On Wed, Jun 26, 2024 at 11:18:47AM +0530, Dev Jain wrote: > This test asserts the relation between blocked signal, delivered signal, > and ucontext. The ucontext is mangled with, by adding a signal mask to > it; on return from the handler, the thread must block the corresponding > signal. This loo

Re: [PATCH HID v2 04/13] HID: bpf: add HID-BPF hooks for hid_hw_raw_requests

2024-06-26 Thread Alexei Starovoitov
On Wed, Jun 26, 2024 at 6:46 AM Benjamin Tissoires wrote: > > This allows to intercept and prevent or change the behavior of > hid_hw_raw_request() from a bpf program. > > The intent is to solve a couple of use case: > - firewalling a HID device: a firewall can monitor who opens the hidraw > nod

Re: [PATCH] selftests/alsa:Fix printf format string in pcm-test.c

2024-06-26 Thread Mark Brown
On Wed, Jun 26, 2024 at 01:48:59AM -0700, Zhu Jun wrote: > Inside of test_pcm_time() arguments are printed via printf > but '%d' is used to print @flags (of type unsigned int). > Use '%u' instead, just like we do everywhere else. > > Signed-off-by: Zhu Jun Reviewed-by: Mark Brown signature.as

Re: [PATCH 1/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses

2024-06-26 Thread Maxim Levitsky
On Fri, 2024-06-21 at 16:43 -0400, Maxim Levitsky wrote: > Currently this test does a single CLFLUSH on its memory location > but due to speculative execution this might not cause LLC misses. > > Instead, do a cache flush on each loop iteration to confuse the prediction > and make sure that cache

Re: [PATCH net-next v5 08/10] selftests: openvswitch: add userspace parsing

2024-06-26 Thread Aaron Conole
Adrian Moreno writes: > The userspace action lacks parsing support plus it contains a bug in the > name of one of its attributes. > > This patch makes userspace action work. > > Signed-off-by: Adrian Moreno > --- Reviewed-by: Aaron Conole

Re: [PATCH net-next v5 07/10] selftests: openvswitch: add emit_sample action

2024-06-26 Thread Aaron Conole
Adrian Moreno writes: > Add sample and emit_sample action support to ovs-dpctl.py. > > Refactor common attribute parsing logic into an external function. > > Signed-off-by: Adrian Moreno > --- Reviewed-by: Aaron Conole

Re: [PATCH net-next v5 00/10] net: openvswitch: Add sample multicasting.

2024-06-26 Thread Eelco Chaudron
On 25 Jun 2024, at 22:51, Adrian Moreno wrote: > ** Background ** > Currently, OVS supports several packet sampling mechanisms (sFlow, > per-bridge IPFIX, per-flow IPFIX). These end up being translated into a > userspace action that needs to be handled by ovs-vswitchd's handler > threads only t

Re: [PATCH net-next v5 09/10] selftests: openvswitch: parse trunc action

2024-06-26 Thread Aaron Conole
Adrian Moreno writes: > The trunc action was supported decode-able but not parse-able. Add > support for parsing the action string. > > Signed-off-by: Adrian Moreno > --- Reviewed-by: Aaron Conole

Re: [PATCH v3 3/3] Turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured.

2024-06-26 Thread Peter Xu
On Wed, Jun 26, 2024 at 09:05:13AM -0400, Audra Mitchell wrote: > If CONFIG_PTE_MARKER_UFFD_WP is disabled, then we turn off three features > in userfaultfd_api (UFFD_FEATURE_WP_HUGETLBFS_SHMEM, > UFFD_FEATURE_WP_UNPOPULATED, and UFFD_FEATURE_WP_ASYNC). Currently this > test always will call uffdio

[PATCH HID v2 13/13] selftests/hid: add an infinite loop test for hid_bpf_try_input_report

2024-06-26 Thread Benjamin Tissoires
We don't want this call to allow an infinite loop in HID-BPF, so let's have some tests. Signed-off-by: Benjamin Tissoires --- no changes in v2 --- tools/testing/selftests/hid/hid_bpf.c | 41 + tools/testing/selftests/hid/progs/hid.c | 37 ++

[PATCH HID v2 12/13] selftests/hid: add another test for injecting an event from an event hook

2024-06-26 Thread Benjamin Tissoires
Similar to test_multiply_events_wq: we receive one event and inject a new one. But given that this time we are already in the event hook, we can use hid_bpf_try_input_report() directly as this function will not sleep. Note that the injected event gets processed before the original one this way. S

Re: [PATCH net-next v13 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-26 Thread Pavel Begunkov
On 6/25/24 03:47, Mina Almasry wrote: Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. The sock_devmem_dontneed loop is a bit crude, but that can

[PATCH HID v2 11/13] HID: bpf: allow hid_device_event hooks to inject input reports on self

2024-06-26 Thread Benjamin Tissoires
This is the same logic than hid_hw_raw_request or hid_hw_output_report: we can allow hid_bpf_try_input_report to be called from a hook on hid_input_report if we ensure that the call can not be made twice in a row. There is one extra subtlety in which there is a lock in hid_input_report. But given

[PATCH HID v2 10/13] selftests/hid: add wq test for hid_bpf_input_report()

2024-06-26 Thread Benjamin Tissoires
Now that bpf_wq is available, we can write a test with it. Having hid_bpf_input_report() waiting for the device means that we can directly call it, and we get that event when the device is ready. Signed-off-by: Benjamin Tissoires --- no changes in v2 --- tools/testing/selftests/hid/hid_bpf.c

[PATCH HID v2 09/13] HID: bpf: make hid_bpf_input_report() sleep until the device is ready

2024-06-26 Thread Benjamin Tissoires
hid_bpf_input_report() is already marked to be used in sleepable context only. So instead of hammering with timers the device to hopefully get an available slot where the device is not sending events, we can make that kfunc wait for the current event to be terminated before it goes in. This allows

[PATCH HID v2 08/13] selftests/hid: add tests for hid_hw_output_report HID-BPF hooks

2024-06-26 Thread Benjamin Tissoires
We add 3 new tests: - first, we make sure we can prevent the output_report to happen - second, we make sure that we can detect that a given hidraw client was actually doing the request, and for that client only, call ourself hid_bpf_hw_output_report(), returning a custom value - last, we ensure

[PATCH HID v2 07/13] HID: bpf: add HID-BPF hooks for hid_hw_output_report

2024-06-26 Thread Benjamin Tissoires
Same story than hid_hw_raw_requests: This allows to intercept and prevent or change the behavior of hid_hw_output_report() from a bpf program. The intent is to solve a couple of use case: - firewalling a HID device: a firewall can monitor who opens the hidraw nodes and then prevent or allow

[PATCH HID v2 06/13] selftests/hid: add tests for hid_hw_raw_request HID-BPF hooks

2024-06-26 Thread Benjamin Tissoires
We add 3 new tests: - first, we make sure we can prevent the raw_request to happen - second, we make sure that we can detect that a given hidraw client was actually doing the request, and for that client only, call ourself hid_bpf_hw_request(), returning a custom value - last, we ensure that we

[PATCH HID v2 05/13] HID: bpf: prevent infinite recursions with hid_hw_raw_requests hooks

2024-06-26 Thread Benjamin Tissoires
When we attach a sleepable hook to hid_hw_raw_requests, we can (and in many cases should) call ourself hid_bpf_raw_request(), to actually fetch data from the device itself. However, this means that we might enter an infinite loop between hid_hw_raw_requests hooks and hid_bpf_hw_request() call. To

[PATCH HID v2 03/13] HID: bpf: protect HID-BPF prog_list access by a SRCU

2024-06-26 Thread Benjamin Tissoires
We want to add sleepable callbacks for hid_hw_raw_request() and hid_hw_output_report(), but we can not use a plain RCU for those. Prepare for a SRCU so we can extend HID-BPF. This changes a little bit how hid_bpf_device_init() behaves, as it may now fail, so there is a tiny hid-core.c change to a

[PATCH HID v2 04/13] HID: bpf: add HID-BPF hooks for hid_hw_raw_requests

2024-06-26 Thread Benjamin Tissoires
This allows to intercept and prevent or change the behavior of hid_hw_raw_request() from a bpf program. The intent is to solve a couple of use case: - firewalling a HID device: a firewall can monitor who opens the hidraw nodes and then prevent or allow access to write operations on that hidraw

[PATCH HID v2 02/13] HID: add source argument to HID low level functions

2024-06-26 Thread Benjamin Tissoires
This allows to know who actually sent what when we process the request to the device. This will be useful for a BPF firewall program to allow or not requests coming from a dedicated hidraw node client. Signed-off-by: Benjamin Tissoires --- no changes in v2 --- drivers/hid/bpf/hid_bpf_dispatch.

[PATCH HID v2 01/13] HID: bpf: fix dispatch_hid_bpf_device_event uninitialized ret value

2024-06-26 Thread Benjamin Tissoires
Looks like if a bpf program gets inserted and then removed, hdev->bpf.device_data is then allocated, but the loop iterating over the bpf program is never assigning ret. This is a problem and also revealed another bug in which only the last value of ret was checked. This effectively meant than only

[PATCH HID v2 00/13] HID: bpf_struct_ops, part 2

2024-06-26 Thread Benjamin Tissoires
This series is a followup of the struct_ops conversion. Therefore, it is based on top of the for-6.11/bpf branch of the hid.git tree: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/log/?h=for-6.11/bpf The first patch should go in ASAP, it's a fix that was detected by Dan and which is

Re: [PATCH net-next v13 10/13] tcp: RX path for devmem TCP

2024-06-26 Thread Pavel Begunkov
On 6/25/24 03:47, Mina Almasry wrote: In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header

Re: [PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Dev Jain
On 6/26/24 17:24, Oleg Nesterov wrote: On 06/26, Dev Jain wrote: +int main(int argc, char *argv[]) +{ + struct sigaction act, act2; + sigset_t *set, *oldset; ... + set = malloc(sizeof(sigset_t *)); + if (!set) + ksft_exit_fail_perror("malloc"); + +

Re: [PATCH] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Markus Elfring
>… openat() and open() initialize > 'from' and 'to', and only 'from' validated with 'if' statement. Why do find such information helpful? > If the > initialization of variable 'to' fails, The

Re: [PATCH bpf-next v2 1/4] skmsg: null check for sg_page in sk_msg_recvmsg

2024-06-26 Thread Geliang Tang
On Tue, 2024-06-25 at 12:37 -0700, John Fastabend wrote: > Eric Dumazet wrote: > > On Tue, Jun 25, 2024 at 10:25 AM Geliang Tang > > wrote: > > > > > > From: Geliang Tang > > > > > > Run the following BPF selftests on Loongarch: > > > > > > ./test_progs -t sockmap_basic > > > > > > A Kernel p

[PATCH v3 3/3] Turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured.

2024-06-26 Thread Audra Mitchell
If CONFIG_PTE_MARKER_UFFD_WP is disabled, then we turn off three features in userfaultfd_api (UFFD_FEATURE_WP_HUGETLBFS_SHMEM, UFFD_FEATURE_WP_UNPOPULATED, and UFFD_FEATURE_WP_ASYNC). Currently this test always will call uffdio_regsiter with the flag UFFDIO_REGISTER_MODE_WP. However, the kernel ens

[PATCH v3 2/3] Update uffd-stress to handle EINVAL for unset config features

2024-06-26 Thread Audra Mitchell
Now that we have updated userfaultfd_api to correctly return EIVAL when a feature is requested but not available, let's fix the uffd-stress test to only set the UFFD_FEATURE_WP_UNPOPULATED feature when the config is set. In addition, still run the test if the CONFIG_PTE_MARKER_UFFD_WP is not set, j

[PATCH v3 1/3] Fix userfaultfd_api to return EINVAL as expected

2024-06-26 Thread Audra Mitchell
Currently if we request a feature that is not set in the Kernel config we fail silently and return all the available features. However, the man page indicates we should return an EINVAL. We need to fix this issue since we can end up with a Kernel warning should a program request the feature UFFD_F

Re: [PATCH v2 3/3] Turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured.

2024-06-26 Thread Audra Mitchell
On Tue, Jun 25, 2024 at 07:55:14PM -0400, Peter Xu wrote: > On Tue, Jun 25, 2024 at 04:05:58PM -0700, Andrew Morton wrote: > > On Mon, 24 Jun 2024 10:42:00 -0400 Peter Xu wrote: > > > > > > uffdio_api.features &= ~UFFD_FEATURE_WP_HUGETLBFS_SHMEM; > > > > uffdio_api.features &= ~UF

[PATCH] selftests/bpf: improve file descriptor closure handling

2024-06-26 Thread Ma Ke
serial_test_fexit_stress() has a non-robust handling of file descriptor closure. If an error occurs, the function may exit without closing open file descriptors, potentially causing resource leaks. Fix the issue by closing file descriptors in reverse order and starting from the last opened. Ensure

Re: [PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-26 Thread Oleg Nesterov
On 06/26, Dev Jain wrote: > > +int main(int argc, char *argv[]) > +{ > + struct sigaction act, act2; > + sigset_t *set, *oldset; ... > + set = malloc(sizeof(sigset_t *)); > + if (!set) > + ksft_exit_fail_perror("malloc"); > + > + oldset = malloc(sizeof(sigset_t *))

Re: [PATCH net-next v5 10/10] selftests: openvswitch: add emit_sample test

2024-06-26 Thread Ilya Maximets
On 6/25/24 22:51, Adrian Moreno wrote: > Add a test to verify sampling packets via psample works. > > In order to do that, create a subcommand in ovs-dpctl.py to listen to > on the psample multicast group and print samples. > > Signed-off-by: Adrian Moreno > --- > .../selftests/net/openvswitch/

Re: [PATCH net-next v14 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-26 Thread Nikolay Aleksandrov
On 25/06/2024 22:53, Mina Almasry wrote: Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan

Re: [PATCH] selftests/alsa:Add memset to initialize memory

2024-06-26 Thread Mark Brown
On Wed, Jun 26, 2024 at 02:58:17AM -0700, Zhu Jun wrote: > Add memset to initialize the requested memory Why? signature.asc Description: PGP signature

Re: [PATCH] selftests/alsa:Replace malloc with calloc

2024-06-26 Thread Mark Brown
On Wed, Jun 26, 2024 at 02:54:09AM -0700, Zhu Jun wrote: > Using calloc to handling memory allocation, calloc > can initialize the allocated memory > SKIP(return, "Can't read patterns. Probably, module isn't > loaded"); > > card_name = malloc(127); > + memset(card_name,

[PATCH] selftests/alsa:Add memset to initialize memory

2024-06-26 Thread Zhu Jun
Add memset to initialize the requested memory Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/test-pcmtest-driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/alsa/test-pcmtest-driver.c index ca81afa4e

[PATCH] selftests/alsa:Replace malloc with calloc

2024-06-26 Thread Zhu Jun
Using calloc to handling memory allocation, calloc can initialize the allocated memory Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/test-pcmtest-driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/a

[PATCH] selftests/alsa:Fix printf format string in pcm-test.c

2024-06-26 Thread Zhu Jun
Inside of test_pcm_time() arguments are printed via printf but '%d' is used to print @flags (of type unsigned int). Use '%u' instead, just like we do everywhere else. Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/pcm-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [PATCH net-next v14 03/13] netdev: support binding dma-buf to netdevice

2024-06-26 Thread Daniel Vetter
On Tue, Jun 25, 2024 at 07:53:51PM +, Mina Almasry wrote: > Add a netdev_dmabuf_binding struct which represents the > dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to > rx queues on the netdevice. On the binding, the dma_buf_attach > & dma_buf_map_attachment will occur. Th

[PATCH] selftests/capabilities: Fix possible file leak in copy_fromat_to

2024-06-26 Thread Ma Ke
The open() function returns -1 on error. openat() and open() initialize 'from' and 'to', and only 'from' validated with 'if' statement. If the initialization of variable 'to' fails, we should better check the value of 'to' and close 'from' to avoid possible file leak. Fixes: 32ae976ed3b5 ("selftes

Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-06-26 Thread Maciej Wieczor-Retman
Hello!, On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote: >> Hello, >> sorry it took me so long to get back to this. I prepared the next version >> with >> your comments applied and Tony's replies taken into account. > >Thank y