I took a look at the code you sent via personal message. You have a statement such as the following:
Code:
return sprintf(buffer, to_be_written);
In general, you can’t do this. You have to look at how many bytes the userspace application requested (in
buffer_length in your code) and to be completely correct, you also need to look at the offset.