>… 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,
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
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
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
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
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
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
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 ++
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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");
+
+
>… 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
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
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
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
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
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
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
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 *))
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/
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
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
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,
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
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
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 --
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
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
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
69 matches
Mail list logo