LWN.net Logo

readv/writev syscalls are not checked by lsm

From:  Kostik Belousov <kostikbel-AT-gmail.com>
To:  linux-security-module-AT-wirex.com, chrisw-AT-osdl.org
Subject:  readv/writev syscalls are not checked by lsm
Date:  Wed, 28 Sep 2005 18:21:28 +0300
Archive-link:  Article, Thread

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



(Log in to post comments)

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds