Re: sys_open undefined! when i try to load module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/25/06, Octavian Purdila <tavi@xxxxxxxxx> wrote:
On Friday 25 August 2006 16:16, suman adak wrote:
> Hi list,
>
> I just tried to read a file from kernel space. I called sys_open()..but
> when i try to load the module , it is saying sys_open undefined.
> I can see in System.map file that this symbol has been exported.Why my
> module is saying like that? Can anybody help me why this error message
> comes ?or did i do any mistake..
> ...
> Error output:
>
> Building modules, stage 2.
>   MODPOST
> *** Warning: "sys_open"
> [/home/suman/amit_saha/amit/read_file/my_module/read_file_module.ko]
> undefined!
>
> P.S: Please don't tell the it is not good to use sys_open.. I know ..just i
> want to see

In order to access kernel symbols (functions, global variables) from a kernel
module, they need to be exported. Since accessing sys_* functions from
modules is wrong, the kernel does not export these kinds of functions.

If you really want to play with them, you need to modify  and recompile the
kernel (see EXPORT_SYMBOL).

You prababily didn't read my mail. I already told i found this sysmbol in System.map  file which contain all exported sysmbol address.

root@ajit my_module]# cat /boot/System.map-2.6.15-1.2054_FC5 | grep -i "sys_open"
c0152074 T do_sys_open
c015211e T sys_openat
c0152139 T sys_open
c032a29c r __ksymtab_sys_openat
c032d4dc r __kcrctab_sys_openat
c0330175 r __kstrtab_sys_openat
[root@ajit my_module]#

I am running 2.6.15 kernel. look at this file http://lxr.linux.no/source/fs/open.c[line : 962].....
tahnks
suman

tavi


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux