google / safeside

Understand and mitigate software-observable side-channels
BSD 3-Clause "New" or "Revised" License
493 stars 53 forks source link

FreeBSD support #110

Open emaste opened 4 years ago

emaste commented 4 years ago

I would very much like to see FreeBSD support upstream, so am submitting this issue to track.

I have prototyped adding FreeBSD CI vi Cirrus-CI and will clean up and submit the patches if there's a willingness to add support.

Example CI run: https://cirrus-ci.com/task/6608512263651328

asteinha commented 4 years ago

FreeBSD is certainly a relevant operating system and we want to support it. SafeSide is focused on CPU misbehavior, so there is no reason to restrict its coverage only to some operating systems. At the same time we would really like the FreeBSD community to participate in here. However, we won't have too much time to invest in supporting specifically the FreeBSD and we cannot commit to some systematic quality control on FreeBSD beyond your CI - FreeBSD will be in a similar position as currently MacOS or Windows. If you provide us with the FreeBSD CI, we will do our best in order not to break it.

There are some examples that should work on FreeBSD right out of the box - Spectre v1 PHT, Spectre v1 BTB SA, Spectre v4 or recursive Ret2spec. Some other examples should work just with deleting the Linux ifdefs and extending the CMake configs - e.g. L1TF, Meltdown-DE or Meltdown-AC. The rest of the examples would probably require some work to be done - mostly those using kernel modules or some specific Linux syscalls (modifying the LDT, pinning threads on cores, etc.). You are welcome to port existing demonstrations to FreeBSD as well as create new ones.