/ 详情

lack of sys_read, sys_write symbol

Done
Bug
Opened this issue  
2020-05-21 00:45

When I try to build some kernel module, for example. http://download.filesystems.org/wrapfs/patches/

I found there are some puzzle thing in our kernel, if you do
cat /proc/kallsym, you can find clearly that sys_read, sys_write have been exported. but if you check the Module.symvers file, it does not contain those 2 functions?
Why?

that may lead that any external module build failed when using sys_read&sys_write.

Attachments

Comments (3)

myeuler created缺陷
myeuler set related repository to openEuler/kernel
展开全部操作日志

Hey @myeuler , Welcome to openEuler Community.
All of the projects in openEuler Community are maintained by @openeuler-ci-bot .
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md to find the details.

I've checked kernel source, sys_read is not a export symbal. And it's the same as CentOS 7.6 kernel. Does any external module use these symbals?

The file /proc/kallsyms holds all the symbols that the kernel knows, not only exported symbals. So genernally, Module.symvers is a subset of kallsyms.

yanzh_h set assignee to XieXiuQi

If you mean 'vfs_read', it is removed by kernel 4.14.

commit bd8df82be66698042d11e7919e244c8d72b042ca
Author: Christoph Hellwig <hch@lst.de>
Date:   Fri Sep 1 17:39:24 2017 +0200

    fs: unexport vfs_read and vfs_write

    No modular users left.  Given that they take user pointers there is no
    good reason to export it to drivers to start with.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

diff --git a/fs/read_write.c b/fs/read_write.c
index 49450c642298..f5cfce243cef 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -454,8 +454,6 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
        return ret;
 }

-EXPORT_SYMBOL(vfs_read);
-
 static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
 {
        struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len };
@@ -554,8 +552,6 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
        return ret;
 }

-EXPORT_SYMBOL(vfs_write);
-
 static inline loff_t file_pos_read(struct file *file)
 {
        return file->f_pos;


myeuler changed issue state from 待办的 to 已完成
XieXiuQi added
 
discussion
label

Sign in to comment

状态
Assignees
Projects
Milestones
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
确定
参与者(3)
5329419 openeuler ci bot 1578984659