All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LSM: add missing hook to do_compat_readv_writev()
@ 2006-04-26  6:45 James Morris
  2006-04-26 18:04 ` Chris Wright
  0 siblings, 1 reply; 2+ messages in thread
From: James Morris @ 2006-04-26  6:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Al Viro, Chris Wright, Stephen Smalley, linux-kernel

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] LSM: add missing hook to do_compat_readv_writev()
  2006-04-26  6:45 [PATCH] LSM: add missing hook to do_compat_readv_writev() James Morris
@ 2006-04-26 18:04 ` Chris Wright
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wright @ 2006-04-26 18:04 UTC (permalink / raw)
  To: James Morris
  Cc: Linus Torvalds, Al Viro, Chris Wright, Stephen Smalley, linux-kernel

* James Morris (jmorris@namei.org) wrote:
> 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>

Acked-by: Chris Wright <chrisw@sous-sol.org>

thanks,
-chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-26 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26  6:45 [PATCH] LSM: add missing hook to do_compat_readv_writev() James Morris
2006-04-26 18:04 ` Chris Wright

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.