Skip to content

Conversation

@modules-kpd-app
Copy link

Pull request for series with
subject: testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper
version: 1
url: https://patchwork.kernel.org/project/linux-modules/list/?series=977352

petrpavlu and others added 3 commits June 30, 2025 15:52
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
module_memory_alloc() fails. However, move_module() can fail for other
reasons as well, in which case t remains set to 0 and no memory is freed.

Fix the problem by initializing t to MOD_MEM_NUM_TYPES. Additionally, make
the deallocation loop more robust by not relying on the mod_mem_type_t enum
having a signed integer as its underlying type.

Fixes: c7ee8ae ("module: add stop-grap sanity check on module memcpy()")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250618122730.51324-2-petr.pavlu@suse.com
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Message-ID: <20250618122730.51324-2-petr.pavlu@suse.com>
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 <petr.pavlu@suse.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250618122730.51324-3-petr.pavlu@suse.com
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Message-ID: <20250618122730.51324-3-petr.pavlu@suse.com>
@modules-kpd-app
Copy link
Author

Upstream branch: f4e47f3
series: https://patchwork.kernel.org/project/linux-modules/list/?series=977352
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-modules/list/?series=977352
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper
Patch failed at 0001 testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper'
  stderr: 'error: sha1 information is lacking or useless (testsuite/init_module.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"'

conflict:


@dkruces dkruces force-pushed the modules-next_base branch 2 times, most recently from b4d1c4e to 61dc34e Compare July 4, 2025 19:48
@modules-kpd-app modules-kpd-app bot force-pushed the modules-next_base branch 2 times, most recently from 1df8185 to 9aab33d Compare July 8, 2025 19:00
@dkruces dkruces force-pushed the modules-next_base branch from 9aab33d to 99d099e Compare July 8, 2025 19:46
@modules-kpd-app modules-kpd-app bot force-pushed the modules-next_base branch from 99d099e to 3aed49d Compare July 8, 2025 19:56
@modules-kpd-app modules-kpd-app bot force-pushed the modules-next_base branch 4 times, most recently from cdc6b9e to 311def7 Compare October 22, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants