User mode pointers in kernel mode

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

 



Hi,

In the 2.4 kernel series, is the following code correct?

copy_to_user(user_buffer, kernel_buffer_a, kernel_buf_a_size);
copy_to_user(user_buffer + kernel_buf_a_size, buffer_b, buf_b_size);

The point is calling copy_to_user twice to copy two kernel mode blobs
into the same user mode buffer, while _incrementing_ the user mode
buffer pointer.

I have already tried this on 2.4.28 (i386) and I haven't seen it
behave weirdly yet, however, I can't really find any other place in
the kernel that does something analogous.

Thanks,
Srdjan

--
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