Re: [PATCH] umh: fix memory leak on execve failure

From: Vincent Minet
Date: Mon Apr 13 2020 - 11:49:36 EST


In my case, execve fails with ENOENT on a Tomoyo enabled kernel. It doesn't seem
like CONFIG_BPFILTER and CONFIG_SECURITY_TOMOYO are compatible as it is.

The UMH is executed via "do_execve_file", so we'll have bprm->filename set to
"none". This causes the following call chain to fail and search_binary_handler()
to return ENOENT.
search_binary_handler() ->
security_bprm_check() ->
tomoyo_bprm_check_security() ->
tomoyo_find_next_domain() ->
tomoyo_realpath_nofollow()

I don't really know how to solve this. As I understand it, you really need
a "valid" pathname for Tomoyo and it's not obvious what that should be for the
user-mode blob.

--
Vincent Minet