Restricting path name lookup with openat2()
Restricting path name lookup with openat2()
Posted Aug 24, 2019 5:28 UTC (Sat) by cyphar (subscriber, #110703)In reply to: Restricting path name lookup with openat2() by k8to
Parent article: Restricting path name lookup with openat2()
Yes, it is checked (you get -EINVAL if it's non-zero).
As for figuring out whether syscalls have particular features, the best way is to pass the flag and see if you get -EINVAL -- this is why checking whether there are unknown flags present and returning -EINVAL is important in syscall design. If you don't check whether unknown flags are passed, you end up with situations where userspace cannot easily figure out whether the flag is actually supported. open(2) doesn't do this check (which makes it significantly more complicated to figure out whether your kernel supports a particular open(2) feature), but in openat2(2) we do check whether there are unknown O_* flags present.
Posted Aug 24, 2019 20:14 UTC (Sat)
by quotemstr (subscriber, #45331)
[Link] (1 responses)
Posted Aug 25, 2019 14:51 UTC (Sun)
by cyphar (subscriber, #110703)
[Link]
All of that being said, I am gravitating towards not having reserved space. I don't have particularly strong opinions either way.
Posted Aug 26, 2019 19:18 UTC (Mon)
by k8to (guest, #15413)
[Link]
Restricting path name lookup with openat2()
Restricting path name lookup with openat2()
Restricting path name lookup with openat2()
