Re: [PATCH] selftests: hugetlb_dio: Fixup Check for initial conditions to skip in the start

2024-11-09 Thread Donet Tom
On 11/10/24 12:19, Donet Tom wrote: This test verifies that a hugepage, used as a user buffer for DIO operations, is correctly freed upon unmapping. To test this, we read the count of free hugepages before and after the mmap, DIO, and munmap operations, then check if the free hugepage count is

Re: [PATCH] selftests: hugetlb_dio: Fixup Check for initial conditions to skip in the start

2024-11-09 Thread Donet Tom
On 11/10/24 12:19, Donet Tom wrote: This test verifies that a hugepage, used as a user buffer for DIO operations, is correctly freed upon unmapping. To test this, we read the count of free hugepages before and after the mmap, DIO, and munmap operations, then check if the free hugepage count is

[PATCH] selftests: hugetlb_dio: Fixup Check for initial conditions to skip in the start

2024-11-09 Thread Donet Tom
This test verifies that a hugepage, used as a user buffer for DIO operations, is correctly freed upon unmapping. To test this, we read the count of free hugepages before and after the mmap, DIO, and munmap operations, then check if the free hugepage count is the same. Reading free hugepages before

Re: [PATCH] selftests: hugetlb_dio: Check for initial conditions to skip in the start

2024-11-09 Thread Andrew Morton
On Sat, 9 Nov 2024 22:20:01 -0800 Andrew Morton wrote: > On Fri, 8 Nov 2024 19:13:04 +0500 Muhammad Usama Anjum > wrote: > > > On 11/8/24 3:49 PM, Donet Tom wrote: > > > > > I think below changes are required. > > > > > > iff --git a/tools/testing/selftests/mm/hugetlb_dio.c > > > b/tools/t

Re: [PATCH] selftests: hugetlb_dio: Check for initial conditions to skip in the start

2024-11-09 Thread Andrew Morton
On Fri, 8 Nov 2024 19:13:04 +0500 Muhammad Usama Anjum wrote: > On 11/8/24 3:49 PM, Donet Tom wrote: > > > I think below changes are required. > > > > iff --git a/tools/testing/selftests/mm/hugetlb_dio.c > > b/tools/testing/selftests/mm/hugetlb_dio.c > > index 60001c142ce9..4b52106b8124 10064

Re: [RFC PATCH 1/3] module: Split module_enable_rodata_ro()

2024-11-09 Thread Daniel Gomez
On Sat Nov 9, 2024 at 11:35 AM CET, Christophe Leroy wrote: > module_enable_rodata_ro() is called twice, once before module init > to set rodata sections readonly and once after module init to set > rodata_after_init section readonly. > > The second time, only the rodata_after_init section needs to

Re: [RFC PATCH 2/3] module: Don't fail module loading when setting ro_after_init section RO failed

2024-11-09 Thread Daniel Gomez
On Sat Nov 9, 2024 at 11:35 AM CET, Christophe Leroy wrote: > Once module init has succeded it is too late to cancel loading. > If setting ro_after_init data section to read-only fails, all we > can do is to inform the user through a warning. > > Reported-by: Thomas Gleixner > Closes: > https://l

Re: [RFC PATCH 3/3] module: pre-test setting ro_after_init data read-only

2024-11-09 Thread Daniel Gomez
On Sat Nov 9, 2024 at 11:35 AM CET, Christophe Leroy wrote: > To be on the safe side, try to set ro_after_init data section readonly > at the same time as rodata. If it fails it will likely fail again > later so let's cancel module loading while we still can do it. > If it doesn't fail, put it back

Re: [PATCH v4 1/3] rust: kunit: add KUnit case and suite macros

2024-11-09 Thread Miguel Ojeda
On Sat, Nov 9, 2024 at 9:18 AM David Gow wrote: > > Is there somewhere else we can put the attribute to support this > without having to either disable the warning, or use the experimental > feature globally? Yeah, on the item, e.g. https://godbolt.org/z/oo8osadn4: const _: () = { st

[PROBLEM] selftests/bpf/progs/test_tunnel_kern.c: 678: 41-47: ERROR: application of sizeof to pointer

2024-11-09 Thread Mirsad Todorovac
Hi, all! In the linux-next tree, next-20241108, coccinelle found an error. In the line 617, ret = bpf_skb_set_tunnel_opt(skb, gopt, sizeof(local_gopt)); In the line 678, ret = bpf_skb_set_tunnel_opt(skb, gopt, sizeof(gopt)); when 592 struct local_geneve_opt local_gopt; 593 str

Re: [PATCH] kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL

2024-11-09 Thread Kuan-Wei Chiu
On Mon, Nov 04, 2024 at 08:16:30PM +0300, Dan Carpenter wrote: > The intent here was clearly to use the gfp variable flags instead of > hardcoding GFP_KERNEL. All the callers pass GFP_KERNEL as the gfp > flags so this doesn't affect runtime. > > Fixes: b3231d353a51 ("kunit: add a convenience allo

Re: [PATCH net-next v9 5/6] selftests: net: Add busy_poll_test

2024-11-09 Thread Willem de Bruijn
Joe Damato wrote: > Add an epoll busy poll test using netdevsim. > > This test is comprised of: > - busy_poller (via busy_poller.c) > - busy_poll_test.sh which loads netdevsim, sets up network namespaces, > and runs busy_poller to receive data and socat to send data. > > The selftest test

Re: [PATCH] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-09 Thread Kuan-Wei Chiu
On Sat, Nov 09, 2024 at 08:40:30PM +0800, Kuan-Wei Chiu wrote: > Hi Jinjie, > > On Thu, Oct 24, 2024 at 05:43:03PM +0800, Jinjie Ruan wrote: > > In kunit_debugfs_create_suite(), if alloc_string_stream() fails in the > > kunit_suite_for_each_test_case() loop, the "suite->log = stream" > > has assig

Re: [PATCH] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-09 Thread Kuan-Wei Chiu
Hi Jinjie, On Thu, Oct 24, 2024 at 05:43:03PM +0800, Jinjie Ruan wrote: > In kunit_debugfs_create_suite(), if alloc_string_stream() fails in the > kunit_suite_for_each_test_case() loop, the "suite->log = stream" > has assigned before, and the error path only free the suite->log's stream > memory b

[RFC PATCH 3/3] module: pre-test setting ro_after_init data read-only

2024-11-09 Thread Christophe Leroy
To be on the safe side, try to set ro_after_init data section readonly at the same time as rodata. If it fails it will likely fail again later so let's cancel module loading while we still can do it. If it doesn't fail, put it back to read-only, continue module loading and cross fingers so that it

[RFC PATCH 2/3] module: Don't fail module loading when setting ro_after_init section RO failed

2024-11-09 Thread Christophe Leroy
Once module init has succeded it is too late to cancel loading. If setting ro_after_init data section to read-only fails, all we can do is to inform the user through a warning. Reported-by: Thomas Gleixner Closes: https://lore.kernel.org/all/20230915082126.4187913-1-ruanjin...@huawei.com/ Fixes:

[RFC PATCH 1/3] module: Split module_enable_rodata_ro()

2024-11-09 Thread Christophe Leroy
module_enable_rodata_ro() is called twice, once before module init to set rodata sections readonly and once after module init to set rodata_after_init section readonly. The second time, only the rodata_after_init section needs to be set to read-only, no need to re-apply it to already set rodata.

Re: [PATCH RFC v3 4/4] module: refactor ro_after_init failure path

2024-11-09 Thread Christophe Leroy
Le 08/11/2024 à 17:12, Daniel Gomez via B4 Relay a écrit : [Vous ne recevez pas souvent de courriers de devnull+da.gomez.samsung@kernel.org. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] From: Daniel Gomez When ro_after_init fails, we need to

Re: [PATCH 1/6] lib: math: Move kunit tests into tests/ subdir

2024-11-09 Thread David Gow
On Thu, 7 Nov 2024 at 15:34, Geert Uytterhoeven wrote: > > Hi Andrew, > > On Wed, Nov 6, 2024 at 10:17 PM Andrew Morton > wrote: > > On Wed, 6 Nov 2024 09:33:55 +0100 Geert Uytterhoeven > > wrote: > > > > This conflicts with "[PATCH] m68k: defconfig: Update defconfigs for > > > > v6.12-rc1"[1]

Re: [PATCH] kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL

2024-11-09 Thread David Gow
On Tue, 5 Nov 2024 at 01:16, Dan Carpenter wrote: > > The intent here was clearly to use the gfp variable flags instead of > hardcoding GFP_KERNEL. All the callers pass GFP_KERNEL as the gfp > flags so this doesn't affect runtime. > > Fixes: b3231d353a51 ("kunit: add a convenience allocation wrap

Re: [PATCH] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-09 Thread David Gow
On Thu, 24 Oct 2024 at 17:43, Jinjie Ruan wrote: > > In kunit_debugfs_create_suite(), if alloc_string_stream() fails in the > kunit_suite_for_each_test_case() loop, the "suite->log = stream" > has assigned before, and the error path only free the suite->log's stream > memory but not set it to NULL

Re: [PATCH v4 1/3] rust: kunit: add KUnit case and suite macros

2024-11-09 Thread David Gow
On Sat, 2 Nov 2024 at 01:47, Boqun Feng wrote: > > On Fri, Nov 01, 2024 at 02:45:00PM +0800, David Gow wrote: > > From: José Expósito > > > > Add a couple of Rust const functions and macros to allow to develop > > KUnit tests without relying on generated C code: > > > > - The `kunit_unsafe_test_