Hacker News new | past | comments | ask | show | jobs | submit login
Debugging an Ioctl Problem on OpenBSD (jcs.org)
68 points by hucste on Feb 17, 2022 | hide | past | favorite | 9 comments



I believe FreeBSD intentionally truncates provided ioctls to the low 32-bit space because of exactly this kind of bogus assumption in userspace:

https://github.com/freebsd/freebsd-src/blob/main/sys/kern/sy...

It's a relatively recent change (2020). Here's the corresponding place OpenBSD doesn't do that:

https://github.com/openbsd/src/blob/master/sys/kern/sys_gene...


I'm annoyed ktrace wasn't revisited. If the integer was getting truncated, why did ktrace print that the request was still VIDIOC_S_FMT? Shouldn't it have printed some goofy number that didn't match?



Oh! That's dumb. The printer correctly uses unsigned long.

https://github.com/openbsd/src/blob/master/usr.bin/kdump/mki...


That is weird. I don't see an easy explanation. kdump uses unsigned long.


Jcs is always doing something cool. Thanks for the write up!


Indeed. As a programmer desperate for technical edutainment to consume after work, he’s a gem.


As an OpenBSD and retro protocol user (gopher, irc, MUDs, and so on) JCS is amazing.


More people should pay attention to this OS. The source code is so clean and simple compared to Linux.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: