Re: [PATCH] module/decompress: Adjust module_extend_max_pages() allocation type

2025-04-28 Thread Petr Pavlu
type to match the assignment. > > Signed-off-by: Kees Cook > --- > Cc: Luis Chamberlain > Cc: Petr Pavlu > Cc: Sami Tolvanen > Cc: Daniel Gomez > Cc: > --- > kernel/module/decompress.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a

Re: [PATCH] module: Replace deprecated strncpy() with strscpy()

2025-03-10 Thread Petr Pavlu
On 3/7/25 12:35, Thorsten Blum wrote: > strncpy() is deprecated for NUL-terminated destination buffers; use > strscpy() instead. The destination buffer ownername is only used with > "%s" format strings and must therefore be NUL-terminated, but not NUL- > padded. > > No functional changes intended.

Re: [RESEND PATCH v2] params: Annotate struct module_param_attrs with __counted_by()

2025-02-17 Thread Petr Pavlu
On 2/13/25 23:13, Thorsten Blum wrote: > Add the __counted_by compiler attribute to the flexible array member > attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and > CONFIG_FORTIFY_SOURCE. > > Increment num before adding a new param_attribute to the attrs array and > adjust the arr

Re: [PATCH v2 0/6] module: sysfs: Cleanups and preparation for const struct bin_attribute

2024-12-31 Thread Petr Pavlu
h attribute_group > module: sysfs: Use const 'struct bin_attribute' > > kernel/module/sysfs.c | 116 > -- > 1 file changed, 55 insertions(+), 61 deletions(-) > --- > base-commit: d6ef8b40d075c425f548002d2f35ae3f06e9cf96 > chang

Re: [PATCH 3/4] module: sysfs: Add notes attributes through attribute_group

2024-12-18 Thread Petr Pavlu
On 12/16/24 20:16, Thomas Weißschuh wrote: > A kobject is meant to manage the lifecycle of some resource. > However the module sysfs code only creates a kobject to get a > "notes" subdirectory in sysfs. > This can be achieved easier and cheaper by using a sysfs group. > Switch the notes attribute c

Re: [PATCH 2/4] module: sysfs: Simplify section attribute allocation

2024-12-18 Thread Petr Pavlu
On 12/16/24 20:16, Thomas Weißschuh wrote: > The existing allocation logic manually stuffs two allocations into one. > This is hard to understand and of limited value, given that all the > section names are allocated on their own anyways. > Une one allocation per datastructure. > > Signed-off-by: