From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Chris Wright <chrisw@osdl.org>
Cc: linux-kernel@vger.kernel.org,
Axelle Apvrille <axelle.apvrille@trusted-logic.fr>,
serue@us.ibm.com, david.gordon@ericsson.com, gaspoucho@yahoo.com
Subject: Re: [ANNOUNCE] Release Digsig 1.3.1: kernel module for run-time authentication of binaries
Date: Thu, 9 Sep 2004 17:45:07 -0400 [thread overview]
Message-ID: <20040909214507.GA29412@escher.cs.wm.edu> (raw)
In-Reply-To: <20040909140349.C1924@build.pdx.osdl.net>
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
> Thing is, x86 makes no distinction btween r/x so, have you tried mmaping
> with read, then executing (I haven't)?
Yup, clearly that will work on x86. And so obviously DigSig is not
a solution to format and buffer overflows :) Nor, unfortunately, a
solution to code which for whatever reason exploited this behavior.
> This has nothing to do with file permissions aside of read. All you need
> is read permission, then you can mmap(PROT_EXEC) which will kick off the
> check, and do deny_write_access. It's a freeform way to lock writers
> out of any readable file in the system.
No, not "any readable file," because DigSig will not lock non-ELF files.
The attached patch adds a check for execute permission to the file being
mmap'ed. Failing such permission, it will return -EPERM and not lock
the file.
thanks,
-serge
[-- Attachment #2: digsig.c.noexec.diff --]
[-- Type: text/plain, Size: 375 bytes --]
--- digsig.c 2004-09-09 17:43:51.342757952 -0500
+++ digsig.c.noexec 2004-09-09 17:43:43.569939600 -0500
@@ -556,6 +556,11 @@ int dsi_file_mmap(struct file * file, un
goto out_file_no_buf;
}
+ if (!(file->f_dentry->d_inode->i_mode & MAY_EXEC)) {
+ retval = -EPERM;
+ goto out_with_file;
+ }
+
retval = DIGSIG_MODE;
size = elf_ex->e_shnum * sizeof(Elf32_Shdr);
next prev parent reply other threads:[~2004-09-09 21:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-09 15:55 Makan Pourzandi
2004-09-09 16:24 ` Chris Wright
2004-09-09 17:23 ` Serge E. Hallyn
2004-09-09 17:42 ` Chris Wright
2004-09-09 18:43 ` Serge E. Hallyn
2004-09-09 17:31 ` Makan Pourzandi
2004-09-09 17:55 ` Chris Wright
2004-09-09 19:05 ` Serge E. Hallyn
2004-09-09 20:40 ` Makan Pourzandi
2004-09-09 21:03 ` Chris Wright
2004-09-09 21:45 ` Serge E. Hallyn [this message]
2004-09-10 21:28 ` Chris Wright
2004-09-10 20:53 ` Makan Pourzandi
2004-09-10 21:26 ` Chris Wright
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=20040909214507.GA29412@escher.cs.wm.edu \
--to=serue@us.ibm.com \
--cc=axelle.apvrille@trusted-logic.fr \
--cc=chrisw@osdl.org \
--cc=david.gordon@ericsson.com \
--cc=gaspoucho@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/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®