All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] exec: fix no kernel module found error to be more clear
@ 2024-11-15 16:55 Nir Lichtman
  2024-11-15 18:03 ` Nir Lichtman
  0 siblings, 1 reply; 2+ messages in thread
From: Nir Lichtman @ 2024-11-15 16:55 UTC (permalink / raw)
  To: viro, brauner, jack, ebiederm, kees, linux-kernel

Problem: Before starting the enumeration of the supported formats the
default return value is set to no entity which is misleading since if
the kernel module of the binary format is not found, it would return no
entity to user mode which is misleading since it is signaling that a
file was not found, but in this case the more suitable error is that the
executable has an unsupported format

Solution: Refactor to return no-exec error instead

Signed-off-by: Nir Lichtman <nir@lichtman.org>
---
 fs/exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exec.c b/fs/exec.c
index 3394de5882af..6324f9546b09 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1740,7 +1740,7 @@ static int search_binary_handler(struct linux_binprm *bprm)
 	if (retval)
 		return retval;
 
-	retval = -ENOENT;
+	retval = -ENOEXEC;
  retry:
 	read_lock(&binfmt_lock);
 	list_for_each_entry(fmt, &formats, lh) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-15 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 16:55 [PATCH] exec: fix no kernel module found error to be more clear Nir Lichtman
2024-11-15 18:03 ` Nir Lichtman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.