Re: [PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-12 Thread kernel test robot
: 39f54262ba499d862420a97719d2f0eea0cbd394 patch link: https://lore.kernel.org/r/20250211-b4-ovpn-v19-25-86d5daf2a47a%40openvpn.net patch subject: [PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build

[PATCH v6 6/6] rust: add parameter support to the `module!` macro

2025-02-11 Thread Andreas Hindborg
This patch includes changes required for Rust kernel modules to utilize module parameters. This code implements read only support for integer types without `sysfs` support. Signed-off-by: Andreas Hindborg --- rust/kernel/lib.rs | 1 + rust/kernel/module_param.rs | 225

[PATCH v6 0/6] rust: extend `module!` macro with integer parameter support

2025-02-11 Thread Andreas Hindborg
This series extends the `module!` macro with support module parameters. It also adds some string to integer parsing functions and updates `BStr` with a method to strip a string prefix. This series stated out as code by Adam Bratschi-Kaye lifted from the original `rust` branch [1]. After a bit of

[PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-10 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, 4 scripts

Re: [RFC PATCH v2 2/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-02-10 Thread Colton Lewis
counters HPMN..N are only accessible by EL2. Introduce a module parameter in the PMUv3 driver to set this register. The name reserved_host_counters reflects the intent to reserve some counters for the host so the guest may eventually be allowed direct access to a subset of PMU functionality for

Re: [RFC PATCH v2 2/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-02-09 Thread Oliver Upton
gt; Introduce a module parameter in the PMUv3 driver to set this > register. The name reserved_host_counters reflects the intent to > reserve some counters for the host so the guest may eventually be > allowed direct access to a subset of PMU functionality for increased > performance.

[PATCH] selftests: proofreading bpf module

2025-02-09 Thread Armin
Fixed multiple spelling issues in the kselftests bpf modules. Signed-off-by: Armin --- tools/testing/selftests/bpf/Makefile| 2 +- tools/testing/selftests/bpf/bench.c | 2 +- tools/testing/selftests/bpf/prog_tests/btf_dump.c | 2 +- tools

[RFC PATCH v2 2/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-02-07 Thread Colton Lewis
For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if allowed, EL0 while counters HPMN..N are only accessible by EL2. Introduce a module parameter in the PMUv3 driver to set this register. The name

Re: [PATCH -v2 0/7] module: Strict per-modname namespaces

2025-02-07 Thread Masahiro Yamada
> modules. By explicitly limiting the usage of certain exports, the abuse > >> potential/risk is greatly reduced. > >> > >> The first 'patch' is an awk scripts that cleans up the existing module > >> namespace code along the same lines of commit 33d

Re: [PATCH -v2 3/7] module/modpost: Add basename helper

2025-02-07 Thread Masahiro Yamada
mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -1553,6 +1553,16 @@ static void mod_set_crcs(struct module * > free(buf); > } > > +static const char *mod_basename(const char *modname) > +{ > + const char *basename = strrchr(modname, '/'); > +

Re: [PATCH -v2 2/7] module/modpost: Use for() loop

2025-02-07 Thread Masahiro Yamada
The commit subject prefix should be "modpost: " instead of "module/modpost: " You are touching only modpost in this patch. On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: > > > Signed-off-by: Peter Zijlstra (Intel) > --- > scripts/mod/modpost.c

Re: [PATCH -v2 4/7] module: Add module specific symbol namespace support

2025-02-07 Thread Masahiro Yamada
On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: > > Designate the "MODULE_${modname}" symbol namespace to mean: 'only > export to the named module'. > > Notably, explicit imports of anything in the "MODULE_" space is > forbidden. Modules

Re: [PATCH -v2 5/7] module: Extend the MODULE_ namespace parsing

2025-02-07 Thread Masahiro Yamada
On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: > > Instead of only accepting "MODULE_${name}", extend it with a comma > separated list of module names and add tail glob support. > > That is, something like: "MODULE_foo-*,bar" is now possible. >

Re: [PATCH -v2 2/7] module/modpost: Use for() loop

2025-02-07 Thread Masahiro Yamada
On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: Please add a commit description. > > Signed-off-by: Peter Zijlstra (Intel) > --- > scripts/mod/modpost.c |7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) > > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@

Re: [PATCH -v2 5/7] module: Extend the MODULE_ namespace parsing

2025-02-07 Thread Masahiro Yamada
On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: > > Instead of only accepting "MODULE_${name}", extend it with a comma > separated list of module names and add tail glob support. > > That is, something like: "MODULE_foo-*,bar" is now possible. >

Re: [PATCH -v2 7/7] module: Provide EXPORT_SYMBOL_GPL_FOR() helper

2025-02-07 Thread Masahiro Yamada
On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra wrote: > Commit description is needed. [bikeshed] Perhaps, I slightly prefer EXPORT_SYMBOL_GPL_FOR_MODULES(). > > -#define ___EXPORT_SYMBOL(sym, license, ns) \ > +/* > + * LLVM intregrated assembler refuses to merge adjacent string

Re: [PATCH -v2 0/7] module: Strict per-modname namespaces

2025-02-05 Thread Petr Pavlu
tial/risk is greatly reduced. >> >> The first 'patch' is an awk scripts that cleans up the existing module >> namespace code along the same lines of commit 33def8498fdd ("treewide: >> Convert >> macro and uses of __section(foo) to __section("foo

[PATCH v5 5/5] rust: add parameter support to the `module!` macro

2025-02-04 Thread Andreas Hindborg
This patch includes changes required for Rust kernel modules to utilize module parameters. This code implements read only support for integer types without `sysfs` support. Signed-off-by: Andreas Hindborg --- rust/kernel/lib.rs | 1 + rust/kernel/module_param.rs | 225

[PATCH v5 0/5] rust: extend `module!` macro with integer parameter support

2025-02-04 Thread Andreas Hindborg
This series extends the `module!` macro with support module parameters. It also adds some string to integer parsing functions and updates `BStr` with a method to strip a string prefix. This series stated out as code by Adam Bratschi-Kaye lifted from the original `rust` branch [1]. After a bit of

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-02-03 Thread Colton Lewis
Colton Lewis writes: Marc Zyngier writes: On Tue, 28 Jan 2025 22:08:27 +, Colton Lewis wrote: >> + bitmap_set(cpu_pmu->cntr_mask, 0, pmcr_n); >> + >> + if (reserved_guest_counters > 0 && reserved_guest_counters < pmcr_n) { >> + cpu_pmu->hpmn = reserved_guest_c

[PATCH rcu v2] 02/11] rcutorture: Add a test_boost_holdoff module parameter

2025-01-30 Thread Paul E. McKenney
This commit adds a test_boost_holdoff module parameter that tells the RCU priority-boosting tests to wait for the specified number of seconds past the start of the rcutorture test. This can be useful when rcutorture is built into the kernel (as opposed to being modprobed), especially on large

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-30 Thread Petr Pavlu
On 1/29/25 09:52, Sebastian Andrzej Siewior wrote: > On 2025-01-27 13:22:17 [+0100], Petr Pavlu wrote: >> On 1/24/25 18:49, Sebastian Andrzej Siewior wrote: >>> On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote: Thanks for this cleanup. I've queued the fix in patch #1 on modules-fixes. For

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-29 Thread Colton Lewis
Marc Zyngier writes: On Tue, 28 Jan 2025 22:08:27 +, Colton Lewis wrote: >> + bitmap_set(cpu_pmu->cntr_mask, 0, pmcr_n); >> + >> + if (reserved_guest_counters > 0 && reserved_guest_counters < pmcr_n) { >> + cpu_pmu->hpmn = reserved_guest_counters; >> +

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-29 Thread Marc Zyngier
On Tue, 28 Jan 2025 22:08:27 +, Colton Lewis wrote: > > >> + bitmap_set(cpu_pmu->cntr_mask, 0, pmcr_n); > >> + > >> + if (reserved_guest_counters > 0 && reserved_guest_counters < pmcr_n) { > >> + cpu_pmu->hpmn = reserved_guest_counters; > >> + cpu_pmu->partitioned = true;

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-29 Thread Sebastian Andrzej Siewior
On 2025-01-27 13:22:17 [+0100], Petr Pavlu wrote: > On 1/24/25 18:49, Sebastian Andrzej Siewior wrote: > > On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote: > >> Thanks for this cleanup. I've queued the fix in patch #1 on > >> modules-fixes. For the rest, I plan to give folks more time to look at >

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
Colton Lewis writes: Hey Marc, thanks for looking. *for the review Marc Zyngier writes: On Mon, 27 Jan 2025 22:20:27 +, Colton Lewis wrote: /* Read the nb of CNTx counters supported from PMNC */ - bitmap_set(cpu_pmu->cntr_mask, - 0, FIELD_GET(ARM

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
or 'cpu_pmu->hpmn != pmcr_n'. Yes, because code outside this module that isn't already reading PMCR.N will need to know the result of that comparion. + } else { + reserved_guest_counters = 0; + cpu_pmu->hpmn = pmcr_n; + cpu

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
accessible by EL2. Introduce a module parameter in the PMUv3 driver to set this register. The name reserved_guest_counters reflects the intent to reserve some counters for the guest so they may eventually be allowed direct access to a subset of PMU functionality for increased performance

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Rob Herring
On Mon, Jan 27, 2025 at 4:26 PM Colton Lewis wrote: > > For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters > into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if > allowed, EL0 while counters HPMN..N are only accessible by EL2. > > Introduce a m

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Marc Zyngier
On Mon, 27 Jan 2025 22:20:27 +, Colton Lewis wrote: > > For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters > into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if > allowed, EL0 while counters HPMN..N are only accessible by EL2. > >

[RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-27 Thread Colton Lewis
For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if allowed, EL0 while counters HPMN..N are only accessible by EL2. Introduce a module parameter in the PMUv3 driver to set this register. The name

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-27 Thread Petr Pavlu
On 1/24/25 18:49, Sebastian Andrzej Siewior wrote: > On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote: >> Thanks for this cleanup. I've queued the fix in patch #1 on >> modules-fixes. For the rest, I plan to give folks more time to look at >> the changes as this affects a number of subsystems. If t

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-24 Thread Sebastian Andrzej Siewior
On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote: > Thanks for this cleanup. I've queued the fix in patch #1 on > modules-fixes. For the rest, I plan to give folks more time to look at > the changes as this affects a number of subsystems. If there are no > other concerns, I'd then add the series on

Re: [PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-22 Thread Andreas Hindborg
"Petr Pavlu" writes: > On 1/9/25 11:54, Andreas Hindborg wrote: >> This patch includes changes required for Rust kernel modules to utilize >> module parameters. This code implements read only support for integer >> types without `sysfs` support. >> [cut] &

Re: [PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-22 Thread Petr Pavlu
On 1/9/25 11:54, Andreas Hindborg wrote: > This patch includes changes required for Rust kernel modules to utilize > module parameters. This code implements read only support for integer > types without `sysfs` support. > > Signed-off-by: Andreas Hindborg > --- >

[PATCH rcu 02/11] rcutorture: Add a test_boost_holdoff module parameter

2025-01-16 Thread Paul E. McKenney
This commit adds a test_boost_holdoff module parameter that tells the RCU priority-boosting tests to wait for the specified number of seconds past the start of the rcutorture test. This can be useful when rcutorture is built into the kernel (as opposed to being modprobed), especially on large

[PATCH v1 17/19] samples/livepatch: Replace sample module with obsolete per-object callbacks

2025-01-15 Thread Petr Mladek
follow the naming scheme of the existing sample modules. Also only one version of the test module and one version of the livepatch module is built. Signed-off-by: Petr Mladek --- samples/livepatch/Makefile| 5 +- .../livepatch/livepatch-callbacks-busymod.c | 60

[PATCH v1 07/19] selftests/livepatch: Substitute hard-coded /sys/module path

2025-01-15 Thread Petr Mladek
Substitute hard-coded /sys/module path with $SYSFS_MODULE_DIR. It is going to be used even more often in the upcoming selftests. Signed-off-by: Petr Mladek --- tools/testing/selftests/livepatch/functions.sh | 18 ++ .../selftests/livepatch/test-callbacks.sh | 2 +- 2 files

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-13 Thread Petr Pavlu
On 1/10/25 20:16, Luis Chamberlain wrote: > On Thu, Jan 09, 2025 at 11:52:27AM +0100, Arnout Engelen wrote: >> On Fri, 3 Jan 2025 17:37:52 -0800, Luis Chamberlain wrote: >>> What distro which is using module signatures would switch >>> to this as an alternative instead?

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-13 Thread Sebastian Andrzej Siewior
On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote: > Thanks for this cleanup. I've queued the fix in patch #1 on > modules-fixes. For the rest, I plan to give folks more time to look at > the changes as this affects a number of subsystems. If there are no > other concerns, I'd then add the series on

Re: [PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-13 Thread Petr Pavlu
On 1/8/25 10:04, Sebastian Andrzej Siewior wrote: > This is an updated version of the initial post after PeterZ made me > aware that there are users outside of the module directory. > The goal is replace the mix auf rcu_read_lock(), rcu_read_lock_sched() > and preempt_disable

[PATCH net-next v18 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-13 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, 4 scripts

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-13 Thread Fabian Grünbichler
On January 4, 2025 2:37 am, Luis Chamberlain wrote: > On Wed, Dec 25, 2024 at 11:52:00PM +0100, Thomas Weißschuh wrote: >> diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig >> index >> 7b329057997ad2ec310133ca84617d9bfcdb7e9f..57d317a6fa444195d0806e6bd7a2af6e338a7f0

Re: [PATCH net-next v17 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-11 Thread Antonio Quartulli
Hey Jakub, I just realized that I forgot to fix the nla_get_uint clash triggered on Fedora. However, I'd rather not send a new patchset right away... Maybe we will be happy with this version and then I will just resend this patch alone. Best Regards, -- Antonio Quartulli OpenVPN Inc.

[PATCH net-next v17 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-10 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, 4 scripts

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-10 Thread Luis Chamberlain
On Thu, Jan 09, 2025 at 11:52:27AM +0100, Arnout Engelen wrote: > On Fri, 3 Jan 2025 17:37:52 -0800, Luis Chamberlain wrote: > > What distro which is using module signatures would switch > > to this as an alternative instead? > > In NixOS, we disable MODULE_SIG by defa

Re: [PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-09 Thread Greg KH
On Thu, Jan 09, 2025 at 02:03:39PM +0100, Andreas Hindborg wrote: > "Greg KH" writes: > > > On Thu, Jan 09, 2025 at 11:54:59AM +0100, Andreas Hindborg wrote: > >> This patch includes changes required for Rust kernel modules to utilize > >> module pa

Re: [PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-09 Thread Andreas Hindborg
"Greg KH" writes: > On Thu, Jan 09, 2025 at 11:54:59AM +0100, Andreas Hindborg wrote: >> This patch includes changes required for Rust kernel modules to utilize >> module parameters. This code implements read only support for integer >> types without `sysfs` suppo

Re: [PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-09 Thread Greg KH
On Thu, Jan 09, 2025 at 11:54:59AM +0100, Andreas Hindborg wrote: > This patch includes changes required for Rust kernel modules to utilize > module parameters. This code implements read only support for integer > types without `sysfs` support. I know you want to keep this simple for

[PATCH v4 0/4] rust: extend `module!` macro with integer parameter support

2025-01-09 Thread Andreas Hindborg
This series extends the `module!` macro with support module parameters. It also adds some string to integer parsing functions and updates `BStr` with a method to strip a string prefix. This series stated out as code by Adam Bratschi-Kaye lifted from the original `rust` branch [1]. After a bit of

[PATCH v4 4/4] rust: add parameter support to the `module!` macro

2025-01-09 Thread Andreas Hindborg
This patch includes changes required for Rust kernel modules to utilize module parameters. This code implements read only support for integer types without `sysfs` support. Signed-off-by: Andreas Hindborg --- rust/kernel/lib.rs | 1 + rust/kernel/module_param.rs | 225

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-09 Thread Arnout Engelen
On Fri, 3 Jan 2025 17:37:52 -0800, Luis Chamberlain wrote: > What distro which is using module signatures would switch > to this as an alternative instead? In NixOS, we disable MODULE_SIG by default (because we value reproducibility over having module signatures). Enabling MODULE_HAS

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

2025-01-08 Thread Luis Chamberlain
On Mon, Jan 06, 2025 at 04:13:29PM -0800, Kees Cook wrote: > On Fri, Jan 03, 2025 at 05:13:32PM +0100, Petr Pavlu wrote: > > On 12/5/24 20:46, Christophe Leroy wrote: > > > This series reworks module loading to avoid leaving the module in a > > > stale state when prote

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-08 Thread Luis Chamberlain
On Sat, Jan 04, 2025 at 07:30:39AM +0100, Thomas Weißschuh wrote: > Hi Luis, > > On 2025-01-03 17:37:52-0800, Luis Chamberlain wrote: > > On Wed, Dec 25, 2024 at 11:52:00PM +0100, Thomas Weißschuh wrote: > > > diff --git a/kernel/module/Kconfig b/kernel/mo

Re: [PATCH v3 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-08 Thread Sebastian Andrzej Siewior
On 2025-01-08 10:55:04 [+0100], Helge Deller wrote: > Nice catch. > > Acked-by: Helge Deller > > This patch really should be backported. > Can you add a Cc: stable tag? It should be picked due to the fixes tag. I add it if I am going to repost it. > Helge Sebastian

Re: [PATCH v3 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-08 Thread Helge Deller
On 1/8/25 10:04, Sebastian Andrzej Siewior wrote: dereference_symbol_descriptor() needs to obtain the module pointer belonging to pointer in order to resolve that pointer. The returned mod pointer is obtained under RCU-sched/ preempt_disable() guarantees and needs to be used within this section

[PATCH v3 03/28] module: Use proper RCU assignment in add_kallsyms().

2025-01-08 Thread Sebastian Andrzej Siewior
add_kallsyms() assigns the RCU pointer module::kallsyms and setups the structures behind it which point to init-data. The module was not published yet, nothing can see the kallsyms pointer and the data behind it. Also module's init function was not yet invoked. There is no need t

[PATCH v3 09/28] module: Remove module_assert_mutex_or_preempt() from try_add_tainted_module().

2025-01-08 Thread Sebastian Andrzej Siewior
Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/tracking.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 16742d1c630c6..4fefec5b683c6 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c

[PATCH v3 16/28] ARM: module: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
-by: Sebastian Andrzej Siewior --- arch/arm/kernel/module-plts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index da2ee8d6ef1a7..354ce16d83cb5 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel

[PATCH v3 14/28] module: Use RCU in all users of __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
+-- kernel/module/kallsyms.c | 5 + kernel/module/main.c | 9 ++--- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 1c6a6c1704d8d..d5dd54c53ace6 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h

[PATCH v3 15/28] module: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c

[PATCH v3 13/28] module: Use RCU in search_module_extables().

2025-01-08 Thread Sebastian Andrzej Siewior
search_module_extables() returns an exception_table_entry belonging to a module. The lookup via __module_address() can be performed with RCU protection. The returned exception_table_entry remains valid because the passed address usually belongs to a module that is currently executed. So the module

[PATCH v3 08/28] module: Use RCU in module_kallsyms_on_each_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v3 10/28] module: Use RCU in find_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
find_symbol() and update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c| 30 -- kernel/module/version.c | 14 +++--- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/kernel/module

[PATCH v3 12/28] module: Allow __module_address() to be called from RCU section.

2025-01-08 Thread Sebastian Andrzej Siewior
mod_find() uses either the modules list to find a module or a tree lookup (CONFIG_MODULES_TREE_LOOKUP). The list and the tree can both be iterated under RCU assumption (as well as RCU-sched). Remove module_assert_mutex_or_preempt() from __module_address() and entirely since __module_address() is

[PATCH v3 11/28] module: Use RCU in __is_module_percpu_address().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list can be accessed under RCU assumption. Use RCU protection instead preempt_disable(). Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/module/main.c

[PATCH v3 07/28] module: Use RCU in __find_kallsyms_symbol_value().

2025-01-08 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 17 - 1 file changed, 4 insertions(+), 13 deletions

[PATCH v3 04/28] module: Use RCU in find_kallsyms_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list and module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to reference the kallsyms pointer in find_kallsyms_symbol(). Use a RCU section instead of preempt_disable in callers of find_kallsyms_symbol(). Keep the preempt-disable in module_address_lookup

[PATCH v3 02/28] module: Begin to move from RCU-sched to RCU.

2025-01-08 Thread Sebastian Andrzej Siewior
The RCU usage in module was introduced in commit d72b37513cdfb ("Remove stop_machine during module load v2") and it claimed not to be RCU but similar. Then there was another improvement in commit e91defa26c527 ("module: don't use stop_machine on module load"). It become a

[PATCH v3 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-08 Thread Sebastian Andrzej Siewior
dereference_symbol_descriptor() needs to obtain the module pointer belonging to pointer in order to resolve that pointer. The returned mod pointer is obtained under RCU-sched/ preempt_disable() guarantees and needs to be used within this section to ensure that the module is not removed in the

[PATCH v3 05/28] module: Use RCU in module_get_kallsym().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list and module::kallsyms can be accessed under RCU assumption. Iterate the modules with RCU protection, use rcu_dereference() to access the kallsyms pointer. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file

[PATCH v3 00/28] module: Use RCU instead of RCU-sched.

2025-01-08 Thread Sebastian Andrzej Siewior
Hi, This is an updated version of the initial post after PeterZ made me aware that there are users outside of the module directory. The goal is replace the mix auf rcu_read_lock(), rcu_read_lock_sched() and preempt_disable() with just rcu_read_lock(). I've split it into smaller chunks whic

Re: [PATCH v2 00/28] module: Use RCU instead of RCU-sched.

2025-01-07 Thread Sebastian Andrzej Siewior
On 2025-01-02 13:47:06 [+0100], Christophe Leroy wrote: > Hi Sebastian, Hi Christophe, > How did you generate that cover letter ? > > It should contain the full list of files modified by the series, so that I > can see if any of them is of interest to me without going into each patch. > > This i

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

2025-01-07 Thread Daniel Gomez
On Mon, Jan 06, 2025 at 04:13:29PM -0800, Kees Cook wrote: > On Fri, Jan 03, 2025 at 05:13:32PM +0100, Petr Pavlu wrote: > > On 12/5/24 20:46, Christophe Leroy wrote: > > > This series reworks module loading to avoid leaving the module in a > > > stale state when prote

Re: [PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-07 Thread Sergey Senozhatsky
On (24/12/20 18:41), Sebastian Andrzej Siewior wrote: > dereference_symbol_descriptor() needs to obtain the module pointer > belonging to pointer in order to resolve that pointer. > The returned mod pointer is obtained under RCU-sched/ preempt_disable() > guarantees and needs to be

Re: [PATCH v2 00/28] module: Use RCU instead of RCU-sched.

2025-01-07 Thread Peter Zijlstra
On Fri, Dec 20, 2024 at 06:41:14PM +0100, Sebastian Andrzej Siewior wrote: > Hi, > > This is an updated version of the inital post after PeterZ made me aware > that there are users outside of the module directory. > The goal is replace the mix auf rcu_read_lock(), rcu_read_loc

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

2025-01-06 Thread Kees Cook
On Fri, Jan 03, 2025 at 05:13:32PM +0100, Petr Pavlu wrote: > On 12/5/24 20:46, Christophe Leroy wrote: > > This series reworks module loading to avoid leaving the module in a > > stale state when protecting ro_after_init section fails. > > > > Once module init has

Re: [PATCH v2] module: sign with sha512 instead of sha1 by default

2025-01-06 Thread Thorsten Leemhuis
On 06.01.25 15:05, Petr Pavlu wrote: > On 1/4/25 10:43, Thorsten Leemhuis wrote: >> On 20.10.24 00:57, Luis Chamberlain wrote: >>> On Wed, Oct 16, 2024 at 04:18:41PM +0200, Thorsten Leemhuis wrote: >>>> Switch away from using sha1 for module signing by defaul

Re: [PATCH v2] module: sign with sha512 instead of sha1 by default

2025-01-06 Thread Petr Pavlu
On 1/4/25 10:43, Thorsten Leemhuis wrote: > On 20.10.24 00:57, Luis Chamberlain wrote: >> On Wed, Oct 16, 2024 at 04:18:41PM +0200, Thorsten Leemhuis wrote: >>> Switch away from using sha1 for module signing by default and use the >>> more modern sha512 instead, whic

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

2025-01-06 Thread Petr Pavlu
On 1/4/25 08:39, Christophe Leroy wrote: > Le 03/01/2025 à 17:13, Petr Pavlu a écrit : >> On 12/5/24 20:46, Christophe Leroy wrote: >>> This series reworks module loading to avoid leaving the module in a >>> stale state when protecting ro_after_init section fails. &

Re: [PATCH v2] module: sign with sha512 instead of sha1 by default

2025-01-04 Thread Thorsten Leemhuis
On 20.10.24 00:57, Luis Chamberlain wrote: > On Wed, Oct 16, 2024 at 04:18:41PM +0200, Thorsten Leemhuis wrote: >> Switch away from using sha1 for module signing by default and use the >> more modern sha512 instead, which is what among others Arch, Fedora, >> RHEL, and Ubunt

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

2025-01-03 Thread Christophe Leroy
ainly the earlier described limitation of the current init_module() interface and the consistency of the module loader interface as a whole. Another aspect is that a number of modules is loaded directly by the kernel via request_module(). I'm not sure how the new error would be handled in such ca

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

2025-01-03 Thread Christophe Leroy
Le 03/01/2025 à 17:13, Petr Pavlu a écrit : On 12/5/24 20:46, Christophe Leroy wrote: This series reworks module loading to avoid leaving the module in a stale state when protecting ro_after_init section fails. Once module init has succeded it is too late to cancel loading. If setting

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-03 Thread Thomas Weißschuh
Hi Luis, On 2025-01-03 17:37:52-0800, Luis Chamberlain wrote: > On Wed, Dec 25, 2024 at 11:52:00PM +0100, Thomas Weißschuh wrote: > > diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig > > index > > 7b329057997ad2ec310133ca84617d9bfcdb7e9f..57d317a6fa444195d08

Re: [PATCH RFC 2/2] module: Introduce hash-based integrity checking

2025-01-03 Thread Luis Chamberlain
On Wed, Dec 25, 2024 at 11:52:00PM +0100, Thomas Weißschuh wrote: > diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig > index > 7b329057997ad2ec310133ca84617d9bfcdb7e9f..57d317a6fa444195d0806e6bd7a2af6e338a7f01 > 100644 > --- a/kernel/module/Kconfig > +++ b/ker

[PATCH v8 18/18] Documentation/kbuild: Add DWARF module versioning

2025-01-03 Thread Sami Tolvanen
ation/kbuild/gendwarfksyms.rst @@ -0,0 +1,308 @@ +=== +DWARF module versioning +=== + +1. Introduction +=== + +When CONFIG_MODVERSIONS is enabled, symbol versions for modules +are typically calculated from preprocessed source code using the +**gen

Re: [PATCH 0/3] module: Make .static_call_sites read-only after init

2025-01-03 Thread Petr Pavlu
On 1/3/25 15:06, Christophe Leroy wrote: > Le 23/12/2024 à 10:37, Petr Pavlu a écrit : >> Section .static_call_sites holds data structures that need to be sorted and >> processed only at module load time. The section is never modified afterwards. >> Make it therefore r

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

2025-01-03 Thread Petr Pavlu
On 12/5/24 20:46, Christophe Leroy wrote: > This series reworks module loading to avoid leaving the module in a > stale state when protecting ro_after_init section fails. > > Once module init has succeded it is too late to cancel loading. > If setting ro_after_init data section to

Re: [PATCH 1/2] module: get symbol crc back to unsigned

2025-01-03 Thread Masahiro Yamada
he __kcrctab > > and __kcrctab_gpl sections directly contain the CRC values in all cases. > > > > The genksyms tool outputs unsigned 32-bit CRC values, so u32 is preferred > > over s32. > > > > No functional changes are intended. > > > > Regardless of this

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

2025-01-03 Thread Petr Pavlu
, 2024 at 7:53 PM CET, Christophe Leroy wrote: >>>>>> >>>>>> >>>>>> Le 09/11/2024 à 23:17, Daniel Gomez a écrit : >>>>>>> On Sat Nov 9, 2024 at 11:35 AM CET, Christophe Leroy wrote: >>>>>>>> Once module init has succeded i

Re: [PATCH 0/3] module: Make .static_call_sites read-only after init

2025-01-03 Thread Christophe Leroy
Hi Petr, Le 23/12/2024 à 10:37, Petr Pavlu a écrit : Section .static_call_sites holds data structures that need to be sorted and processed only at module load time. The section is never modified afterwards. Make it therefore read-only after module initialization to avoid any (non-)accidental

Re: [PATCH v2 00/28] module: Use RCU instead of RCU-sched.

2025-01-02 Thread Christophe Leroy
Hi Sebastian, Le 20/12/2024 à 18:41, Sebastian Andrzej Siewior a écrit : Hi, This is an updated version of the inital post after PeterZ made me aware that there are users outside of the module directory. The goal is replace the mix auf rcu_read_lock(), rcu_read_lock_sched() and preempt_disable

Re: [PATCH net-next v16 26/26] testing/selftests: add test tool and scripts for ovpn module

2024-12-30 Thread Antonio Quartulli
On 20/12/24 05:02, Jakub Kicinski wrote: On Thu, 19 Dec 2024 02:42:20 +0100 Antonio Quartulli wrote: +uint64_t nla_get_uint(struct nlattr *attr) +{ + if (nla_len(attr) == sizeof(uint32_t)) + return nla_get_u32(attr); + else + return nla_get_u64(attr); +}

Re: [PATCH 1/2] module: get symbol crc back to unsigned

2024-12-30 Thread Petr Pavlu
> The genksyms tool outputs unsigned 32-bit CRC values, so u32 is preferred > over s32. > > No functional changes are intended. > > Regardless of this change, the CRC value is assigned to the u32 variable, > 'crcval' before the comparison, as seen in kernel/module/versio

Re: [PATCH 1/2] module: get symbol crc back to unsigned

2024-12-28 Thread Masahiro Yamada
l cases. > > The genksyms tool outputs unsigned 32-bit CRC values, so u32 is preferred > over s32. > > No functional changes are intended. > > Regardless of this change, the CRC value is assigned to the u32 variable, > 'crcval' before the comparison, as seen in kerne

[PATCH 1/2] module: get symbol crc back to unsigned

2024-12-28 Thread Masahiro Yamada
nctional changes are intended. Regardless of this change, the CRC value is assigned to the u32 variable, 'crcval' before the comparison, as seen in kernel/module/version.c: crcval = *crc; Signed-off-by: Masahiro Yamada --- include/linux/module.h | 4 ++-- kernel/module/inte

[PATCH v2 3/3] btf: Switch module BTF attribute to sysfs_bin_attr_simple_read()

2024-12-28 Thread Thomas Weißschuh
The generic function from the sysfs core can replace the custom one. Signed-off-by: Thomas Weißschuh Acked-by: Andrii Nakryiko --- kernel/bpf/btf.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index e5a5f023cedd5c288c2

[PATCH RFC 2/2] module: Introduce hash-based integrity checking

2024-12-25 Thread Thomas Weißschuh
The current signature-based module integrity checking has some drawbacks in combination with reproducible builds: Either the module signing key is generated at build time, which makes the build unreproducible, or a static key is used, which precludes rebuilds by third parties and makes the whole

[PATCH RFC 0/2] module: Introduce hash-based integrity checking

2024-12-25 Thread Thomas Weißschuh
The current signature-based module integrity checking has some drawbacks in combination with reproducible builds: Either the module signing key is generated at build time, which makes the build unreproducible, or a static key is used, which precludes rebuilds by third parties and makes the whole

Re: [PATCH v7 01/16] rust: module: add trait `ModuleMetadata`

2024-12-24 Thread Gary Guo
On Thu, 19 Dec 2024 18:04:03 +0100 Danilo Krummrich wrote: > In order to access static metadata of a Rust kernel module, add the > `ModuleMetadata` trait. > > In particular, this trait provides the name of a Rust kernel module as > specified by the `module!` macro. > >

  1   2   3   4   5   6   7   8   9   10   >