Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Kostik Belousov <kostikbel <at> gmail.com>
Subject: readv/writev syscalls are not checked by lsm
Newsgroups: gmane.linux.kernel.lsm
Date: Wednesday 28th September 2005 15:21:28 UTC (over 11 years ago)
Hello,

it seems that readv(2)/writev(2) syscalls do not call
file_permission callback. Looks like this is overlook.

I have filled the issue into redhat bugzilla as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=169433
and got the recommendation to post this on lsm mailing list.

The following trivial patch solves the problem.

--- linux-2.6.12/fs/read_write.c	2005-09-28 16:18:29.000000000 +0300
+++ p/fs/read_write.c	2005-09-28 17:17:08.000000000 +0300
@@ -485,6 +485,9 @@
 	ret = rw_verify_area(type, file, pos, tot_len);
 	if (ret)
 		goto out;
+	ret = security_file_permission(file, type == READ ? MAY_READ :
MAY_WRITE);
+	if (ret)
+		goto out;
 
 	fnv = NULL;
 	if (type == READ) {

Best regargs,
Kostik Belousov
 
CD: 3ms