Linux syscall parameter verification

Programming, for all ages and all languages.
Post Reply
angods
Member
Member
Posts: 26
Joined: Sat Oct 23, 2021 5:36 am

Linux syscall parameter verification

Post 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
thewrongchristian
Member
Member
Posts: 424
Joined: Tue Apr 03, 2018 2:44 am

Re: Linux syscall parameter verification

Post 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
angods
Member
Member
Posts: 26
Joined: Sat Oct 23, 2021 5:36 am

Re: Linux syscall parameter verification

Post 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
Octocontrabass
Member
Member
Posts: 5512
Joined: Mon Mar 25, 2013 7:01 pm

Re: Linux syscall parameter verification

Post by Octocontrabass »

nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Linux syscall parameter verification

Post 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.
Carpe diem!
Post Reply