copy_from_user() - executing twice to read the data from same pointers

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

 



Hi all,

I am writing a module in which i am using "copy_from_user()" twice to read the data from user space to kernel space with the same pointers. Will it make any difference  in the second function.

Thanks,
Deepak Joshi

Code.---



                unsigned long a[6];
                unsigned long a0,a1;
                int err, check_family = 0;
                struct sockaddr_un *sunaddr = NULL;

                if(call<1||call>SYS_RECVMSG)
                        return -EINVAL;

                if (copy_from_user(a, args, nargs[call]))
                        return -EFAULT;

                a0=a[0];
                a1=a[1];

                sunaddr = (struct sockaddr_un *)a1;

                if(sunaddr->sun_family == AF_UNIX)
                        check_family = 1;

                err = original_sys_fun_call(call,args);


where original_sys_fun_call will again call the copy_from_user() function with  same pointer arguments.

Thanks,
Deepak Joshi


New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.

[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