Re: question about sockfd_lookup( )
I can't use sockfd_put(sock) directly. I trace its code, the code is extern __inline__ void sockfd_put(struct socket *sock) { fput(sock->file); } so I use fput(sock->file) but it has problems too 1) execute "ls" in the ftp is also block 2) kernel prints "socki_lookup: socket file changed!" 3) execute "ftp localhost" after rmmod, it will crash and why the sockfd_put is needed after sockfd_lookup Thanak again MingChieh Chang Taiwan === - Hide quoted text - On Tue, 01 Mar 2005 08:56:19 +0100, Eric Dumazet <[EMAIL PROTECTED]> wrote: > Hi > > Try adding sockfd_put(sock) ; > > MingJie Chang wrote: > > Dear all, > > > > I want to get socket information by the sockfd while accetping, > > > > so I write a module to test sockfd_lookup(), > > > > but I got some problems when I test it. > > > > I hope someone can help me... > > > > Thank you > > > > following text is my code and error message > > === > > === code === > > > > int my_socketcall(int call,unsigned long *args) > > { > >int ret,err; > >struct socket * sock; > > > >ret = run_org_socket_call(call,args); //orignal sys_sockcall() > > > >if(call==SYS_ACCEPT&>=0) > >{ > > sock=sockfd_lookup(ret,); > > printk("lookup done\n"); > > if (sock) sockfd_put(sock) ; > > >} > >return ret; > > } > > Eric Dumazet > > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: question about sockfd_lookup( )
I can't use sockfd_put(sock) directly. I trace its code, the code is extern __inline__ void sockfd_put(struct socket *sock) { fput(sock->file); } so I use fput(sock->file) but it has problems too 1) execute "ls" in the ftp is also block 2) kernel prints "socki_lookup: socket file changed!" 3) execute "ftp localhost" after rmmod, it will crash and why the sockfd_put is needed after sockfd_lookup Thanak again MingChieh Chang Taiwan === On Tue, 01 Mar 2005 08:56:19 +0100, Eric Dumazet <[EMAIL PROTECTED]> wrote: > Hi > > Try adding sockfd_put(sock) ; > > MingJie Chang wrote: > > Dear all, > > > > I want to get socket information by the sockfd while accetping, > > > > so I write a module to test sockfd_lookup(), > > > > but I got some problems when I test it. > > > > I hope someone can help me... > > > > Thank you > > > > following text is my code and error message > > === > > === code === > > > > int my_socketcall(int call,unsigned long *args) > > { > >int ret,err; > >struct socket * sock; > > > >ret = run_org_socket_call(call,args); //orignal sys_sockcall() > > > >if(call==SYS_ACCEPT&>=0) > >{ > > sock=sockfd_lookup(ret,); > > printk("lookup done\n"); > > if (sock) sockfd_put(sock) ; > > >} > >return ret; > > } > > Eric Dumazet > > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: question about sockfd_lookup( )
I can't use sockfd_put(sock) directly. I trace its code, the code is extern __inline__ void sockfd_put(struct socket *sock) { fput(sock-file); } so I use fput(sock-file) but it has problems too 1) execute ls in the ftp is also block 2) kernel prints socki_lookup: socket file changed! 3) execute ftp localhost after rmmod, it will crash and why the sockfd_put is needed after sockfd_lookup Thanak again MingChieh Chang Taiwan === On Tue, 01 Mar 2005 08:56:19 +0100, Eric Dumazet [EMAIL PROTECTED] wrote: Hi Try adding sockfd_put(sock) ; MingJie Chang wrote: Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPTret=0) { sock=sockfd_lookup(ret,err); printk(lookup done\n); if (sock) sockfd_put(sock) ; } return ret; } Eric Dumazet - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: question about sockfd_lookup( )
I can't use sockfd_put(sock) directly. I trace its code, the code is extern __inline__ void sockfd_put(struct socket *sock) { fput(sock-file); } so I use fput(sock-file) but it has problems too 1) execute ls in the ftp is also block 2) kernel prints socki_lookup: socket file changed! 3) execute ftp localhost after rmmod, it will crash and why the sockfd_put is needed after sockfd_lookup Thanak again MingChieh Chang Taiwan === - Hide quoted text - On Tue, 01 Mar 2005 08:56:19 +0100, Eric Dumazet [EMAIL PROTECTED] wrote: Hi Try adding sockfd_put(sock) ; MingJie Chang wrote: Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPTret=0) { sock=sockfd_lookup(ret,err); printk(lookup done\n); if (sock) sockfd_put(sock) ; } return ret; } Eric Dumazet - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: question about sockfd_lookup( )
Hi Try adding sockfd_put(sock) ; MingJie Chang wrote: Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPT&>=0) { sock=sockfd_lookup(ret,); printk("lookup done\n"); if (sock) sockfd_put(sock) ; } return ret; } Eric Dumazet - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
question about sockfd_lookup( ) -- sorry I forget to say the kernel version
Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. kernel version: 2.4.20-8smp(RedHat9) and 2.4.26 are tried ftp server: vsftp 1.1.3-8 and wuftp 2.6.1-20 are tried I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPT&>=0) { sock=sockfd_lookup(ret,); printk("lookup done\n"); } return ret; } == === test and state === after inserting module, I use "ftp localhost" to test it. And it has some error when I use "ls" or "mget"(I just try the 2 commands) EX1: ls :file list is printed, but it will block until ctrl + c ftp> ls 227 Entering Passive Mode (127,0,0,1,68,186) 150 Here comes the directory listing. -rwxr-xr-x1 00 13744 Feb 28 05:22 socktest -rw-r--r--1 501 0 76288 Feb 27 19:05 vsftpd-1.1.0-1.i386.rpm -rw---1 501 03778 Feb 27 19:29 vsftpd.conf (blocking until ctrl+c) after ctrl+c receive aborted waiting for remote to finish abort 226 Directory send OK. 500 Unknown command. 663 bytes received in 51 secs (0.013 Kbytes/sec) ftp> EX2:mget: block until ctrl + c ,and file is not got ftp> mget * (blocking until ctrl+c) receive aborted waiting for remote to finish abort Unknown command. ftp> (file is not got) == == kernel message == and than I remove the module, try to ftp localhost again, and kernel will print some messages Unable to handle kernel paging request at virtual address c845a089 printing eip: c845a089 *pde=02ab4067(01194067) *pte=() Oops: CPU:0 EIP:0819:[]Not tainted EFLAGS: 00213296 eax: 0004 ebx: c6f18000 ecx: 0004 edx: 0004 esi: 0005 edi: ebp: c6f19fbc esp: c6f19f94 ds: 0821 es: 0821 ss: 0821 Process vsftpd (pid: 606, stackpage=c6f19000)<1> Stack: 0005 bb80 c6f18000 c6f18000 c6f18000 0004 bc58 c00ae4eb 0005 bb80 bc30 0004 bc58 0066 0833 0833 0066 420daa02 082b Call Trace: [] == End of mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
question about sockfd_lookup( )
Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPT&>=0) { sock=sockfd_lookup(ret,); printk("lookup done\n"); } return ret; } == === test and state === after inserting module, I use "ftp localhost" to test it. And it has some error when I use "ls" or "mget"(I just try the 2 commands) EX1: ls :file list is printed, but it will block until ctrl + c ftp> ls 227 Entering Passive Mode (127,0,0,1,68,186) 150 Here comes the directory listing. -rwxr-xr-x1 00 13744 Feb 28 05:22 socktest -rw-r--r--1 501 0 76288 Feb 27 19:05 vsftpd-1.1.0-1.i386.rpm -rw---1 501 03778 Feb 27 19:29 vsftpd.conf (blocking until ctrl+c) after ctrl+c receive aborted waiting for remote to finish abort 226 Directory send OK. 500 Unknown command. 663 bytes received in 51 secs (0.013 Kbytes/sec) ftp> EX2:mget: block until ctrl + c ,and file is not got ftp> mget * (blocking until ctrl+c) receive aborted waiting for remote to finish abort Unknown command. ftp> (file is not got) == == kernel message == and than I remove the module, try to ftp localhost again, and kernel will print some messages Unable to handle kernel paging request at virtual address c845a089 printing eip: c845a089 *pde=02ab4067(01194067) *pte=() Oops: CPU:0 EIP:0819:[]Not tainted EFLAGS: 00213296 eax: 0004 ebx: c6f18000 ecx: 0004 edx: 0004 esi: 0005 edi: ebp: c6f19fbc esp: c6f19f94 ds: 0821 es: 0821 ss: 0821 Process vsftpd (pid: 606, stackpage=c6f19000)<1> Stack: 0005 bb80 c6f18000 c6f18000 c6f18000 0004 bc58 c00ae4eb 0005 bb80 bc30 0004 bc58 0066 0833 0833 0066 420daa02 082b Call Trace: [] == End of mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
question about sockfd_lookup( )
Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPTret=0) { sock=sockfd_lookup(ret,err); printk(lookup done\n); } return ret; } == === test and state === after inserting module, I use ftp localhost to test it. And it has some error when I use ls or mget(I just try the 2 commands) EX1: ls :file list is printed, but it will block until ctrl + c ftp ls 227 Entering Passive Mode (127,0,0,1,68,186) 150 Here comes the directory listing. -rwxr-xr-x1 00 13744 Feb 28 05:22 socktest -rw-r--r--1 501 0 76288 Feb 27 19:05 vsftpd-1.1.0-1.i386.rpm -rw---1 501 03778 Feb 27 19:29 vsftpd.conf (blocking until ctrl+c) after ctrl+c receive aborted waiting for remote to finish abort 226 Directory send OK. 500 Unknown command. 663 bytes received in 51 secs (0.013 Kbytes/sec) ftp EX2:mget: block until ctrl + c ,and file is not got ftp mget * (blocking until ctrl+c) receive aborted waiting for remote to finish abort Unknown command. ftp (file is not got) == == kernel message == and than I remove the module, try to ftp localhost again, and kernel will print some messages Unable to handle kernel paging request at virtual address c845a089 printing eip: c845a089 *pde=02ab4067(01194067) *pte=() Oops: CPU:0 EIP:0819:[c845a089]Not tainted EFLAGS: 00213296 eax: 0004 ebx: c6f18000 ecx: 0004 edx: 0004 esi: 0005 edi: ebp: c6f19fbc esp: c6f19f94 ds: 0821 es: 0821 ss: 0821 Process vsftpd (pid: 606, stackpage=c6f19000)1 Stack: 0005 bb80 c6f18000 c6f18000 c6f18000 0004 bc58 c00ae4eb 0005 bb80 bc30 0004 bc58 0066 0833 0833 0066 420daa02 082b Call Trace: [c00ae4eb] == End of mail - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
question about sockfd_lookup( ) -- sorry I forget to say the kernel version
Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. kernel version: 2.4.20-8smp(RedHat9) and 2.4.26 are tried ftp server: vsftp 1.1.3-8 and wuftp 2.6.1-20 are tried I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPTret=0) { sock=sockfd_lookup(ret,err); printk(lookup done\n); } return ret; } == === test and state === after inserting module, I use ftp localhost to test it. And it has some error when I use ls or mget(I just try the 2 commands) EX1: ls :file list is printed, but it will block until ctrl + c ftp ls 227 Entering Passive Mode (127,0,0,1,68,186) 150 Here comes the directory listing. -rwxr-xr-x1 00 13744 Feb 28 05:22 socktest -rw-r--r--1 501 0 76288 Feb 27 19:05 vsftpd-1.1.0-1.i386.rpm -rw---1 501 03778 Feb 27 19:29 vsftpd.conf (blocking until ctrl+c) after ctrl+c receive aborted waiting for remote to finish abort 226 Directory send OK. 500 Unknown command. 663 bytes received in 51 secs (0.013 Kbytes/sec) ftp EX2:mget: block until ctrl + c ,and file is not got ftp mget * (blocking until ctrl+c) receive aborted waiting for remote to finish abort Unknown command. ftp (file is not got) == == kernel message == and than I remove the module, try to ftp localhost again, and kernel will print some messages Unable to handle kernel paging request at virtual address c845a089 printing eip: c845a089 *pde=02ab4067(01194067) *pte=() Oops: CPU:0 EIP:0819:[c845a089]Not tainted EFLAGS: 00213296 eax: 0004 ebx: c6f18000 ecx: 0004 edx: 0004 esi: 0005 edi: ebp: c6f19fbc esp: c6f19f94 ds: 0821 es: 0821 ss: 0821 Process vsftpd (pid: 606, stackpage=c6f19000)1 Stack: 0005 bb80 c6f18000 c6f18000 c6f18000 0004 bc58 c00ae4eb 0005 bb80 bc30 0004 bc58 0066 0833 0833 0066 420daa02 082b Call Trace: [c00ae4eb] == End of mail - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: question about sockfd_lookup( )
Hi Try adding sockfd_put(sock) ; MingJie Chang wrote: Dear all, I want to get socket information by the sockfd while accetping, so I write a module to test sockfd_lookup(), but I got some problems when I test it. I hope someone can help me... Thank you following text is my code and error message === === code === int my_socketcall(int call,unsigned long *args) { int ret,err; struct socket * sock; ret = run_org_socket_call(call,args); //orignal sys_sockcall() if(call==SYS_ACCEPTret=0) { sock=sockfd_lookup(ret,err); printk(lookup done\n); if (sock) sockfd_put(sock) ; } return ret; } Eric Dumazet - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/