From: Kostik Belousov Date: Wed, 28 Sep 2005 15:21:28 +0000 (+0300) Subject: [PATCH] readv/writev syscalls are not checked by lsm X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=411b67b4b6a4dd1e0292a6a58dd753978179d173;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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 Signed-off-by: Chris Wright --- 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 @@ -497,6 +497,9 @@ static ssize_t do_readv_writev(int type, struct file *file, } 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;