A tale of /dev/fd
http://phala.isatty.net/~amber/hacks/devfd [phala.isatty.net]
2023-10-22 23:08
tags:
admin
freebsd
linux
systems
unix
Many versions of Unix provide a /dev/fd directory to work with open file handles as if they were regular files. As usual, the devil is in the details.
source: L
FreeBSD on Firecracker
https://www.usenix.org/publications/loginonline/freebsd-firecracker [www.usenix.org]
2023-08-24 15:14
tags:
freebsd
perf
programming
systems
virtualization
Experiences porting FreeBSD 14 to run on the Firecracker VMM
source: L
CVE-2022-23088: Exploiting A Heap Overflow In The Freebsd Wi-Fi Stack
https://www.zerodayinitiative.com/blog/2022/6/15/cve-2022-23088-exploiting-a-heap-overflow-in-the-freebsd-wi-fi-stack [www.zerodayinitiative.com]
2022-06-16 18:38
tags:
exploit
freebsd
programming
security
wifi
In April of this year, FreeBSD patched a 13-year-old heap overflow in the Wi-Fi stack that could allow network-adjacent attackers to execute arbitrary code on affected installations of FreeBSD Kernel. This bug was originally reported to the ZDI program by a researcher known as m00nbsd and patched in April 2022 as FreeBSD-SA-22:07.wifi_meshid. The researcher has graciously provided this detailed write-up of the vulnerability and a proof-of-concept exploit demonstrating the bug.
source: L
Tale of two hypervisor bugs - Escaping from FreeBSD bhyve
http://phrack.org/papers/escaping_from_freebsd_bhyve.html [phrack.org]
2020-04-04 22:02
tags:
c
exploit
freebsd
malloc
programming
security
VM escape has become a popular topic of discussion over the last few years. A good amount of research on this topic has been published for various hypervisors like VMware, QEMU, VirtualBox, Xen and Hyper-V. Bhyve is a hypervisor for FreeBSD supporting hardware-assisted virtualization. This paper details the exploitation of two bugs in bhyve - FreeBSD-SA-16:32.bhyve [1] (VGA emulation heap overflow) and CVE-2018-17160 [21] (Firmware Configuration device bss buffer overflow) and some generic techniques which could be used for exploiting other bhyve bugs. Further, the paper also discusses sandbox escapes using PCI device passthrough, and Control-Flow Integrity bypasses in HardenedBSD 12-CURRENT
source: grugq
The FreeBSD-linuxulator explained (for users)
https://www.leidinger.net/blog/2010/09/28/the-freebsd-linuxulator-explained-for-users/ [www.leidinger.net]
2020-03-24 03:00
tags:
freebsd
linux
virtualization
First, the linuxulator is not an emulation. It is “just” a binary interface which is a little bit different from the FreeBSD-“native”-one. This means that the binary files in FreeBSD and Linux are both files which comply to the ELF specification.
source: vermaden
FreeBSD'fy ZFS zlib zalloc/zfree callbacks
https://svnweb.freebsd.org/base?view=revision&revision=354159 [svnweb.freebsd.org]
2019-11-05 04:28
tags:
bugfix
freebsd
malloc
perf
The previous code came from OpenSolaris, which in my understanding require allocation size to be known to free memory. To store that size previous code allocated additional 8 byte header. But I have noticed that zlib with present settings allocates 64KB context buffers for each call, that could be efficiently cached by UMA, but addition of those 8 bytes makes them fall back to physical RAM allocations, that cause huge overhead and lock congestion on small blocks. Since FreeBSD’s free() does not have the size argument, switching to it solves the problem, increasing write speed to ZVOLs with 4KB block size and GZIP compression on my 40-threads test system from ~60MB/s to ~600MB/s.
source: vermaden
Fixing up KA9Q-unix, or "neck deep in 30 year old codebases.."
http://adrianchadd.blogspot.com/2019/09/fixing-up-ka9q-unix-or-neck-deep-in-30.html [adrianchadd.blogspot.com]
2019-09-28 19:50
tags:
freebsd
networking
retro
social
wifi
Anyhoo, I’ve finally been mucking around with AX.25 packet radio. I’ve been wanting to do this since I was a teenager and found out about its existence, but back in high school and .. well, until a few years ago really .. I didn’t have my amateur radio licence. But, now I do, and I’ve done a bunch of other stuff with a bunch of other radios. The main stumbling block? All my devices are either Apple products or run FreeBSD - and none of them have useful AX.25 stacks. The main stacks of choice these days run on Linux, Windows or are a full hardware TNC.
Exploiting FreeBSD-SA-19:02.fd
https://secfault-security.com/blog/FreeBSD-SA-1902.fd.html [secfault-security.com]
2019-07-08 20:26
tags:
c
exploit
freebsd
programming
security
The advisory describes that FreeBSD 12.0 introduced a bug in this mechanism. As the file descriptor information is sent via a socket, the sender and the receiver have to allocate buffers for the procedure. If the receiving buffer is not large enough, the FreeBSD kernel attempts to close the received file descriptors to prevent a leak of these to the sender. However, while the responsible function closes the file descriptor, it fails to release the reference from the file descriptor to the file object. This could cause the reference counter to wrap.
source: L
Provide protection against starvation of the ll/sc loops when accessing userpace.
https://reviews.freebsd.org/D20772 [reviews.freebsd.org]
2019-07-08 15:43
tags:
bugfix
concurrency
cpu
freebsd
systems
Casueword(9) on ll/sc architectures must be prepared for userspace constantly modifying the same cache line as containing the CAS word, and not loop infinitely. Otherwise, rogue userspace livelock kernel.
source: vermaden
Linux and FreeBSD Kernel: Multiple TCP-based remote denial of service issues
https://www.openwall.com/lists/oss-security/2019/06/17/5 [www.openwall.com]
2019-06-17 17:45
tags:
freebsd
linux
networking
security
Netflix has identified several TCP networking vulnerabilities in FreeBSD and Linux kernels. The vulnerabilities specifically relate to the minimum segment size (MSS) and TCP Selective Acknowledgement (SACK) capabilities. The most serious, dubbed “SACK Panic,” allows a remotely-triggered kernel panic on recent Linux kernels.
Also: https://access.redhat.com/security/vulnerabilities/tcpsack
powerpc64 architecture support in FreeBSD ports
https://doi.asiabsdcon.org/10.25263/asiabsdcon2019/p02a [doi.asiabsdcon.org]
2019-04-25 15:55
tags:
development
freebsd
intro-programming
pdf
For my project, I build the whole ports tree using Poudriere and fix the compilation errors I meet. In this paper, I specify challenges met during porting software to work on POWER processors on FreeBSD and show how most problems can be solved.
Trivial stuff, if only people cared. Relevant beyond narrow scope of FreeBSD PowerPC as well.
Introducing funlinkat
https://oshogbo.vexillium.org/blog/63/ [oshogbo.vexillium.org]
2019-04-10 18:13
tags:
freebsd
fs
unix
This syscall would only performs additional sanitary checks if we are removing a directory entry which corresponds to the inode stored which refers to the file descriptor.
source: L
Less Known pkg(8) Features
https://vermaden.wordpress.com/2019/01/17/less-known-pkg8-features/ [vermaden.wordpress.com]
2019-01-17 23:08
tags:
admin
freebsd
swtools
In this entry I will try to describe less known pkg(8) features.
Below you will find the updated Rosetta Stone between old pkg_* tools compared to current pkg(8) framework.
The Super Capsicumizer 9000
https://github.com/myfreeweb/capsicumizer [github.com]
2018-12-23 20:46
tags:
defense
freebsd
security
swtools
virtualization
capsicumizer is a sandbox launcher that imposes Capsicum capability mode onto an unsuspecting program, allowing “sysadmin style” or “oblivious” sandboxing (i.e. no source code modifications, all restrictions added externally).
source: Dfly
The future of ZFS in FreeBSD
https://lists.freebsd.org/pipermail/freebsd-current/2018-December/072422.html [lists.freebsd.org]
2018-12-19 21:18
tags:
freebsd
fs
storage
update
This shift means that there will be little to no net new development of Illumos. While working through the git history of ZoL I have also discovered that many races and locking bugs have been fixed in ZoL and never made it back to Illumos and thus FreeBSD. This state of affairs has led to a general agreement among the stakeholders that I have spoken to that it makes sense to rebase FreeBSD’s ZFS on ZoL.
Also some background: https://lists.freebsd.org/pipermail/freebsd-current/2018-December/072430.html
source: L
FreeBSD 12.0-RELEASE Now Available
https://lists.freebsd.org/pipermail/freebsd-announce/2018-December/001856.html [lists.freebsd.org]
2018-12-12 00:04
tags:
freebsd
release
Capsicum
https://oshogbo.vexillium.org/blog/57/ [oshogbo.vexillium.org]
2018-11-18 01:08
tags:
defense
freebsd
fs
security
unix
I spent a couple of years evangelizing about Capsicum. I wrote many articles about it. So, it is very natural that I would also like to update you on this blog about the progress of the Capsicum project in FreeBSD, because this is what I’m doing in my free time. That said I feel that this blog wouldn’t be completed without some introduction to what Capsicum is. This post should fill this gap. Over the next weeks and months we will extend this topic and discuss different parts of Capsicum.
source: Dfly
Dive into syscall handling on freeBSD AMD64
https://cryptoden.pw/downloads/Dive_into_syscall_handling_on_freeBSD_AMD64.txt [cryptoden.pw]
2018-10-31 02:15
tags:
c
cpu
freebsd
programming
systems
Very detailed.
source: Dfly
PS4 5.05 BPF Double Free Kernel Exploit Writeup
https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%205.05%20BPF%20Double%20Free%20Kernel%20Exploit%20Writeup.md [github.com]
2018-07-17 19:09
tags:
exploit
freebsd
security
systems
Welcome to the 5.0x kernel exploit write-up. A few months ago, a kernel vulnerability was discovered by qwertyoruiopz and an exploit was released for BPF which involved crafting an out-of-bounds (OOB) write via use-after-free (UAF) due to the lack of proper locking. It was a fun bug, and a very trivial exploit. Sony then removed the write functionality from BPF, so that exploit was patched. However, the core issue still remained (being the lack of locking). A very similar race condition still exists in BPF past 4.55, which we will go into detail below on.
source: L
Dumping a PS4 Kernel in "Only" 6 Days
https://fail0verflow.com/blog/2017/ps4-crashdump-dump/ [fail0verflow.com]
2017-12-30 00:31
tags:
freebsd
investigation
security
What if a secure device had an attacker-viewable crashdump format? What if that same device allowed putting arbitrary memory into the crashdump? Amazingly, the ps4 tempted fate by supporting both of these features! Let’s see how that turned out…
source: L