Linux Kernel: copy_from_user - struct with pointers

前端 未结 2 1911
既然无缘
既然无缘 2021-01-17 16:53

I\'ve implemented some kind of character device and I need help with copy_ from_user function.

I\'ve a structure:

struct  my_struct{

int a;

int *b;         


        
2条回答
  •  执笔经年
    2021-01-17 17:33

    You are correct in your surmising. If you need to access the value *b, you will need to use copy_from_user (and copy_to_user to update it back in the user process).

提交回复
热议问题