mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	Chris Wright <chrisw@sous-sol.org>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] LSM: add missing hook to do_compat_readv_writev()
Date: Wed, 26 Apr 2006 02:45:03 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604260237260.26341@d.namei> (raw)

This patch addresses a flaw in LSM, where there is no mediation of readv() 
and writev() in for 32-bit compatible apps using a 64-bit kernel.

This bug was discovered and fixed initially in the native readv/writev 
code [1], but was not fixed in the compat code.  Thanks to Al for spotting 
this one.


Please apply.

Signed-off-by: James Morris <jmorris@namei.org> 
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


[1] http://lwn.net/Articles/154282/

---

diff -purN -X dontdiff linux-2.6.17-rc2.o/fs/compat.c linux-2.6.17-rc2.fix/fs/compat.c
--- linux-2.6.17-rc2.o/fs/compat.c	2006-04-19 23:31:24.000000000 -0400
+++ linux-2.6.17-rc2.fix/fs/compat.c	2006-04-25 20:41:39.000000000 -0400
@@ -1217,6 +1217,10 @@ static ssize_t compat_do_readv_writev(in
 	if (ret < 0)
 		goto out;
 
+	ret = security_file_permission(file, type == READ ? MAY_READ:MAY_WRITE);
+	if (ret)
+		goto out;
+
 	fnv = NULL;
 	if (type == READ) {
 		fn = file->f_op->read;

             reply	other threads:[~2006-04-26  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-26  6:45 James Morris [this message]
2006-04-26 18:04 ` 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=Pine.LNX.4.64.0604260237260.26341@d.namei \
    --to=jmorris@namei.org \
    --cc=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    /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®