Page 1 of 1

Linux syscall parameter verification

Posted: Sat Oct 30, 2021 2:12 pm
by angods
https://wiki.osdev.org/System_Calls mentions, that Linux fails to verify pointers from userland. Can someone explain if that's still (or was ever) true and why exactly did Linux lack such safety checks?

Thanks :D

Re: Linux syscall parameter verification

Posted: Sat Oct 30, 2021 3:36 pm
by thewrongchristian
angods wrote:https://wiki.osdev.org/System_Calls mentions, that Linux fails to verify pointers from userland. Can someone explain if that's still (or was ever) true and why exactly did Linux lack such safety checks?

Thanks :D
I don't think that is true. Linux provides access checks and copying to/from user memory:

https://elixir.bootlin.com/linux/v5.14. ... cess.h#L52

Re: Linux syscall parameter verification

Posted: Sat Oct 30, 2021 5:33 pm
by angods
thewrongchristian wrote:
angods wrote:https://wiki.osdev.org/System_Calls mentions, that Linux fails to verify pointers from userland. Can someone explain if that's still (or was ever) true and why exactly did Linux lack such safety checks?

Thanks :D
I don't think that is true. Linux provides access checks and copying to/from user memory:

https://elixir.bootlin.com/linux/v5.14. ... cess.h#L52
Then the osdev page should be corrected

Re: Linux syscall parameter verification

Posted: Sat Oct 30, 2021 6:01 pm
by Octocontrabass

Re: Linux syscall parameter verification

Posted: Sat Oct 30, 2021 9:21 pm
by nullplan
I was getting around to that...

Sorry. I added the wrong sentence, and I also just removed it. I originally got tripped up by the difference between get_user and __get_user. The former verifies the pointer is in range, the latter doesn't.