diff options
author | Kostik Belousov <kostikbel@gmail.com> | 2005-09-28 11:21:28 -0400 |
---|---|---|
committer | Chris Wright <chrisw@osdl.org> | 2005-09-29 18:42:08 -0400 |
commit | 411b67b4b6a4dd1e0292a6a58dd753978179d173 (patch) | |
tree | 7aa7d712198635b6dac0af3af265808241806bbb | |
parent | aa55a08687059aa169d10a313c41f238c2070488 (diff) |
[PATCH] readv/writev syscalls are not checked by lsm
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.
Signed-off-by: Kostik Belousov <kostikbel@gmail.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
-rw-r--r-- | fs/read_write.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index b60324aaa2b6..a091ee4f430d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -499,6 +499,9 @@ static ssize_t do_readv_writev(int type, struct file *file, | |||
499 | ret = rw_verify_area(type, file, pos, tot_len); | 499 | ret = rw_verify_area(type, file, pos, tot_len); |
500 | if (ret) | 500 | if (ret) |
501 | goto out; | 501 | goto out; |
502 | ret = security_file_permission(file, type == READ ? MAY_READ : MAY_WRITE); | ||
503 | if (ret) | ||
504 | goto out; | ||
502 | 505 | ||
503 | fnv = NULL; | 506 | fnv = NULL; |
504 | if (type == READ) { | 507 | if (type == READ) { |