d);
> - __type_expand(cache, &child, true);
> - type_map_add(name, &child);
> - type_expansion_free(&child);
> - }
Nit: This code was the only user of __cache_was_expanded() and
__cache_mark_expanded(). It is now possible to merge
__cache_was_expanded() into cache_was_expanded() and
__cache_mark_expanded() into cache_mark_expanded().
Looks ok to me otherwise, feel free to add:
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
On 6/10/25 8:51 PM, Daniel Gomez wrote:
> On 07/06/2025 18.16, Petr Pavlu wrote:
>> The function move_module() uses the variable t to track how many memory
>> types it has allocated and consequently how many should be freed if an
>> error occurs.
>>
>> The vari
On 6/7/25 6:16 PM, Petr Pavlu wrote:
> The function move_module() uses the variable t to track how many memory
> types it has allocated and consequently how many should be freed if an
> error occurs.
>
> The variable is initially set to 0 and is updated when a call to
> m
underlying type.
Fixes: c7ee8aebf6c0 ("module: add stop-grap sanity check on module memcpy()")
Signed-off-by: Petr Pavlu
---
kernel/module/main.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 08b59c37735e..322b38c0a
All error conditions in move_module() set the return value by updating the
ret variable. Therefore, it is not necessary to the initialize the variable
when declaring it.
Remove the unnecessary initialization.
Signed-off-by: Petr Pavlu
---
kernel/module/main.c | 2 +-
1 file changed, 1
The first patch is an actual fix. The second patch is a minor related
cleanup.
Petr Pavlu (2):
module: Fix memory deallocation on error path in move_module()
module: Avoid unnecessary return value initialization in move_module()
kernel/module/main.c | 9 +
1 file changed, 5
On 6/5/25 5:54 PM, Sebastian Andrzej Siewior wrote:
> On 2025-06-05 15:44:23 [+0200], Petr Pavlu wrote:
>> Isn't this broken earlier by "Don't relocate non-allocated regions in
>> modules."
>> (pre-Git, [1])?
>
> Looking further back into the histo
On 6/5/25 8:07 AM, Sebastian Andrzej Siewior wrote:
> The per-CPU data section is handled differently than the other sections.
> The memory allocations requires a special __percpu pointer and then the
> section is copied into the view of each CPU. Therefore the SHF_ALLOC
> flag is removed to ensure
e in the global scope, we would worry about the symbol
> uniqueness, but modpost is fine with parsing multiple symbols with the
> same name.
>
> Signed-off-by: Masahiro Yamada
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
discussed previously, we rotate module maintainership among its
co-maintainers every 6 months. Daniel Gomez is next in line and he will
send the next pull request for the modules.
Petr Pavlu (3):
module: Constify parameters of
st: module "foo" uses symbol "bar", which is exported only for
> module "baz"
>
> Apply the same logic for kernel space as well.
>
> Fixes: 092a4f5985f2 ("module: Add module specific symbol namespace support")
> Signed-off-by: Masah
On 5/17/25 08:48, Masahiro Yamada wrote:
> On Wed, May 14, 2025 at 5:48 PM Petr Pavlu wrote:
>>
>> On 5/2/25 16:12, Peter Zijlstra wrote:
>>> Hi!
>>>
>>> Implement means for exports to be available to an explicit list of named
>>> modules. By ex
On 5/15/25 12:04, Joel Granados wrote:
> On Thu, May 15, 2025 at 10:04:53AM +0200, Petr Pavlu wrote:
>> On 5/9/25 14:54, Joel Granados wrote:
>>> Move module sysctl (modprobe_path and modules_disabled) out of sysctl.c
>>> and into the modules subsystem. Make the mo
On 5/9/25 14:54, Joel Granados wrote:
> Move module sysctl (modprobe_path and modules_disabled) out of sysctl.c
> and into the modules subsystem. Make the modprobe_path variable static
> as it no longer needs to be exported. Remove module.h from the includes
> in sysctl as it no longer uses any mod
On 5/2/25 16:12, Peter Zijlstra wrote:
> Hi!
>
> Implement means for exports to be available to an explicit list of named
> modules. By explicitly limiting the usage of certain exports, the abuse
> potential/risk is greatly reduced.
>
> Changes since v2:
>
> - switch to "module:" prefix (Masahi
#x27; and chokes on:
> + *
> + * .asciz "MODULE_" "kvm" ;
> + */
Typo: "cam" -> "can't". I can correct it when picking up the series.
Reviewed-by: Petr Pavlu
-- Petr
> +#define ___EXPORT_SYMBOL(sym, license, ns
> + for (int i = 0; i < n; i++) {
Nit: This could be 'size_t i' for consistency. I can adjust it when
picking up the series.
Reviewed-by: Petr Pavlu
-- Petr
> + char a = str_a[i];
> + char b = str_b[i];
> + int d;
> +
> +
On 5/2/25 16:12, 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.
>
> Signed-off-by: Pete
ijlstra (Intel)
Sorry, I thought this was already reviewed from the modules perspective,
but I'll make it explicit.
Looks ok to me, besides the already mentioned "strsmp" typo. I can fix
it when picking up the series.
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
st if the module is built separately.
>
> To fix this it is necessary to generate the same modalias for vmlinux as
> for the individual modules. Fortunately '.vmlinux.export.o' is already
> generated from which '.modinfo' can be extracted in the same way as for
> vmlinux.o.
>
> Signed-off-by: Masahiro Yamada
> Signed-off-by: Alexey Gladkov
Reviewed-by: Petr Pavlu
-- Petr
On 5/9/25 18:42, Alexey Gladkov wrote:
> In order to avoid symbol conflicts if they appear in the same binary, a
> more unique alias identifier can be generated.
>
> Signed-off-by: Alexey Gladkov
Reviewed-by: Petr Pavlu
-- Petr
t; builtin modules.
>
> Signed-off-by: Alexey Gladkov
Reviewed-by: Petr Pavlu
-- Petr
On 5/10/25 23:01, Kent Overstreet wrote:
> Static keys can now be a module parameter, e.g.
>
> module_param_named(foo, foo.key, static_key_t, 0644)
>
> bcachefs is now using this.
>
> Cc: Luis Chamberlain
> Cc: Petr Pavlu
> Cc: Sami Tolvanen
> Cc:
On 5/9/25 18:19, Linus Torvalds wrote:
> On Fri, 9 May 2025 at 08:09, Petr Pavlu wrote:
>>
>> The fix has been on modules-next only since yesterday but should be safe.
>
> Hmm.
>
> At a minimum, the *description* of this bug is garbage.
>
> It talks about an
The following changes since commit 92a09c47464d040866cf2b4cd052bc60555185fb:
Linux 6.15-rc5 (2025-05-04 13:55:04 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/
tags/modules-6.15-rc6
for you to fetch changes up to a6aeb739974e
s to fully override a type string for a symbol or a
> type. Also add a more informative error message in case we find
> a non-existent type references when calculating versions.
>
> Suggested-by: Giuliano Procida
> Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
On 4/30/25 23:40, Sami Tolvanen wrote:
> In rare situations where distributions must make significant
> changes to otherwise opaque data structures that have
> inadvertently been included in the published ABI, keeping
> symbol versions stable using the existing kABI macros can
> become tedious.
>
yte_size attribute for types:
>
> /*
>* struct s allocation is handled by the kernel, so
>* appending new members without changing the original
>* layout won't break the ABI.
>*/
> KABI_BYTE_SIZE(s, 16);
>
> This results in a type string that's unchanged from the original
> and therefore, won't change versions for symbols that reference
> the changed structure.
>
> Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
-- Petr
On 4/30/25 23:40, Sami Tolvanen wrote:
> Reduce code duplication by moving kABI rule look-ups to separate
> functions.
>
> Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
-- Petr
On 4/29/25 17:15, Alexey Gladkov wrote:
> On Tue, Apr 29, 2025 at 04:14:13PM +0200, Petr Pavlu wrote:
>> On 4/29/25 14:49, Alexey Gladkov wrote:
>>> On Tue, Apr 29, 2025 at 12:04:44PM +0200, Alexey Gladkov wrote:
>>>>> I'm not sure it's best to ove
The following changes since commit 8ffd015db85fea3e15a77027fda6c02ced4d2444:
Linux 6.15-rc2 (2025-04-13 11:54:49 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/
tags/modules-6.15-rc5
for you to fetch changes up to f95bbfe18512
On 4/29/25 14:49, Alexey Gladkov wrote:
> On Tue, Apr 29, 2025 at 12:04:44PM +0200, Alexey Gladkov wrote:
>>> I'm not sure it's best to overload this data in this way. I think mixing
>>> actual files and "logical" modules in the modules list is somewhat
>>> confusing.
>>>
>>> An alternative would b
On 4/26/25 18:16, Alexey Gladkov wrote:
> For some modules, modalias is generated using the modpost utility and
> the section is added to the module file.
>
> When a module is added inside vmlinux, modpost does not generate
> modalias for such modules and the information is lost.
>
> As a result
On 4/26/25 18:16, Alexey Gladkov wrote:
> The modules.builtin.modinfo file is used by userspace (kmod to be specific) to
> get information about builtin modules. Among other information about the
> module,
> information about module aliases is stored. This is very important to
> determine
> that
On 3/21/25 10:17, Andreas Hindborg wrote:
> Extend the `module!` macro with support module parameters. Also add some
> string
> to integer parsing functions and updates `BStr` with a method to strip a
> string
> prefix.
>
> Based on code by Adam Bratschi-Kaye lifted from the original `rust` bran
On 2/27/25 19:49, Shyam Saini wrote:
> Hi Everyone,
>
> This patch series fixes handling of module_kobject creation.
> A driver expect module_kset list populated with its corresponding
> module_kobject to create its /sys/module//drivers
> directory.
>
> Since,
> [1] commit 96a1a2412acb ("kernel/p
On 3/6/25 14:13, Petr Pavlu wrote:
> 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 m
change when KASAN + lockdep were enabled, but it was effectively
addressed by the already merged ee57ab5a3212 ("locking/lockdep: Disable
KASAN instrumentation of lockdep.c").
Joel Granados (1):
tests/module: nix-ify
On 3/20/25 13:00, Miguel Ojeda wrote:
> On Thu, Mar 20, 2025 at 11:26 AM Andreas Hindborg
> wrote:
>>
>> As far as I understand, Miguel would take patch 1-5 for v6.15 and
>> modules would take patch 6-7 for v6.16. At least that is my
>> understanding from [1], @Petr and @Miguel please correct me
. The kernel now has commit 110b1e070f1d ("module:
Don't fail module loading when setting ro_after_init section RO failed")
which addresses a previous problem with handling ro_after_init sections.
[1]
https://lore.kernel.org/linux-modules/20241223093840.29417-1-petr.pa...@suse.c
codetag.lds.h to make the data conditional on
CONFIG_MEM_ALLOC_PROFILING.
Signed-off-by: Petr Pavlu
---
include/asm-generic/codetag.lds.h | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/codetag.lds.h
b/include/asm-generic/codetag.lds.h
index
On 3/13/25 00:21, Sami Tolvanen wrote:
> Hi Petr,
>
> On Wed, Mar 12, 2025 at 5:05 AM Petr Pavlu wrote:
>>
>> On 3/7/25 01:12, Sami Tolvanen wrote:
>>> On Thu, Mar 06, 2025 at 06:28:58PM +0100, Christophe Leroy wrote:
>>>> Le 06/03/2025 à
On 3/7/25 01:12, Sami Tolvanen wrote:
> On Thu, Mar 06, 2025 at 06:28:58PM +0100, Christophe Leroy wrote:
>> Le 06/03/2025 à 14:13, Petr Pavlu a écrit :
>>> Section .static_call_sites holds data structures that need to be sorted and
>>> processed only at module load ti
Move the logic to mark special sections as read-only after module
initialization into a separate function, along other related code in
strict_rwx.c. Use a table with names of such sections to make it easier to
add more.
Signed-off-by: Petr Pavlu
---
kernel/module/internal.h | 2 ++
kernel
Minor cleanup, this is a non-functional change.
Signed-off-by: Petr Pavlu
---
kernel/module/internal.h | 5 +++--
kernel/module/strict_rwx.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index d09b46ef032f
On 3/8/25 20:46, Thorsten Blum wrote:
> The size parameter is optional and strscpy() automatically determines
> the length of the destination buffer using sizeof() if the argument is
> omitted. This makes the explicit sizeof() unnecessary. Remove it to
> shorten and simplify the code.
>
> Signed-o
. They were introduced previously by commit 84b4a51fce4c ("selftests:
add new kallsyms selftests").
Signed-off-by: Petr Pavlu
---
MAINTAINERS | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 8e0736dc2ee0..0c8a00b0b49b 100644
--- a/M
modified afterwards. Make it therefore read-only after
module initialization to avoid any (non-)accidental modifications.
Signed-off-by: Petr Pavlu
---
kernel/module/strict_rwx.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/kernel/module/strict_rwx.c b/kernel/module/strict_rwx.c
+To: Christophe Leroy
On 3/6/25 11:36, Petr Pavlu wrote:
> In the unlikely case that setting ro_after_init data to read-only fails, it
> is too late to cancel loading of the module. The loader then issues only
> a warning about the situation. Given that this reduces the kernel's
&g
d-by: Kees Cook
Signed-off-by: Petr Pavlu
---
I opted to use TAINT_BAD_PAGE for now because it seemed unnecessary to me
to introduce a new flag only for this specific case. However, if we end up
similarly checking set_memory_*() in the boot context, a separate flag
would be probably better.
---
kerne
On 2/27/25 19:49, Shyam Saini wrote:
> Hi Everyone,
>
> This patch series fixes handling of module_kobject creation.
> A driver expect module_kset list populated with its corresponding
> module_kobject to create its /sys/module//drivers
> directory.
>
> Since,
> [1] commit 96a1a2412acb ("kernel/p
On 2/25/25 12:54, Miguel Ojeda wrote:
> On Tue, Feb 25, 2025 at 11:22 AM Petr Pavlu wrote:
>>
>> I'd say the easiest is for the entire series to go through the Rust
>> tree. I'd also propose that any updates go primarily through that tree
>> as well.
>&g
On 2/25/25 18:24, Shyam Saini wrote:
> On Tue, Feb 25, 2025 at 09:33:10AM +0100, Petr Pavlu wrote:
>> On 2/21/25 11:42, Rasmus Villemoes wrote:
>>> On Thu, Feb 13 2025, Petr Pavlu wrote:
>>>
>>>> On 2/11/25 22:48, Shyam Saini wrote:
>>>>>
On 2/24/25 12:27, Andreas Hindborg wrote:
> Hi Petr,
>
> "Andreas Hindborg" writes:
>
>> 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 serie
On 2/21/25 11:42, Rasmus Villemoes wrote:
> On Thu, Feb 13 2025, Petr Pavlu wrote:
>
>> On 2/11/25 22:48, Shyam Saini wrote:
>>> In the unlikely event of the allocation failing, it is better to let
>>> the machine boot with a not fully populated sysfs than to kill
;s worth, this looks reasonable to me from the modules
perspective.
Acked-by: Petr Pavlu # from modules perspective
--
Thanks,
Petr
On 2/11/25 22:48, Shyam Saini wrote:
> The locate_module_kobject() function looks up an existing
> module_kobject for a given module name. If it cannot find the
> corresponding module_kobject, it creates one for the given name.
>
> This commit renames locate_module_kobject() to
> lookup_or_create_
On 2/11/25 22:48, Shyam Saini wrote:
> lookup_or_create_module_kobject() is marked as static and __init,
> to make it global drop static keyword.
> Since this function can be called from non-init code, use __modinit
> instead of __init, __modinit marker will make it __init if
> CONFIG_MODULES is no
On 2/11/25 22:48, Shyam Saini wrote:
> In the unlikely event of the allocation failing, it is better to let
> the machine boot with a not fully populated sysfs than to kill it with
> this BUG_ON(). All callers are already prepared for
> lookup_or_create_module_kobject() returning NULL.
>
> This is
On 2/12/25 14:41, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:febbc555cf0f Merge tag 'nfsd-6.14-1' of git://git.kernel.o..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=137a78e458
> kernel config: https://syzkal
On 12/16/24 17:43, Petr Pavlu wrote:
> On 12/2/24 15:59, Peter Zijlstra wrote:
>> Hi!
>>
>> Implement a means for exports to be available only to an explicit list of
>> named
>> modules. By explicitly limiting the usage of certain exports, the abuse
>> poten
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 fi
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
The following changes since commit ffd294d346d185b70e28b1a28abe367bbfe53c04:
Linux 6.13 (2025-01-19 15:51:45 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/
tags/modules-6.14-rc1
for you to fetch changes up to f3b93547b91ad849
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
> ---
> rust/kernel/lib.rs |
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?
>>
>> In NixOS, we disable M
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() with just rcu_read_l
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, which is what among others Arch, Fed
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.
&
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
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 read-only fails,
On 12/10/24 11:49, Daniel Gomez wrote:
> On 12/4/2024 4:14 PM, Petr Pavlu wrote:
>> On 11/28/24 21:23, Daniel Gomez wrote:
>>> On 11/12/2024 3:35 PM, Petr Pavlu wrote:
>>>> On 11/12/24 10:43, Daniel Gomez wrote:
>>>>> On Mon Nov 11
On 12/23/24 21:14, Linus Torvalds wrote:
> On Mon, 23 Dec 2024 at 02:55, Petr Pavlu wrote:
>>
>> Luis asked me to look after the modules maintenance for a while, with the
>> plan to rotate it with other recently added modules maintainers/reviewers.
>> This is my first
On 12/20/24 18:41, Sebastian Andrzej Siewior wrote:
> __module_address() can be invoked within a RCU section, there is no
> requirement to have preemption disabled.
>
> I'm not sure if using rcu_read_lock() will introduce the regression that
> has been fixed in commit 14c4c8e41511a ("cfi: Use
> rc
n.c:
>
> crcval = *crc;
>
> Signed-off-by: Masahiro Yamada
Reviewed-by: Petr Pavlu
I understand the plan is for this to go through the kbuild tree with the
rest of the extended modversions + Rust support.
--
Thanks,
Petr
The following changes since commit 4bbf9020becbfd8fc2c3da790855b7042fad455b:
Linux 6.13-rc4 (2024-12-22 13:22:21 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/
tags/modules-6.13-rc5
for you to fetch changes up to 0b7a66a2c864
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 modifications.
Petr Pavlu (3):
module: Constify
Move the logic to mark special sections as read-only after module
initialization into a separate function, along other related code in
strict_rwx.c. Use a table with names of such sections to make it easier to
add more.
Signed-off-by: Petr Pavlu
---
kernel/module/internal.h | 2 ++
kernel
modified afterwards. Make it therefore read-only after
module initialization to avoid any (non-)accidental modifications.
Signed-off-by: Petr Pavlu
---
kernel/module/strict_rwx.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/kernel/module/strict_rwx.c b/kernel/module/strict_rwx.c
Minor cleanup, this is a non-functional change.
Signed-off-by: Petr Pavlu
---
kernel/module/internal.h | 5 +++--
kernel/module/strict_rwx.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index daef2be83902
b517bcbfe7ec0d0186f9b0b8
> change-id: 20241204-sysfs-const-attr-module-927afe76eda4
Reviewed-by: Petr Pavlu
I'm going to wait for a few days if others want to comment and then plan
to queue this on the modules tree for the 6.14 merge window.
--
Thanks,
Petr
On 12/2/24 15:59, Peter Zijlstra wrote:
> Hi!
>
> Implement a means for exports to be available only to an explicit list of
> named
> 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 u
e string accurate instead of
> removing it.
>
> Move the PREEMPT_RT check before the PREEMPT so that it takes precedence
> if both symbols are enabled.
>
> Fixes: 35772d627b55c ("sched: Enable PREEMPT_DYNAMIC for PREEMPT_RT")
> Signed-off-by: Sebastian Andrzej Siewior
On 11/28/24 21:23, Daniel Gomez wrote:
> On 11/12/2024 3:35 PM, Petr Pavlu wrote:
>> On 11/12/24 10:43, Daniel Gomez wrote:
>>> On Mon Nov 11, 2024 at 7:53 PM CET, Christophe Leroy wrote:
>>>>
>>>>
>>>> Le 09/11/2024 à 23:17, Daniel Go
he preprocessed C-style format
> genksyms produces.
>
> Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
On 11/21/24 21:42, Sami Tolvanen wrote:
> Calculate symbol versions from the fully expanded type strings in
> type_map, and output the versions in a genksyms-compatible format.
>
> Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
&sym_mem, &xndx);
> +
> + if (!sym ||
> + GELF_ST_BIND(sym->st_info) == STB_LOCAL)
> + continue;
Doesn't NULL returned by gelf_getsymshndx() indicate an error? If yes
then I think it should be reported instead of silently skipping the
symbol.
With this addressed, feel free to add:
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
e that genksyms has.
I was also recently thinking that it would be great if genksyms could
skip definitions that are in internal header files, for example,
kernel/events/internal.h. Perhaps something that could be added in the
future..
I've noted one nit below, but the patch looks sensible to me
On 11/20/24 03:17, Song Chen wrote:
> Hi Petr,
>
> 在 2024/11/18 20:54, Petr Pavlu 写道:
>> On 11/13/24 03:15, Song Chen wrote:
>>> 在 2024/11/12 20:56, Petr Pavlu 写道:
>>>> On 11/10/24 12:42, Song Chen wrote:
>>>>> Sometimes when kernel calls requ
On 11/13/24 03:15, Song Chen wrote:
> 在 2024/11/12 20:56, Petr Pavlu 写道:
>> On 11/10/24 12:42, Song Chen wrote:
>>> Sometimes when kernel calls request_module to load a module
>>> into kernel space, it doesn't pass the module name appropriately,
>>> and
On 11/12/24 10:43, Daniel Gomez wrote:
> On Mon Nov 11, 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 it is too late to cancel loading.
If se
On 11/10/24 12:42, Song Chen wrote:
> Sometimes when kernel calls request_module to load a module
> into kernel space, it doesn't pass the module name appropriately,
> and request_module doesn't verify it as well.
>
> As a result, modprobe is invoked anyway and spend a lot of time
> searching a no
On 11/9/24 11:35, 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.
Makes sense to me. If I'm looking correctly, set_memory_ro() could
mostly
On 10/8/24 20:38, Sami Tolvanen wrote:
> When MODVERSIONS is enabled, allow selecting gendwarfksyms as the
> implementation, but default to genksyms.
>
> Signed-off-by: Sami Tolvanen
> Acked-by: Neal Gompa
> ---
> kernel/module/Kconfig | 25 -
> scripts/Makefile |
iscard.gendwarfksyms") = &sym;
>
> extern int external_symbol(void);
> GENDWARFKSYMS_PTR(external_symbol);
>
> Signed-off-by: Sami Tolvanen
> Acked-by: Neal Gompa
Looks ok to me, feel free to add:
Reviewed-by: Petr Pavlu
-- Petr
mber_location(24)
> + * STABLE-NEXT: } byte_size(32)
> + *
> + * VERSION-DAG: #SYMVER ex2b 0x[[#%.08x,EX2]]
> + */
> +
> +struct {
> + int a;
> + KABI_IGNORE(0, unsigned int n);
> + unsigned long b;
> + int c;
> + KABI_IGNORE(1, unsigned int m);
> + unsigned long d;
> +} ex2c;
> +
> +_Static_assert(sizeof(ex2a) == sizeof(ex2c), "ex2a size doesn't match ex2c");
> +
> +/*
> + * STABLE: variable structure_type {
> + * STABLE-NEXT: member base_type int byte_size(4) encoding(5) a
> data_member_location(0) ,
> + * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) b
> data_member_location(8)
> + * STABLE-NEXT: member base_type int byte_size(4) encoding(5) c
> data_member_location(16) ,
> + * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) d
> data_member_location(24)
> + * STABLE-NEXT: } byte_size(32)
> + *
> + * VERSION-DAG: #SYMVER ex2c 0x[[#%.08x,EX2]]
> + */
> diff --git a/scripts/gendwarfksyms/gendwarfksyms.h
> b/scripts/gendwarfksyms/gendwarfksyms.h
> index f32ad4389b58..1cff868bacdb 100644
> --- a/scripts/gendwarfksyms/gendwarfksyms.h
> +++ b/scripts/gendwarfksyms/gendwarfksyms.h
> @@ -222,6 +222,20 @@ void cache_clear_expanded(struct expansion_cache *ec);
> /*
> * dwarf.c
> */
> +
> +/* See dwarf.c:get_union_kabi_status */
> +#define KABI_PREFIX "__kabi_"
> +#define KABI_PREFIX_LEN (sizeof(KABI_PREFIX) - 1)
> +#define KABI_RESERVED_PREFIX "reserved"
> +#define KABI_RESERVED_PREFIX_LEN (sizeof(KABI_RESERVED_PREFIX) - 1)
> +#define KABI_IGNORED_PREFIX "ignored"
> +#define KABI_IGNORED_PREFIX_LEN (sizeof(KABI_IGNORED_PREFIX) - 1)
> +
> +static inline bool is_kabi_prefix(const char *name)
> +{
> + return name && !strncmp(name, KABI_PREFIX, KABI_PREFIX_LEN);
> +}
> +
Nit: The new KABI_* macros and the is_kabi_prefix() function are used
only in dwarf.c so could be all moved there.
> struct expansion_state {
> bool expand;
> unsigned int ptr_depth;
> @@ -229,6 +243,18 @@ struct expansion_state {
> const char *current_fqn;
> };
>
> +enum kabi_status {
> + /* >0 to stop DIE processing */
> + KABI_NORMAL = 1,
> + KABI_RESERVED,
> + KABI_IGNORED,
> +};
> +
> +struct kabi_state {
> + int members;
> + Dwarf_Die placeholder;
> +};
> +
> struct state {
> struct symbol *sym;
> Dwarf_Die die;
> @@ -239,6 +265,9 @@ struct state {
> /* Structure expansion */
> struct expansion_state expand;
> struct expansion_cache expansion_cache;
> +
> + /* Reserved or ignored members */
> + struct kabi_state kabi;
> };
>
> typedef int (*die_callback_t)(struct state *state, struct die *cache,
I've noted some nits above which you might want to trivially address.
Otherwise this looks ok to me, feel free to add:
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
On 10/8/24 20:38, Sami Tolvanen wrote:
> Distributions that want to maintain a stable kABI need the ability
> to make ABI compatible changes to kernel without affecting symbol
> versions, either because of LTS updates or backports.
>
> With genksyms, developers would typically hide these changes f
+
> + hash_for_each_safe(symbol_names, sym, tmp, name_hash) {
> + func(sym, arg);
> + }
> +}
> +
> typedef void (*elf_symbol_callback_t)(const char *name, GElf_Sym *sym,
> Elf32_Word xndx, void *arg);
>
> @@ -231,3 +271,22 @@ void symbol_read_symtab(int fd)
> {
> elf_for_each_global(fd, elf_set_symbol_addr, NULL);
> }
> +
> +void symbol_print_versions(void)
> +{
> + struct hlist_node *tmp;
> + struct symbol *sym;
> +
> + hash_for_each_safe(symbol_names, sym, tmp, name_hash) {
> + if (sym->state != SYMBOL_PROCESSED)
> + warn("no information for symbol %s", sym->name);
> +
> + printf("#SYMVER %s 0x%08lx\n", sym->name, sym->crc);
> +
> + free((void *)sym->name);
> + free(sym);
> + }
> +
> + hash_init(symbol_addrs);
> + hash_init(symbol_names);
> +}
I had some minor comment about adjusting the name of function
symbol_print_versions() and possibly changing sym->name to 'char *' on
the v2 of the patch:
https://lore.kernel.org/all/286b1cc5-1757-4f0a-bb66-0875f4608...@suse.com/
Please have a look, it seems it felt through the cracks.
In any case, the patch looks ok to me, feel free to add:
Reviewed-by: Petr Pavlu
--
Thanks,
Petr
) alignment(8) msg
> )
> -> base_type void
>
> Signed-off-by: Sami Tolvanen
> Acked-by: Neal Gompa
Looks ok to me, feel free to add:
Reviewed-by: Petr Pavlu
-- Petr
, free free to add:
Reviewed-by: Petr Pavlu
-- Petr
1 - 100 of 161 matches
Mail list logo