- 论坛徽章:
- 6
|
回复 1# mordorwww
看到网上的例子和别人写的代码都没有,只是把read write给set_fs了
但是看内核里的一些驱动源码, filp_open也是放在set_fs里的
You should know the meaning of set_fs():
The value of the addr_limit.seg field can be dynamically changed by the get_fs and set_fs macros; this allows the kernel to bypass the security checks made by access_ok( ), so that it can invoke system call service routines, directly passing to them addresses in the kernel data segment.
So, if you want to directly call filp_open in kernel space, set_fs will be needed!
|
|