Re: copy_to/from_use query?

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

 



On Thursday 14 October 2004 12:46, mohanlal jangir wrote:

>      p_kernel_data->p_len =
>           (int*) kmalloc(p_kernel_data->len, GFP_KERNEL);

  I think this assignment overwrites the user space pointer value. So, before 
kmalloc(), copy it to another local variable (say temp), and use that in 
place of 'p_usr_data->p_len' below, which even I think is not a right thing.

>
>      copy_from_usr(p_kernel_data->p_len,
>            p_usr_data->p_len, p_kernel_data->len);
>         /* ^^^^^^^^^^^^^ */

-- 
Regards,
Kiran Kumar Immidi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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