[PATCH rc v2 4/4] iommufd/selftest: Fix build warnings due to uninitialized mfd

2025-06-24 Thread Nicolin Chen
a.com/ The job of this selftest is to catch kernel bug, while such warnings will unlikely disrupt its role. Mute the warning by force initializing the mfd and add an ASSERT_GT(). Reviewed-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 8 ++-- 1 fil

[PATCH rc v2 3/4] iommufd/selftest: Add asserts testing global mfd

2025-06-24 Thread Nicolin Chen
y: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/iommu/iommufd.c b/tools/testing/selftests/iommu/iommufd.c index e7eb11a94034..e61218c0537f 100644 --- a/tools/testing/selftests/iommu/iommufd.c +++ b/too

[PATCH rc v2 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()

2025-06-24 Thread Nicolin Chen
Do not forget to close mfd in the error paths, since none of the callers would close it when ASSERT_NE(MAP_FAILED, buf) fails. Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE") Cc: sta...@vger.kernel.org Reviewed-by: Jason Gunthorpe Signed-off-by: Ni

[PATCH rc v2 0/4] Fix iommufd selftest FAIL and warnings with v6.16

2025-06-24 Thread Nicolin Chen
1750049883.git.nicol...@nvidia.com/ Thanks Nicolin Nicolin Chen (4): iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes iommufd/selftest: Add missing close(mfd) in memfd_mmap() iommufd/selftest: Add asserts testing global mfd iommufd/selftest: Fix build warnings due to uni

Re: [PATCH v2] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-23 Thread Chen Linxuan
On Mon, Jun 23, 2025 at 12:22 PM Muhammad Usama Anjum wrote: > > On 6/20/25 7:55 PM, Chen Linxuan wrote: > > On Fri, Jun 20, 2025 at 10:46 PM Muhammad Usama Anjum > > wrote: > >> > >> On 6/20/25 8:50 AM, Chen Linxuan wrote: > >>> When running `ma

[PATCH v3] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-23 Thread Chen Linxuan
("/"); | ^~ Signed-off-by: Chen Linxuan --- Changes in v3: - Apply changes suggested by Muhammad Usama Anjum - Link to v2: https://lore.kernel.org/all/20250620035125.2938774-2-chenlinx...@uniontech.com/ Changes in v2: - Apply changes suggested by Shuah Khan

[PATCH] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-23 Thread Chen Linxuan
("/"); | ^~ Signed-off-by: Chen Linxuan --- Changes in v3: - Apply changes suggested by Muhammad Usama Anjum - Link to v2: https://lore.kernel.org/all/20250620035125.2938774-2-chenlinx...@uniontech.com/ Changes in v2: - Apply changes suggested by Shuah Khan

Re: [PATCH v2] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-20 Thread Chen Linxuan
On Fri, Jun 20, 2025 at 10:46 PM Muhammad Usama Anjum wrote: > > On 6/20/25 8:50 AM, Chen Linxuan wrote: > > When running `make kselftest`, the following compilation warning was > > encountered: > > > > mount-notify_test.c: In function ‘fanotify_rmdir’: > >

[PATCH v2] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-19 Thread Chen Linxuan
("/"); | ^~ Signed-off-by: Chen Linxuan --- Changes in v2: - Apply changes suggested by Shuah Khan - Link to v1: https://lore.kernel.org/all/20250610020758.2798787-2-chenlinx...@uniontech.com/ --- .../filesystems/mount-notify/mount-notify_te

[PATCH] selftests/filesystems/mount-notify: remove __kernel_fsid_t

2025-06-19 Thread Chen Linxuan
; | ^~~ Signed-off-by: Chen Linxuan --- .../selftests/filesystems/mount-notify/mount-notify_test.c | 7 --- .../filesystems/mount-notify/mount-notify_test_ns.c| 7 --- 2 files changed, 14 deletions(-) diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c

Re: [PATCH RESEND] selftests/memfd: clean Makefile

2025-06-19 Thread Chen Linxuan
On Fri, Jun 20, 2025 at 1:02 AM Shuah Khan wrote: > > On 6/19/25 01:43, Chen Linxuan wrote: > > On Thu, Jun 19, 2025 at 5:21 AM Shuah Khan > > wrote: > >> > >> On 6/9/25 20:05, Chen Linxuan wrote: > >>> When writing a test for fusectl, I re

Re: [PATCH RESEND] selftests: Suppress unused variable warning

2025-06-19 Thread Chen Linxuan
On Fri, Jun 20, 2025 at 5:41 AM Shuah Khan wrote: > > On 6/19/25 13:00, John Hubbard wrote: > > On 6/19/25 10:00 AM, Shuah Khan wrote: > >> On 6/19/25 01:46, Chen Linxuan wrote: > >>> On Thu, Jun 19, 2025 at 5:23 AM Shuah Khan > >>> wrot

Re: [PATCH RESEND] selftests: Suppress unused variable warning

2025-06-19 Thread Chen Linxuan
On Thu, Jun 19, 2025 at 5:23 AM Shuah Khan wrote: > > On 6/9/25 20:07, Chen Linxuan wrote: > > When running `make kselftest`, the following compilation warning was > > encountered: > > > > mount-notify_test.c: In function ‘fanotify_rmdir’: > > mount-notify_tes

Re: [PATCH RESEND] selftests/memfd: clean Makefile

2025-06-19 Thread Chen Linxuan
On Thu, Jun 19, 2025 at 5:21 AM Shuah Khan wrote: > > On 6/9/25 20:05, Chen Linxuan wrote: > > When writing a test for fusectl, I referred to this Makefile as a > > reference for creating a FUSE daemon in the selftests. > > While doing so, I noticed that there is a min

Re: [PATCH RESEND] selftests: add missing include

2025-06-19 Thread Chen Linxuan
On Thu, Jun 19, 2025 at 5:25 AM Shuah Khan wrote: > > On 6/9/25 20:08, Chen Linxuan wrote: > > I failed to build this test on Ubuntu 24.04. > > Compiler complained about undefined functions mount, umount and some > > mount related flags. > > > > Signed-off-b

Re: [PATCH RESEND] selftests: add missing include

2025-06-19 Thread Chen Linxuan
On Thu, Jun 19, 2025 at 5:25 AM Shuah Khan wrote: > > On 6/9/25 20:08, Chen Linxuan wrote: > > I failed to build this test on Ubuntu 24.04. > > Compiler complained about undefined functions mount, umount and some > > mount related flags. > > > > Signed-off-b

Re: [PATCH rc 1/4] iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes

2025-06-17 Thread Nicolin Chen
On Tue, Jun 17, 2025 at 08:01:36PM -0300, Jason Gunthorpe wrote: > On Tue, Jun 17, 2025 at 02:23:41PM -0700, Nicolin Chen wrote: > > On Tue, Jun 17, 2025 at 08:59:48AM -0300, Jason Gunthorpe wrote: > > > On Mon, Jun 16, 2025 at 07:02:08PM -0700, Nicolin Chen wrote: &g

Re: [PATCH rc 1/4] iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes

2025-06-17 Thread Nicolin Chen
On Tue, Jun 17, 2025 at 08:59:48AM -0300, Jason Gunthorpe wrote: > On Mon, Jun 16, 2025 at 07:02:08PM -0700, Nicolin Chen wrote: > > ---breakdown--- > > After `posix_memalign()`: > > [ posix_memalign() memory ] ← malloc thinks it owns this > > > > Then

Re: [PATCH v4 1/2] MIPS: Don't crash in stack_top() for tasks without ABI or vDSO

2025-06-17 Thread Huacai Chen
Reviewed-by: Huacai Chen On Wed, Jun 11, 2025 at 7:28 PM Thomas Weißschuh wrote: > > Not all tasks have an ABI associated or vDSO mapped, > for example kthreads never do. > If such a task ever ends up calling stack_top(), it will derefence the > NULL ABI pointer and crash. &

Re: [PATCH rc 1/4] iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes

2025-06-16 Thread Nicolin Chen
On Mon, Jun 16, 2025 at 01:25:01PM -0300, Jason Gunthorpe wrote: > On Sun, Jun 15, 2025 at 10:02:03PM -0700, Nicolin Chen wrote: > > FIXTURE_TEARDOWN(iommufd_dirty_tracking) > > { > > - munmap(self->buffer, variant->buffer_size); > > - munmap(self->bi

[PATCH rc 0/4] Fix iommufd selftest FAIL and warnings with v6.16

2025-06-15 Thread Nicolin Chen
/aei8dv+ref3v3...@nvidia.com/ This is on github: https://github.com/nicolinc/iommufd/commits/iommufd_selftest_fixes-v6.16 Thanks Nicolin Nicolin Chen (4): iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes iommufd/selftest: Add missing close(mfd) in memfd_mmap() iommufd

[PATCH rc 4/4] iommufd/selftest: Fix build warnings due to uninitialized mfd

2025-06-15 Thread Nicolin Chen
a.com/ The job of this selftest is to catch kernel bug, while such warnings will unlikely disrupt its role. Mute the warning by force initializing the mfd and add an ASSERT_GT(). Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 8 ++-- 1 file changed, 6 insertions(+), 2 d

[PATCH rc 1/4] iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes

2025-06-15 Thread Nicolin Chen
T_GET_DIRTY_BITMAP") Cc: sta...@vger.kernel.org Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd.c | 28 - 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/iommu/iommufd.c b/tools/testing/selftests/iommu/iommu

[PATCH rc 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()

2025-06-15 Thread Nicolin Chen
Do not forget to close mfd in the error paths, since none of the callers would close it when ASSERT_NE(MAP_FAILED, buf) fails. Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE") Cc: sta...@vger.kernel.org Signed-off-by: Nicolin Chen --- tools/testing/selft

[PATCH rc 3/4] iommufd/selftest: Add asserts testing global mfd

2025-06-15 Thread Nicolin Chen
The mfd and mfd_buffer will be used in the tests directly without an extra check. Test them in setup_sizes() to ensure they are safe to use. Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE") Cc: sta...@vger.kernel.org Signed-off-by: Nicolin Chen --- too

Re: [PATCH v3 RESEND] selftests: filesystems: Add functional test for the abort file in fusectl

2025-06-13 Thread Chen Linxuan
On Thu, Jun 12, 2025 at 4:56 PM Miklos Szeredi wrote: > > On Tue, 10 Jun 2025 at 04:10, Chen Linxuan wrote: > > > > This patch add a simple functional test for the "abort" file > > in fusectlfs (/sys/fs/fuse/connections/ID/about). > > >

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Nicolin Chen
On Thu, Jun 12, 2025 at 08:31:38PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 12, 2025 at 12:03:14PM -0700, Nicolin Chen wrote: > > On Thu, Jun 12, 2025 at 03:56:13PM -0300, Jason Gunthorpe wrote: > > > On Thu, Jun 12, 2025 at 11:53:24AM -0700, Nicolin Chen wrote: > >

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Nicolin Chen
On Thu, Jun 12, 2025 at 03:56:13PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 12, 2025 at 11:53:24AM -0700, Nicolin Chen wrote: > > @@ -2022,7 +2023,19 @@ FIXTURE_SETUP(iommufd_dirty_tracking) > > self->fd = open("/dev/iommu", O_RDWR); > &

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Nicolin Chen
On Thu, Jun 12, 2025 at 10:53:34AM -0700, Nicolin Chen wrote: > On Thu, Jun 12, 2025 at 12:42:42PM -0300, Jason Gunthorpe wrote: > > On Thu, Jun 12, 2025 at 05:23:01PM +0200, Thomas Weißschuh wrote: > > > On Thu, Jun 12, 2025 at 11:58:01AM -0300, Jason Gunthorpe wrote: > >

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Nicolin Chen
On Thu, Jun 12, 2025 at 12:42:42PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 12, 2025 at 05:23:01PM +0200, Thomas Weißschuh wrote: > > On Thu, Jun 12, 2025 at 11:58:01AM -0300, Jason Gunthorpe wrote: > > > On Thu, Jun 12, 2025 at 04:27:41PM +0200, Thomas Weißschuh wrote: > > > > > > > If the ass

[PATCH v4] selftests: filesystems: Add functional test for the abort file in fusectl

2025-06-12 Thread Chen Linxuan
g_OBhmSY=q...@mail.gmail.com/ Signed-off-by: Chen Linxuan Acked-by: Shuah Khan Reviewed-by: Amir Goldstein Co-developed-by: Miklos Szeredi Reviewed-by: Miklos Szeredi --- Changes in v4: - Apply patch suggested by Miklos Szeredi - Setting up a userns environment for testing - Fix a EBUSY on um

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-11 Thread Nicolin Chen
On Wed, Jun 11, 2025 at 08:51:17PM -0300, Jason Gunthorpe wrote: > On Wed, Jun 11, 2025 at 04:43:00PM -0700, Nicolin Chen wrote: > > So, the test case sets an alignment with HUGEPAGE_SIZE=512MB while > > allocating buffer_size=64MB: > > rc = posix_memalign(&self->bu

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-11 Thread Nicolin Chen
On Wed, Jun 11, 2025 at 02:48:16PM -0700, Nicolin Chen wrote: > On Wed, Jun 11, 2025 at 10:19:56AM -0700, Nicolin Chen wrote: > > On Wed, Jun 11, 2025 at 10:04:35AM +0200, Thomas Weißschuh wrote: > > > On Wed, Jun 11, 2025 at 12:05:25AM -0700, Nicolin Chen wrote: > > >

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-11 Thread Nicolin Chen
On Wed, Jun 11, 2025 at 10:19:56AM -0700, Nicolin Chen wrote: > On Wed, Jun 11, 2025 at 10:04:35AM +0200, Thomas Weißschuh wrote: > > On Wed, Jun 11, 2025 at 12:05:25AM -0700, Nicolin Chen wrote: > > > 2) parent doesn't seem to wait for the setup() to complete.. > >

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-11 Thread Nicolin Chen
On Wed, Jun 11, 2025 at 10:04:35AM +0200, Thomas Weißschuh wrote: > On Wed, Jun 11, 2025 at 12:05:25AM -0700, Nicolin Chen wrote: > > On Tue, Jun 10, 2025 at 08:46:57PM -0300, Jason Gunthorpe wrote: > > > On Tue, Jun 10, 2025 at 11:48:44AM -0700, Nicolin Chen wrote: > > >

Re: [PATCH 1/2] dt-bindings: remoteproc: Add C906L rproc for Sophgo CV1800B SoC

2025-06-11 Thread Chen Wang
added to the bindings? I suggest that these should be determined before officially merging this bindings. Thanks, Chen Signed-off-by: Junhui Liu --- .../bindings/remoteproc/sophgo,cv1800b-c906l.yaml | 68 ++ 1 file changed, 68 insertions(+) diff --git a/Documentation

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-11 Thread Nicolin Chen
On Tue, Jun 10, 2025 at 08:46:57PM -0300, Jason Gunthorpe wrote: > On Tue, Jun 10, 2025 at 11:48:44AM -0700, Nicolin Chen wrote: > > On Tue, Jun 10, 2025 at 09:09:02AM -0300, Jason Gunthorpe wrote: > > > On Tue, Jun 10, 2025 at 01:38:22PM +0200, Thom

Re: [PATCH v4 12/14] selftests: harness: Stop using setjmp()/longjmp()

2025-06-10 Thread Nicolin Chen
On Tue, Jun 10, 2025 at 02:21:25PM +0200, Thomas Weißschuh wrote: > The following diff *alone* also prevents the warning, but that doesn't > make any sense either: > > --- a/tools/testing/selftests/iommu/iommufd_utils.h > +++ b/tools/testing/selftests/iommu/iommufd_utils.h > @@ -65,7 +65,7 @@ stat

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-10 Thread Nicolin Chen
On Tue, Jun 10, 2025 at 09:09:02AM -0300, Jason Gunthorpe wrote: > On Tue, Jun 10, 2025 at 01:38:22PM +0200, Thomas Weißschuh wrote: > > > -- > > > # RUN > > > iommufd_dirty_tracking.domain_dirty128M_huge.enforce_dirty ...

[PATCH] alloc_tag: remove empty module tag section

2025-06-10 Thread Casey Chen
add allocation tagging support for memory allocation profiling") Signed-off-by: Casey Chen Reviewed-by: Yuanyuan Zhong Acked-by: Suren Baghdasaryan --- include/asm-generic/codetag.lds.h | 6 -- scripts/module.lds.S | 5 - 2 files changed, 11 deletions(-) diff --git a

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-09 Thread Nicolin Chen
Hi Thomas, CC += Jason On Mon, May 05, 2025 at 05:15:27PM +0200, Thomas Weißschuh wrote: > To get rid of setjmp()/longjmp(), the teardown logic needs to be usable > from __bail(). To access the atomic teardown conditional from there, > move it into the test metadata. > This also allows the remova

Re: [PATCH v4 12/14] selftests: harness: Stop using setjmp()/longjmp()

2025-06-09 Thread Nicolin Chen
Hi Thomas, CC += Jason On Mon, May 05, 2025 at 05:15:30PM +0200, Thomas Weißschuh wrote: > Usage of longjmp() was added to ensure that teardown is always run in > commit 63e6b2a42342 ("selftests/harness: Run TEARDOWN for ASSERT failures") > However instead of calling longjmp() to the teardown han

[PATCH v3 RESEND] selftests: filesystems: Add functional test for the abort file in fusectl

2025-06-09 Thread Chen Linxuan
g_OBhmSY=q...@mail.gmail.com/ Signed-off-by: Chen Linxuan Acked-by: Shuah Khan Reviewed-by: Amir Goldstein --- Changes in v3: - Apply changes suggested by Amir Goldstein - Rename the test subdir to filesystems/fuse - Verify errno when connection is aborted - Apply changes suggested by Shuah Khan

[PATCH RESEND] selftests: add missing include

2025-06-09 Thread Chen Linxuan
I failed to build this test on Ubuntu 24.04. Compiler complained about undefined functions mount, umount and some mount related flags. Signed-off-by: Chen Linxuan --- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests

[PATCH RESEND] selftests: Suppress unused variable warning

2025-06-09 Thread Chen Linxuan
("/"); | ^~ This patch addresses the warning by explicitly suppressing the unused result of the `chdir` function. Signed-off-by: Chen Linxuan --- .../selftests/filesystems/mount-notify/mount-notify_test.c| 4 +++- 1 file changed, 3 insertions(+),

[PATCH RESEND] selftests/memfd: clean Makefile

2025-06-09 Thread Chen Linxuan
takes effect. The reason fuse_mnt compiles successfully is because CFLAGS is set at the very beginning of the file. Signed-off-by: Chen Linxuan --- tools/testing/selftests/memfd/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/memfd/Makefile b

[PATCH bpf-next v2 2/2] selftests/bpf: Add test to cover ktls with bpf_msg_pop_data

2025-06-08 Thread Jiayuan Chen
The selftest can reproduce an issue where using bpf_msg_pop_data() in ktls causes errors on the receiving end. Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/sockmap_ktls.c | 91 +++ .../selftests/bpf/progs/test_sockmap_ktls.c | 4 + 2 files changed, 95

[PATCH bpf-next v2 1/2] bpf,ktls: Fix data corruption when using bpf_msg_pop_data() in ktls

2025-06-08 Thread Jiayuan Chen
transmission. This causes uninitialized bytes to be appended after a complete "Application Data" packet, leading to errors on the receiving end when parsing TLS record. Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling") Reported-by: Cong Wang Signed-off-by: Jiayu

[PATCH bpf-next v2 0/2] bpf,ktls: Fix data corruption caused by using bpf_msg_pop_data() in ktls

2025-06-08 Thread Jiayuan Chen
eck and added Reviewed-by tag. https://lore.kernel.org/bpf/20250605145529.3q3aqr6iygpa6...@gmail.com/ Jiayuan Chen (2): bpf,ktls: Fix data corruption when using bpf_msg_pop_data() in ktls selftests/bpf: Add test to cover ktls with bpf_msg_pop_data net/tls/tls_sw.c

Re: [PATCH v2] selftests: Add functional test for the abort file in fusectl

2025-06-02 Thread Chen Linxuan
V3 has been sent. See https://lore.kernel.org/all/20250526014226.14192-1-chenlinx...@uniontech.com/ On Tue, Jun 3, 2025 at 7:02 AM Shuah Khan wrote: > > On 5/25/25 19:41, Chen Linxuan wrote: > > On Fri, May 23, 2025 at 6:50 AM Shuah Khan > > wrote: > > > >>

Re: [PATCH bpf-next v1 1/2] bpf,ktls: Fix data corruption when using bpf_msg_pop_data() in ktls

2025-06-02 Thread Jiayuan Chen
2025/5/30 02:16, "Cong Wang" 写到: > > On Fri, May 23, 2025 at 09:18:58PM +0800, Jiayuan Chen wrote: > > > > > When sending plaintext data, we initially calculated the corresponding > > > > ciphertext length. However, if we later reduced the plaint

[PATCH bpf-next v1 2/2] bpf/selftests: Add test cases for retrieving classid

2025-05-28 Thread Jiayuan Chen
from cgroup sockopt:OK 53 cgroup_get_classid:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/cgroup_classid.c | 212 ++ .../selftests/bpf/progs/test_cgroup_classid.c | 51 + 2 files changed, 263 insertions

[PATCH bpf-next v1 1/2] bpf: Restrict usage scope of bpf_get_cgroup_classid

2025-05-28 Thread Jiayuan Chen
c7ed68b95cfa6...@syzkaller.appspotmail.com Signed-off-by: Jiayuan Chen --- include/linux/bpf-cgroup.h | 8 kernel/bpf/cgroup.c| 25 + kernel/bpf/helpers.c | 4 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/include/linux/b

[PATCH v3] selftests: filesystems: Add functional test for the abort file in fusectl

2025-05-25 Thread Chen Linxuan
g_OBhmSY=q...@mail.gmail.com/ Cc: Amir Goldstein Signed-off-by: Chen Linxuan Acked-by: Shuah Khan --- Changes in v3: - Apply changes suggested by Amir Goldstein - Rename the test subdir to filesystems/fuse - Verify errno when connection is aborted - Apply changes suggested by Shuah Khan - Upd

Re: [PATCH v2] selftests: Add functional test for the abort file in fusectl

2025-05-25 Thread Chen Linxuan
On Fri, May 23, 2025 at 6:50 AM Shuah Khan wrote: > Also if this test requires root previlege, add check for it. Currently, this test does not require root privileges. Thanks, Chen Linxuan

[PATCH bpf-next v1 2/2] selftests/bpf: Add test to cover ktls with bpf_msg_pop_data

2025-05-23 Thread Jiayuan Chen
The selftest can reproduce an issue where using bpf_msg_pop_data() in ktls causes errors on the receiving end. Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/sockmap_ktls.c | 91 +++ .../selftests/bpf/progs/test_sockmap_ktls.c | 4 + 2 files changed, 95

[PATCH bpf-next v1 1/2] bpf,ktls: Fix data corruption when using bpf_msg_pop_data() in ktls

2025-05-23 Thread Jiayuan Chen
transmission. This causes uninitialized bytes to be appended after a complete "Application Data" packet, leading to errors on the receiving end when parsing TLS record. Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling") Reported-by: Cong Wang Signed-off-by: Jiayua

[PATCH bpf-next v1 0/2] bpf,ktls: Fix data corruption caused by using bpf_msg_pop_data() in ktls

2025-05-23 Thread Jiayuan Chen
sockhash:ktls:txmsg test push/pop data:OK 44/ 1 sockhash:ktls:txmsg test ingress parser:OK 45/ 0 sockhash:ktls:txmsg test ingress parser2:OK Pass: 45 Fail: 0 [1]: https://lore.kernel.org/bpf/CAM_iQpU7=4xjbefzoxndkox9gffmoe7fcwmq5thbsymbrnm...@mail.gmail.com/ Jiayuan Chen (2): bpf,ktl

Re: [PATCH 1/1] alloc_tag: handle module codetag load errors as module load failures

2025-05-21 Thread Casey Chen
; profiling when this error happens, instead we fail to load the module. > > Fixes: 10075262888b ("alloc_tag: allocate percpu counters for module tags > dynamically") > Reported-by: Casey Chen > Closes: > https://lore.kernel.org/all/20250520231620.15259-1-cac...@purestor

Re: [PATCH] selftests: Add functional test for the abort file in fusectl

2025-05-18 Thread Chen Linxuan
On Thu, May 15, 2025 at 6:27 PM Amir Goldstein wrote: > > On Thu, May 15, 2025 at 9:35 AM Chen Linxuan > wrote: > > > > + ret = read(test_fd, path_buf, sizeof(path_buf)); > > + ASSERT_LT(ret, 0); > > Nice! > I guess you could also verify errno ==

[PATCH v2] selftests: Add functional test for the abort file in fusectl

2025-05-16 Thread Chen Linxuan
g_OBhmSY=q...@mail.gmail.com/ Cc: Amir Goldstein Signed-off-by: Chen Linxuan --- Changes in v2: - Apply changes suggested by Amir Goldstein - Check errno - Link to v1: https://lore.kernel.org/all/20250515073449.346774-2-chenlinx...@uniontech.com/ --- MAINTAINERS

[PATCH] selftests/memfd: clean Makefile

2025-05-15 Thread Chen Linxuan
takes effect. The reason fuse_mnt compiles successfully is because CFLAGS is set at the very beginning of the file. Signed-off-by: Chen Linxuan --- tools/testing/selftests/memfd/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/memfd/Makefile b

[PATCH] selftests: Add functional test for the abort file in fusectl

2025-05-15 Thread Chen Linxuan
g_OBhmSY=q...@mail.gmail.com/ Cc: Amir Goldstein Signed-off-by: Chen Linxuan --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../selftests/filesystems/fusectl/.gitignore | 3 + .../selftests/filesystems/fusectl/Makefil

Re: [PATCH] selftests: Add functional test for the abort file in fusectl

2025-05-15 Thread Chen Linxuan
On Thu, May 15, 2025 at 3:35 PM Chen Linxuan wrote: > This patch add a simple functional test for the "about" file Sorry for the typo, it should be "abort".

[PATCH] selftests: remove duplicated function definition

2025-05-13 Thread Chen Linxuan
I failed to build this test on Ubuntu 24.04. Compiler complains that function sys_open_tree has already been defined in "../filesystems/overlayfs/wrappers.h". Signed-off-by: Chen Linxuan --- tools/testing/selftests/mount_setattr/mount_setattr_test.c | 5 - 1 file changed, 5

[PATCH] selftests: add missing include

2025-05-13 Thread Chen Linxuan
I failed to build this test on Ubuntu 24.04. Compiler complained about undefined functions mount, umount and some mount related flags. Signed-off-by: Chen Linxuan --- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests

[PATCH] selftests: Suppress unused variable warning

2025-05-13 Thread Chen Linxuan
("/"); | ^~ This patch addresses the warning by explicitly suppressing the unused result of the `chdir` function. Signed-off-by: Chen Linxuan --- .../selftests/filesystems/mount-notify/mount-notify_test.c| 4 +++- 1 file changed, 3 insertions(+),

Re: [PATCH v11 5/5] KVM: selftests: Add test cases for LoongArch

2025-05-11 Thread Huacai Chen
; F: arch/loongarch/include/asm/kvm* > F: arch/loongarch/include/uapi/asm/kvm* > F: arch/loongarch/kvm/ > +F: tools/testing/selftests/kvm/*/loongarch/ > +F: tools/testing/selftests/kvm/lib/loongarch/ > > KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips) > M:

Re: [PATCH v11 3/5] KVM: selftests: Add core KVM selftests support for LoongArch

2025-05-11 Thread Huacai Chen
Hi, Bibo, On Sun, Apr 27, 2025 at 2:45 PM Bibo Mao wrote: > > Add core KVM selftests support for LoongArch, it includes exception > handler, mmu page table setup and vCPU startup entry support. > > Signed-off-by: Bibo Mao > --- > .../selftests/kvm/lib/loongarch/exception.S | 59 +++ > .../se

Re: [PATCH v11 0/5] KVM: selftests: Add LoongArch support

2025-05-11 Thread Huacai Chen
Hi, Bibo, On Sun, Apr 27, 2025 at 2:45 PM Bibo Mao wrote: > > This patchset adds KVM selftests for LoongArch system, currently only > some common test cases are supported and pass to run. These test cases > are listed as following: > coalesced_io_test > demand_paging_test > dirty_log_

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2025-05-06 Thread Nicolin Chen
On Tue, May 06, 2025 at 09:58:47AM -0300, Jason Gunthorpe wrote: > On Mon, May 05, 2025 at 07:53:44PM -0700, Nicolin Chen wrote: > > On Mon, May 05, 2025 at 02:08:07PM -0300, Jason Gunthorpe wrote: > > > On Wed, Apr 30, 2025 at 12:58:47AM -0700, Nicolin Chen wrote: > >

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2025-05-05 Thread Nicolin Chen
On Mon, May 05, 2025 at 02:08:07PM -0300, Jason Gunthorpe wrote: > On Wed, Apr 30, 2025 at 12:58:47AM -0700, Nicolin Chen wrote: > > > > ... and I just hit a problem with it - this is basically guest BDFn > > > and it works as long as I'm hotplugging the TEE-IO VF

Re: [RFC net-next v1 1/2] udp: Introduce UDP_STOP_RCV option for UDP

2025-04-30 Thread Jiayuan Chen
2025/5/1 12:42, "Kuniyuki Iwashima" wrote: > > From: Jiayuan Chen > > Date: Thu, 1 May 2025 11:51:08 +0800 > > > > > For some services we are using "established-over-unconnected" model. > > > > > > > > ''

[RFC net-next v1 2/2] selftests/net: Add udp UDP_STOP_RCV selftest

2025-04-30 Thread Jiayuan Chen
Add a new selftest, which uses UDP_STOP_RCV to make UDP simulate TCP's listen and accept. Signed-off-by: Jiayuan Chen --- tools/testing/selftests/net/.gitignore| 1 + tools/testing/selftests/net/Makefile | 1 + .../testing/selftests/net/test_udp_stop_rcv.c

[RFC net-next v1 1/2] udp: Introduce UDP_STOP_RCV option for UDP

2025-04-30 Thread Jiayuan Chen
explicit boundaries, and we receive a complete packet before creating a connected socket.) Before this patch, the connected socket had to filter requests at recvmsg time, acting as a dispatcher to some extent. With this patch, we can consider the bind and connect operations to be atomic. Signed-off-by:

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2025-04-30 Thread Nicolin Chen
On Wed, Apr 30, 2025 at 05:54:53PM +1000, Alexey Kardashevskiy wrote: > On 4/10/24 21:41, Jason Gunthorpe wrote: > > On Fri, Oct 04, 2024 at 02:32:28PM +1000, Alexey Kardashevskiy wrote: > > > > > > + __u32 __reserved; > > > > + __aligned_u64 vdev_id; > > I believe this ended up being

Re: [PATCH bpf-next v1 1/2] ktls, sockmap: Fix missing uncharge operation

2025-04-28 Thread Jiayuan Chen
2025/4/29 08:14, "Cong Wang" wrote: > > On Fri, Apr 25, 2025 at 01:59:57PM +0800, Jiayuan Chen wrote: > > > > > net/tls/tls_sw.c | 7 +++ > > > > 1 file changed, 7 insertions(+) > > > > > > > > diff --git

[PATCH bpf-next v1 1/2] ktls, sockmap: Fix missing uncharge operation

2025-04-24 Thread Jiayuan Chen
aAmIi0vlycHtbXeb@pop-os.localdomain/T/#t Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling") Signed-off-by: Jiayuan Chen --- net/tls/tls_sw.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index f3d7d19482da..fc88e34b7f33 10

[PATCH bpf-next v1 2/2] selftests/bpf: Add test to cover sockmap with ktls

2025-04-24 Thread Jiayuan Chen
? __list_add_valid_or_report+0x83/0xea ? srso_return_thunk+0x5/0x5f ? __list_add+0x45/0x52 process_scheduled_works+0x73/0x82 worker_thread+0x1ce/0x2ae Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/sockmap_ktls.c | 76 +++ .../selftests/bpf/progs

[PATCH bpf-next v1 0/2] ktls, sockmap: Fix missing uncharge operation and add selfttest

2025-04-24 Thread Jiayuan Chen
ogical changes, but only fills in the missing uncharge places. This issue has existed all along, until it was exposed after we added the apply test in test_sockmap: commit 3448ad23b34e ("selftests/bpf: Add apply_bytes test to test_txmsg_redir_wait_sndmem in test_sockmap") Jiayua

Re: [PATCH bpf-next v1 1/2] bpf: Create cgroup storage if needed when updating link

2025-04-22 Thread Jiayuan Chen
April 23, 2025 at 08:13, "Martin KaFai Lau" wrote: > > On 4/16/25 9:40 PM, Jiayuan Chen wrote: > > > > > when we attach a prog without cgroup_storage map being used, > > > > cgroup_storage in struct bpf_prog_array_item is empty. Then, if we use &g

Re: [PATCH v9 3/5] KVM: selftests: Add core KVM selftests support for LoongArch

2025-04-20 Thread Huacai Chen
Hi, Bibo, On Wed, Apr 16, 2025 at 11:55 AM Bibo Mao wrote: > > Add core KVM selftests support for LoongArch, it includes exception > handler, mmu page table setup and vCPU startup entry support. > > Signed-off-by: Bibo Mao > --- > .../selftests/kvm/lib/loongarch/exception.S | 59 +++ > .../s

Re: [PATCH v9 2/5] KVM: selftests: Add KVM selftests header files for LoongArch

2025-04-20 Thread Huacai Chen
Hi, Bibo, On Wed, Apr 16, 2025 at 11:55 AM Bibo Mao wrote: > > 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: Bibo Mao > --- > .../testing/selft

[PATCH bpf-next v1 2/2] selftests/bpf: Add link update test for cgroup_storage

2025-04-18 Thread Jiayuan Chen
ing 0 nsec test_cgroup_storage_update:PASS:third ping 0 nsec 61 cgroup_storage_update:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/cgroup_storage.c | 45 +++ .../selftests/bpf/progs/cgroup_storage.c | 6 +++ 2 fil

[PATCH bpf-next v1 1/2] bpf: Create cgroup storage if needed when updating link

2025-04-16 Thread Jiayuan Chen
stroage in bpf_get_local_storage. Reported-by: syzbot+e6e8f6618a2d4b35e...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/67fc867e.050a0220.2970f9.03b8@google.com/T/ Fixes: 0c991ebc8c69 ("bpf: Implement bpf_prog replacement for an active bpf_cgroup_link") Signed-off-by: Ji

[PATCH bpf-next v1 0/2] bpf: Fix panic in bpf_get_local_storage

2025-04-16 Thread Jiayuan Chen
truct bpf_prog_array_item is empty. Then, if we use BPF_LINK_UPDATE to replace the old program with a new one that uses the cgroup_storage map, we miss the cgroup_storage being initialized. This causes a panic when accessing storage in bpf_get_local_storage. Jiayuan Chen (2): bpf: Create cgroup st

Re: [PATCH v3 1/2] MIPS: Don't crash in stack_top() for tasks without ABI or vDSO

2025-04-15 Thread Huacai Chen
Hi, Thomas, On Tue, Apr 15, 2025 at 3:10 PM Thomas Weißschuh wrote: > > Not all tasks have an ABI associated or vDSO mapped, > for example kthreads never do. > If such a task ever ends up calling stack_top(), it will derefence the > NULL ABI pointer and crash. > > This can for example happen when

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

2025-04-14 Thread Huacai Chen
Hi, Bibo, On Thu, Apr 10, 2025 at 11:57 AM Bibo Mao wrote: > > 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: Bibo Mao > --- > .../testing/selft

Re: [PATCH v2 1/2] MIPS: Don't crash in stack_top() for tasks without ABI or vDSO

2025-04-14 Thread Huacai Chen
Hi, Thomas, On Mon, Apr 14, 2025 at 4:29 PM Thomas Weißschuh wrote: > > Not all tasks have an ABI associated or vDSO mapped, > for example kthreads never do. > If such a task ever ends up calling stack_top(), it will derefence the > NULL vdso pointer and crash. > > This can for example happen whe

[RFC PATCH 3/7] vfio/virtio: add __always_inline for virtiovf_get_device_config_size

2025-04-11 Thread Chen Linxuan
e: in expansion of macro 'BUILD_BUG_ON' 401 | BUILD_BUG_ON(!is_power_of_2(virtvdev->bar0_virtual_buf_size)); | ^~~~ Signed-off-by: Winston Wen Co-Developed-by: Chen Linxuan Signed-off-by: Chen Linxuan --- drivers/vfio/pci/virtio/legacy_io.c | 2 +-

[PATCH bpf-next v1 0/4] bpf, sockmap: Fix data loss and panic issues

2025-04-10 Thread Jiayuan Chen
equires maintainers to spare some time from their busy schedules for review. https://lore.kernel.org/bpf/20250317092257.68760-1-jiayuan.c...@linux.dev/T/#t Jiayuan Chen (4): bpf, sockmap: Fix data lost during EAGAIN retries bpf, sockmap: fix duplicated data transmission bpf, sockmap: Fix panic

[PATCH bpf-next v4 2/3] bpf, sockmap: avoid using sk_socket after free when reading

2025-04-10 Thread Jiayuan Chen
dresses the immediate issue. Fixes: c63829182c37 ("af_unix: Implement ->psock_update_sk_prot()") Reported-by: syzbot+dd90a702f518e0eac...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/bpf/6734c033.050a0220.2a2fcc.0015@google.com/ Signed-off-by: Jiayuan Chen --- net/core/skmsg.c | 1

[PATCH bpf-next v4 0/3] bpf: Fix use-after-free of sockmap

2025-04-08 Thread Jiayuan Chen
selftest of edge case for TCP/UDP sockets. 3. Add Reviewed-by and Acked-by tag. https://lore.kernel.org/bpf/20250226132242.52663-1-jiayuan.c...@linux.dev/T/#t Jiayuan Chen (3): bpf, sockmap: avoid using sk_socket after free when sending bpf, sockmap: avoid using sk_socket after free when reading

[PATCH bpf-next v4 3/3] selftests/bpf: Add edge case tests for sockmap

2025-04-08 Thread Jiayuan Chen
Add edge case tests for sockmap. Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/socket_helpers.h | 13 +++- .../selftests/bpf/prog_tests/sockmap_basic.c | 60 +++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests

[PATCH bpf-next v4 1/3] bpf, sockmap: avoid using sk_socket after free when sending

2025-04-08 Thread Jiayuan Chen
a0 ? exc_general_protection+0x14c/0x230 ? asm_exc_general_protection+0x26/0x30 ? sock_sendmsg+0x21d/0x440 ? sock_sendmsg+0x3e0/0x440 ? __pfx_sock_sendmsg+0x10/0x10 __skb_send_sock+0x543/0xb70 sk_psock_backlog+0x247/0xb80 ... ''' Reported-by: Michal Luczaj Fixes: 799aa7f98d53 (&qu

[PATCH bpf-next v1 2/4] bpf, sockmap: fix duplicated data transmission

2025-04-07 Thread Jiayuan Chen
path to resend the entire skb data instead of continuing from the previous offset, resulting in data overlap at the receiver side. Fixes: 405df89dd52c ("bpf, sockmap: Improved check for empty queue") Signed-off-by: Jiayuan Chen --- net/core/skmsg.c | 14 +- 1 file change

[PATCH bpf-next v1 4/4] selftest/bpf/benchs: Add benchmark for sockmap usage

2025-04-07 Thread Jiayuan Chen
k can be run with: ''' ./bench sockmap -c 2 -p 1 -a --rx-verdict-ingress ''' In the future, we plan to move socket_helpers.h out of the prog_tests directory to make it accessible for the benchmark. This will enable better support for various socket types. Signed-off-b

[PATCH bpf-next v1 1/4] bpf, sockmap: Fix data lost during EAGAIN retries

2025-04-07 Thread Jiayuan Chen
sockmap'... create socket fd c1:13 p1:14 c2:15 p2:16 Benchmark 'sockmap' started. Send Speed 1347.236 MB/s, BPF Speed 1347.367 MB/s, Rcv Speed 65.402 MB/s Send Speed 1353.320 MB/s, BPF Speed 1353.320 MB/s, Rcv Speed 65.536 MB/s Send Speed 1353.186 MB/s, BPF Speed 1353.121 MB/s,

[PATCH bpf-next v1 3/4] bpf, sockmap: Fix panic when calling skb_linearize

2025-04-07 Thread Jiayuan Chen
| sk_psock_skb_ingress_enqueue sk_psock_verdict_apply_↑ skb_linearize ''' Note that for verdict_apply path, the skb_get operation is unnecessary so we add 'take_ref' param to control it's behavior. Fixes: a454d84ee20b (&qu

[PATCH bpf v2 2/2] selftests/bpf: add perf test for adjust_{head,meta}

2025-04-05 Thread Jiayuan Chen
run adjust head with size 20 cost 58 ns run adjust head with size 40 cost 58 ns run adjust head with size 200 cost 66 ns Signed-off-by: Jiayuan Chen --- .../selftests/bpf/prog_tests/xdp_perf.c | 52 --- tools/testing/selftests/bpf/progs/xdp_dummy.c | 14 + 2 files changed

  1   2   3   4   5   6   7   8   9   10   >