Skip to content

[PW_SID:1149830] kexec: fix probe error codes and error propagation - #2512

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1149830
Closed

[PW_SID:1149830] kexec: fix probe error codes and error propagation#2512
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1149830

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1149830 applied to workflow__riscv__fixes

Name: kexec: fix probe error codes and error propagation
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1149830
Version: 3

Several kexec_file_load() image probe functions return -EINVAL when
they do not recognize the image format.  A probe function that rejects
an image should return -ENOEXEC to indicate that the image is not a
recognized executable format.  -EINVAL implies a problem with the
syscall parameters, not with image recognition.

kexec_image_probe_default() iterates through registered loaders and
returns the last probe's error code to the caller.  That error
propagates as the kexec_file_load() return value to userspace.
Returning -EINVAL from a probe when no loader matches is semantically
incorrect and misleads userspace about the nature of the failure.

Return -ENOEXEC from all probe functions and their helpers when the
image format is not recognized.

Signed-off-by: Mukesh Pilaniya <mpilaniy@redhat.com>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Bradley Morgan <include@grrlz.net>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
kexec_image_probe_default() overwrites ret with each loader's probe
return value and returns whatever the last loader returned when no
probe matches.  The error code reaching userspace depends on whichever
loader happens to be last in kexec_file_loaders[].

Only continue to the next loader when a probe returns -ENOEXEC.
Propagate any other error such as -ENOMEM immediately. Return -ENOEXEC
only when all loaders have been tried and none matched.

Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Mukesh Pilaniya <mpilaniy@redhat.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 147.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1440.10 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1780.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 28.84 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 30.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.39 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 91.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] kexec: return -ENOEXEC from image probe functions on mismatch"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.51 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 147.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1447.05 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1748.33 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 30.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 90.42 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] kexec: fix error propagation in kexec_image_probe_default()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot deleted the pw1149830 branch August 29, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants