mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Zach, Yoav" <yoav.zach@intel.com>
Cc: akpm@osdl.org, torvalds@osdl.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]: non-readable binaries - binfmt_misc 2.6.0-test4
Date: Sun, 31 Aug 2003 23:45:11 +0100	[thread overview]
Message-ID: <1062369910.12059.1.camel@dhcp23.swansea.linux.org.uk> (raw)
In-Reply-To: <2C83850C013A2540861D03054B478C0601CF64C8@hasmsx403.iil.intel.com>

On Sul, 2003-08-31 at 22:41, Zach, Yoav wrote:
> The proposed patch solves a problem for interpreters that need to
> execute a non-readable file, which cannot be read in userland. To handle

You've added a security hole.

> + 	if (fmt->flags & MISC_FMT_OPEN_BINARY) {
> +		/* if the binary should be opened on behalf of the
> +		 * interpreter than keep it open and assign it a
> descriptor */
> + 		fd = get_unused_fd ();
> + 		if (fd < 0) {

At this point your file table might be shared with another thread (see
binfmt_elf in 2.4 - I dunno if 2.6 has been fixed for this exploit yet).
You need to unshare the file table before you modify it during the exec.

Otherwise it looks fairly sane.


  parent reply	other threads:[~2003-08-31 22:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-31 21:41 Zach, Yoav
2003-08-31 22:12 ` Herbert Poetzl
2003-08-31 22:48   ` Alan Cox
2003-08-31 22:45 ` Alan Cox [this message]
2003-08-31 22:58 ` Alan Cox
2003-09-01  4:20   ` Willy Tarreau
2003-08-31 23:01 ` Linus Torvalds
2003-09-04  6:30 Zach, Yoav

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=1062369910.12059.1.camel@dhcp23.swansea.linux.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=yoav.zach@intel.com \
    /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

all inboxes | Powered by JetHome®