I stumbled over a problem which should have led to some trouble
but did not on the UML system.
I implemented a system call that copied data (the string NAME) from user space
to kernel space with strncpy. I should have used strncpy_from_user
for security reasons. OK, my fault I just made the kernel unsecure.
Then I patched the execute_syscall() function und used sys_open(NAME, ...)
to open a file and save some information. With NAME I mean the copied
value from the kernel space.
Now I read and saw it in the kernel sources that all service functions check
if their parameters are actually from the user space and if not they
fail with some error code. To overcome this you should set the address
segment of current() to the kernel data segment via the set_fs/get_fs
But, I did not do this and I had no problems in UML.
As far as I understand it currently, my solutions should not
Do I oversee something or is UML here missing something?
BTW, does anybody know what the "fs" mean in the set_fs/get_fs