[PATCH] LSM: add missing hook to do_compat_readv_writev()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]> 
Signed-off-by: Al Viro <[email protected]>


[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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux