Copy_from_user twice - character device

I have implemented a personal device, and I would like to ask if this is correct:

  • In user space, I have a structure with 2 pointers.

  • I have writethis structure in my device.

  • In my writefunction in a char device I have copy_from_userthis structure in kmalloced space.

  • After that, I am in KS and got 2 pointers to the USA, so I want copy_from_usereveryone. Can I do this right after the first copy_from_userusing these copied addresses? They point to data in the US application that calls the function writenot for the function argument write char *buf.

+3
source share
1 answer

, .

, , , ioctl write, , , . ; .

+1

Source: https://habr.com/ru/post/1725094/


All Articles