linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Minet <v.minet@criteo.com>
To: linux-kernel@vger.kernel.org
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Kentaro Takeda <takedakn@nttdata.co.jp>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Vincent Minet <v.minet@criteo.com>
Subject: Re: [PATCH] umh: fix memory leak on execve failure
Date: Mon, 13 Apr 2020 17:49:25 +0200	[thread overview]
Message-ID: <20200413154925.GA18663@criteo.com> (raw)
In-Reply-To: <20200413154244.18583-1-v.minet@criteo.com>

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

  reply	other threads:[~2020-04-13 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 15:42 [PATCH] umh: fix memory leak on execve failure Vincent Minet
2020-04-13 15:49 ` Vincent Minet [this message]
2020-04-13 22:56   ` Tetsuo Handa
2020-05-07 22:14 Vincent Minet
2020-05-09  2:10 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200413154925.GA18663@criteo.com \
    --to=v.minet@criteo.com \
    --cc=ast@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=takedakn@nttdata.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).