<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" encoding="UTF-8" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:atom="http://www.w3.org/2005/Atom/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:fireside="http://fireside.fm/modules/rss/fireside">
  <channel>
    <fireside:hostname>web02.fireside.fm</fireside:hostname>
    <fireside:genDate>Sun, 17 May 2026 08:42:36 -0500</fireside:genDate>
    <generator>Fireside (https://fireside.fm)</generator>
    <title>BSD Now - Episodes Tagged with “Ps4”</title>
    <link>https://www.bsdnow.tv/tags/ps4</link>
    <pubDate>Wed, 25 Jul 2018 01:00:00 -0400</pubDate>
    <description>Created by three guys who love BSD, we cover the latest news and have an extensive series of tutorials, as well as interviews with various people from all areas of the BSD community. It also serves as a platform for support and questions. We love and advocate FreeBSD, OpenBSD, NetBSD, DragonFlyBSD and TrueOS. Our show aims to be helpful and informative for new users that want to learn about them, but still be entertaining for the people who are already pros.
The show airs on Wednesdays at 2:00PM (US Eastern time) and the edited version is usually up the following day. 
</description>
    <language>en-us</language>
    <itunes:type>episodic</itunes:type>
    <itunes:subtitle>A weekly podcast and the place to B...SD</itunes:subtitle>
    <itunes:author>JT Pennington</itunes:author>
    <itunes:summary>Created by three guys who love BSD, we cover the latest news and have an extensive series of tutorials, as well as interviews with various people from all areas of the BSD community. It also serves as a platform for support and questions. We love and advocate FreeBSD, OpenBSD, NetBSD, DragonFlyBSD and TrueOS. Our show aims to be helpful and informative for new users that want to learn about them, but still be entertaining for the people who are already pros.
The show airs on Wednesdays at 2:00PM (US Eastern time) and the edited version is usually up the following day. 
</itunes:summary>
    <itunes:image href="https://media24.fireside.fm/file/fireside-images-2024/podcasts/images/c/c91b88f1-e824-4815-bcb8-5227818d6010/cover.jpg?v=4"/>
    <itunes:explicit>no</itunes:explicit>
    <itunes:keywords>berkeley,freebsd,openbsd,netbsd,dragonflybsd,trueos,trident,hardenedbsd,tutorial,howto,guide,bsd,interview</itunes:keywords>
    <itunes:owner>
      <itunes:name>JT Pennington</itunes:name>
      <itunes:email>feedback@bsdnow.tv</itunes:email>
    </itunes:owner>
<itunes:category text="News">
  <itunes:category text="Tech News"/>
</itunes:category>
<itunes:category text="Education">
  <itunes:category text="How To"/>
</itunes:category>
<item>
  <title>Episode 256: Because Computers | BSD Now 2^8</title>
  <link>https://www.bsdnow.tv/256</link>
  <guid isPermaLink="false">http://feed.jupiter.zone/bsdnow#entry-2304</guid>
  <pubDate>Wed, 25 Jul 2018 01:00:00 -0400</pubDate>
  <author>JT Pennington</author>
  <enclosure url="https://aphid.fireside.fm/d/1437767933/c91b88f1-e824-4815-bcb8-5227818d6010/d5ca53c5-7144-4ce4-9189-591a8ac5767b.mp3" length="63008930" type="audio/mp3"/>
  <itunes:episodeType>full</itunes:episodeType>
  <itunes:author>JT Pennington</itunes:author>
  <itunes:subtitle>FreeBSD ULE vs. Linux CFS, OpenBSD on Tuxedo InfinityBook, how zfs diff reports filenames efficiently, why choose FreeBSD over Linux, PS4 double free exploit, OpenBSD’s wifi autojoin, and FreeBSD jails the hard way.</itunes:subtitle>
  <itunes:duration>1:44:42</itunes:duration>
  <itunes:explicit>no</itunes:explicit>
  <itunes:image href="https://media24.fireside.fm/file/fireside-images-2024/podcasts/images/c/c91b88f1-e824-4815-bcb8-5227818d6010/cover.jpg?v=4"/>
  <description>&lt;p&gt;FreeBSD ULE vs. Linux CFS, OpenBSD on Tuxedo InfinityBook, how zfs diff reports filenames efficiently, why choose FreeBSD over Linux, PS4 double free exploit, OpenBSD’s wifi autojoin, and FreeBSD jails the hard way.&lt;/p&gt;

&lt;h2&gt;Win&lt;/h2&gt;

&lt;p&gt;Celebrate our 256th episode with us. You can win a Mogics Power Bagel (not sponsored).&lt;/p&gt;

&lt;p&gt;To enter, go find the 4 episodes we did in December of 2017. In the opening, find the 4 letters in the bookshelf behind me. They spell different words in each of the 4 episodes. Send us these words in order to &lt;a href="mailto:feedback@bsdnow.tv" target="_blank" rel="nofollow noopener"&gt;feedback@bsdnow.tv&lt;/a&gt; with the subject “bsdnow256” until August 8th, 2018 18:00 UTC and we’ll randomly draw the winner on the live show. We’ll then contact you to ship the item.&lt;br&gt;
Only one item to win. All decisions are final. Better luck next time.&lt;/p&gt;

&lt;h2&gt;Headlines&lt;/h2&gt;

&lt;h3&gt;Battle of the Schedulers: FreeBSD ULE vs. Linux CFS&lt;/h3&gt;

&lt;p&gt;Introduction&lt;br&gt;
This paper analyzes the impact on application performance of the design and implementation choices made in two widely used open-source schedulers: ULE, the default FreeBSD scheduler, and CFS, the default Linux scheduler. We compare ULE and CFS in otherwise identical circumstances. We have ported ULE to Linux, and use it to schedule all threads that are normally scheduled by CFS. We compare the performance of a large suite of applications on the modified kernel running ULE and on the standard Linux kernel running CFS. The observed performance differences are solely the result of scheduling decisions, and do not reflect differences in other subsystems between FreeBSD and Linux. There is no overall winner. On many workloads the two schedulers perform similarly, but for some workloads there are significant and even surprising differences. ULE may cause starvation, even when executing a single application with identical threads, but this starvation may actually lead to better application performance for some workloads. The more complex load balancing mechanism of CFS reacts more quickly to workload changes, but ULE achieves better load balance in the long run.&lt;br&gt;
Operating system kernel schedulers are responsible for maintaining high utilization of hardware resources (CPU cores, memory, I/O devices) while providing fast response time to latency-sensitive applications. They have to react to workload changes, and handle large numbers of cores and threads with minimal overhead [12]. This paper provides a comparison between the default schedulers of two of the most widely deployed open-source operating systems: the Completely Fair Scheduler (CFS) used in Linux, and the ULE scheduler used in FreeBSD. Our goal is not to declare an overall winner.&lt;br&gt;
In fact, we find that for some workloads ULE is better and for others CFS is better. Instead, our goal is to illustrate how differences in the design and the implementation of the two schedulers are reflected in application performance under different workloads. ULE and CFS are both designed to schedule large numbers of threads on large multicore machines. Scalability considerations have led both schedulers to adopt per-core run-queues. On a context switch, a core accesses only its local run-queue to find the next thread to run. Periodically and at select times, e.g., when a thread wakes up, both ULE and CFS perform load balancing, i.e., they try to balance the amount of work waiting in the run-queues of different cores.&lt;br&gt;
ULE and CFS, however, differ greatly in their design and implementation choices. FreeBSD ULE is a simple scheduler (2,950 lines of code in FreeBSD 11.1), while Linux CFS is much more complex (17,900 lines of code in the latest LTS Linux kernel, Linux 4.9). FreeBSD run-queues are FIFO. For load balancing, FreeBSD strives to even out the number of threads per core. In Linux, a core decides which thread to run next based on prior execution time, priority, and perceived cache behavior of the threads in its runqueue. Instead of evening out the number of threads between cores, Linux strives to even out the average amount of pending work.&lt;/p&gt;

&lt;p&gt;Performance analysis&lt;br&gt;
We now analyze the impact of the per-core scheduling on the performance of 37 applications. We define “performance” as follows: for database workloads and NAS applications, we compare the number of operations per second, and for the other applications we compare “execution time”. The higher the “performance”, the better a scheduler performs. Figure 5 presents the performance difference between CFS and ULE on a single core, with percentages above 0 meaning that the application executes faster with ULE than CFS.&lt;br&gt;
Overall, the scheduler has little influence on most workloads. Indeed, most applications use threads that all perform the same work, thus both CFS and ULE endup scheduling all of the threads in a round-robin fashion. The average performance difference is 1.5%, in favor of ULE. Still, scimark is 36% slower on ULE than CFS, and apache is 40% faster on ULE than CFS. Scimark is a single-threaded Java application. It launches one compute thread, and the Java runtime executes other Java system threads in the background (for the garbage collector, I/O, etc.).&lt;br&gt;
When the application is executed with ULE, the compute thread can be delayed, because Java system threads are considered interactive and get priority over the computation thread. The apache workload consists of two applications: the main server (httpd) running 100 threads, and ab, a single-threaded load injector.&lt;br&gt;
The performance difference between ULE and CFS is explained by different choices regarding thread preemption. In ULE, full preemption is disabled, while CFS preempts the running thread when the thread that has just been woken up has a vruntime that is much smaller than the vruntime of the currently executing thread (1ms difference in practice). In CFS, ab is preempted 2 million times during the benchmark, while it never preempted with ULE.&lt;br&gt;
This behavior is explained as follows: ab starts by sending 100 requests to the httpd server, and then waits for the server to answer. When ab is woken up, it checks which requests have been processed and sends new requests to the server. Since ab is single-threaded, all requests sent to the server are sent sequentially. In ULE, ab is able to send as many new requests as it has received responses. In CFS, every request sent by ab wakes up a httpd thread, which preempts ab.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Scheduling threads on a multicore machine is hard. In this paper, we perform a fair comparison of the design choices of two widely used schedulers: the ULE scheduler from FreeBSD and CFS from Linux. We show that they behave differently even on simple workloads, and that no scheduler performs better than the other on all workloads.&lt;/p&gt;

&lt;h3&gt;OpenBSD 6.3 on Tuxedo InfinityBook&lt;/h3&gt;

&lt;p&gt;Disclaimer:&lt;br&gt;
I came across the Tuxedo Computers InfinityBook last year at the Open! Conference where Tuxedo had a small booth. Previously they came to my attention since they’re a member of the OSB Alliance on whose board I’m a member. Furthermore Tuxedo Computers are a sponsor of the OSBAR which I’m part of the organizational team.&lt;/p&gt;

&lt;p&gt;OpenBSD on the Tuxedo InfinityBook&lt;br&gt;
I’ve asked the guys over at Tuxedo Computers whether they would be interested to have some tests with *BSD done and that I could test drive one of their machines and give feedback on what works and what does not - and possibly look into it.+&lt;/p&gt;

&lt;p&gt;Within a few weeks they shipped me a machine and last week the InfinityBook Pro 14” arrived. Awesome. Thanks already to the folks at Tuxedo Computers. The machine arrived accompanied by lot’s of swag :)&lt;/p&gt;

&lt;p&gt;The InfinityBook is a very nice machine and allows a wide range of configuration. The configuration that was shipped to me:&lt;/p&gt;

&lt;p&gt;Intel Core i7-8550U&lt;br&gt;
1x 16GB RAM 2400Mhz Crucial Ballistix Sport LT&lt;br&gt;
250 GB Samsung 860 EVO (M.2 SATAIII)&lt;/p&gt;

&lt;p&gt;I used a USB-stick to boot install63.fs and re-installed the machine with OpenBSD. Full dmesg.&lt;/p&gt;

&lt;p&gt;The installation went flawlessly, the needed intel firmware is being installed after installation automatically via fw_update(1).&lt;/p&gt;

&lt;p&gt;Out of the box the graphics works and once installed the machine presents the login.&lt;/p&gt;

&lt;p&gt;Video&lt;br&gt;
When X starts the display is turned off for some reason. You will need to hit fn+f12 (the key with the moon on it) then the display will go on. Aside from that little nit, X works just fine and presents one the expected resolution.&lt;/p&gt;

&lt;p&gt;External video is working just fine as well. Either via hdmi output or via the mini displayport connector.&lt;/p&gt;

&lt;p&gt;The buttons for adjusting brightness (fn+f8 and fn+f9) are not working. Instead one has to use wsconsctl(8) to adjust the brightness.&lt;/p&gt;

&lt;p&gt;Networking&lt;br&gt;
The infinityBook has built-in ethernet, driven by re(4) And for the wireless interface the iwm(4) driver is being used. Both work as expected.&lt;/p&gt;

&lt;p&gt;ACPI&lt;br&gt;
Neither suspend nor hibernate work. Reporting of battery status is bogus as well. Some of the keyboard function keys work:&lt;/p&gt;

&lt;p&gt;LCD on/off works (fn+f2)&lt;br&gt;
Keyboard backlight dimming works (fn+f4)&lt;br&gt;
Volume (fn+f5 / fn+f6) works&lt;/p&gt;

&lt;p&gt;Sound&lt;br&gt;
The azalia chipset is being used for audio processing. Works as expected, volume can be controlled via buttons (fn+f5, fn+f6) or via mixerctl.&lt;/p&gt;

&lt;p&gt;Touchpad&lt;br&gt;
Can be controlled via wsconsctl(8).&lt;br&gt;
So far I must say, that the InfinityBook makes a nice machine - and I’m enjoying working with it.&lt;/p&gt;

&lt;p&gt;iXsystems&lt;br&gt;
iXsystems - Its all NAS&lt;/p&gt;

&lt;h3&gt;How ZFS makes things like ‘zfs diff’ report filenames efficiently&lt;/h3&gt;

&lt;p&gt;As a copy on write (file)system, ZFS can use the transaction group (txg) numbers that are embedded in ZFS block pointers to efficiently find the differences between two txgs; this is used in, for example, ZFS bookmarks. However, as I noted at the end of my entry on block pointers, this doesn’t give us a filesystem level difference; instead, it essentially gives us a list of inodes (okay, dnodes) that changed.&lt;br&gt;
In theory, turning an inode or dnode number into the path to a file is an expensive operation; you basically have to search the entire filesystem until you find it. In practice, if you’ve ever run ‘zfs diff’, you’ve likely noticed that it runs pretty fast. Nor is this the only place that ZFS quickly turns dnode numbers into full paths, as it comes up in ‘zpool status’ reports about permanent errors. At one level, zfs diff and zpool status do this so rapidly because they ask the ZFS code in the kernel to do it for them. At another level, the question is how the kernel’s ZFS code can be so fast.&lt;br&gt;
The interesting and surprising answer is that ZFS cheats, in a way that makes things very fast when it works and almost always works in normal filesystems and with normal usage patterns. The cheat is that ZFS dnodes record their parent’s object number.&lt;br&gt;
If you’re familiar with the twists and turns of Unix filesystems, you’re now wondering how ZFS deals with hardlinks, which can cause a file to be in several directories at once and so have several parents (and then it can be removed from some of the directories). The answer is that ZFS doesn’t; a dnode only ever tracks a single parent, and ZFS accepts that this parent information can be inaccurate. I’ll quote the comment in zfs_obj_to_pobj:&lt;br&gt;
When a link is removed [the file’s] parent pointer is not changed and will be invalid. There are two cases where a link is removed but the file stays around, when it goes to the delete queue and when there are additional links.&lt;br&gt;
Before I get into the details, I want to say that I appreciate the brute force elegance of this cheat. The practical reality is that most Unix files today don’t have extra hardlinks, and when they do most hardlinks are done in ways that won’t break ZFS’s parent stuff. The result is that ZFS has picked an efficient implementation that works almost all of the time; in my opinion, the great benefit we get from having it around are more than worth the infrequent cases where it fails or malfunctions. Both zfs diff and having filenames show up in zpool status permanent error reports are very useful (and there may be other cases where this gets used).&lt;br&gt;
The current details are that any time you hardlink a file to somewhere or rename it, ZFS updates the file’s parent to point to the new directory. Often this will wind up with a correct parent even after all of the dust settles; for example, a common pattern is to write a file to an initial location, hardlink it to its final destination, and then remove the initial location version. In this case, the parent will be correct and you’ll get the right name.&lt;/p&gt;

&lt;h2&gt;News Roundup&lt;/h2&gt;

&lt;h3&gt;What is FreeBSD? Why Should You Choose It Over Linux?&lt;/h3&gt;

&lt;p&gt;Not too long ago I wondered if and in what situations FreeBSD could be faster than Linux and we received a good amount of informative feedback. So far, Linux rules the desktop space and FreeBSD rules the server space.&lt;/p&gt;

&lt;p&gt;In the meantime, though, what exactly is FreeBSD? And at what times should you choose it over a GNU/Linux installation? Let’s tackle these questions.&lt;/p&gt;

&lt;p&gt;FreeBSD is a free and open source derivative of BSD (Berkeley Software Distribution) with a focus on speed, stability, security, and consistency, among other features. It has been developed and maintained by a large community ever since its initial release many years ago on November 1, 1993.&lt;/p&gt;

&lt;p&gt;BSD is the version of UNIX® that was developed at the University of California in Berkeley. And being a free and open source version, “Free” being a prefix to BSD is a no-brainer.&lt;/p&gt;

&lt;p&gt;What’s FreeBSD Good For?&lt;/p&gt;

&lt;p&gt;FreeBSD offers a plethora of advanced features and even boasts some not available in some commercial Operating Systems. It makes an excellent Internet and Intranet server thanks to its robust network services that allow it to maximize memory and work with heavy loads to deliver and maintain good response times for thousands of simultaneous user processes.&lt;/p&gt;

&lt;p&gt;FreeBSD runs a huge number of applications with ease. At the moment, it has over 32,000 ported applications and libraries with support for desktop, server, and embedded environments. with that being said, let me also add that FreeBSD is excellent for working with advanced embedded platforms. Mail and web appliances, timer servers, routers, MIPS hardware platforms, etc. You name it!&lt;/p&gt;

&lt;p&gt;FreeBSD is available to install in several ways and there are directions to follow for any method you want to use; be it via CD-ROM, over a network using NFS or FTP, or DVD.&lt;/p&gt;

&lt;p&gt;FreeBSD is easy to contribute to and all you have to do is to locate the section of the FreeBSD code base to modify and carefully do a neat job. Potential contributors are also free to improve on its artwork and documentation, among other project aspects.&lt;/p&gt;

&lt;p&gt;FreeBSD is backed by the FreeBSD Foundation, a non-profit organization that you can contribute to financially and all direct contributions are tax deductible.&lt;/p&gt;

&lt;p&gt;FreeBSD’s license allows users to incorporate the use of proprietary software which is ideal for companies interested in generating revenues. Netflix, for example, could cite this as one of the reasons for using FreeBSD servers.&lt;/p&gt;

&lt;p&gt;Why Should You Choose It over Linux?&lt;/p&gt;

&lt;p&gt;From what I’ve gathered about both FreeBSD and Linux, FreeBSD has a better performance on servers than Linux does. Yes, its packaged applications are configured to offer better a performance than Linux and it is usually running fewer services by default, there really isn’t a way to certify which is faster because the answer is dependent on the running hardware and applications and how the system is tuned.&lt;/p&gt;

&lt;p&gt;FreeBSD is reportedly more secure than Linux because of the way the whole project is developed and maintained.&lt;/p&gt;

&lt;p&gt;Unlike with Linux, the FreeBSD project is controlled by a large community of developers around the world who fall into any of these categories; core team, contributors, and committers.&lt;/p&gt;

&lt;p&gt;FreeBSD is much easier to learn and use because there aren’t a thousand and one distros to choose from with different package managers, DEs, etc.&lt;/p&gt;

&lt;p&gt;FreeBSD is more convenient to contribute to because it is the entire OS that is preserved and not just the kernel and a repo as is the case with Linux. You can easily access all of its versions since they are sorted by release numbers.&lt;/p&gt;

&lt;p&gt;Apart from the many documentations and guides that you can find online, FreeBSD has a single official documentation wherein you can find the solution to virtually any issue you will come across. So, you’re sure to find it resourceful.&lt;/p&gt;

&lt;p&gt;FreeBSD has close to no software issues compared to Linux because it has Java, is capable of running Windows programs using Wine, and can run .NET programs using Mono.&lt;/p&gt;

&lt;p&gt;FreeBSD’s ports/packages system allows you to compile software with specific configurations, thereby avoiding conflicting dependency and version issues.&lt;/p&gt;

&lt;p&gt;Both the FreeBSD and GNU/Linux project are always receiving updates. The platform you decide to go with is largely dependent on what you want to use it for, your technical know-how, willingness to learn new stuff, and ultimately your preference.&lt;br&gt;
What is your take on the topic? For what reasons would you choose FreeBSD over Linux if you would? Let us know what you think about both platforms in the comments section below.&lt;/p&gt;

&lt;h3&gt;PS4 5.05 BPF Double Free Kernel Exploit Writeup&lt;/h3&gt;

&lt;p&gt;Introduction&lt;br&gt;
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. The full source of the exploit can be found here.&lt;br&gt;
This bug is no longer accessible however past 5.05 firmware, because the BPF driver has finally been blocked from unprivileged processes - WebKit can no longer open it. Sony also introduced a new security mitigation in 5.0x firmwares to prevent the stack pointer from pointing into user space, however we’ll go more in detail on this a bit further down.&lt;/p&gt;

&lt;p&gt;Assumptions&lt;br&gt;
Some assumptions are made of the reader’s knowledge for the writeup. The avid reader should have a basic understanding of how memory allocators work - more specifically, how malloc() and free() allocate and deallocate memory respectively. They should also be aware that devices can be issued commands concurrently, as in, one command could be received while another one is being processed via threading. An understanding of C, x86, and exploitation basics is also very helpful, though not necessarily required.&lt;/p&gt;

&lt;p&gt;Background&lt;br&gt;
This section contains some helpful information to those newer to exploitation, or are unfamiliar with device drivers, or various exploit techniques such as heap spraying and race conditions. Feel free to skip to the “A Tale of Two Free()'s” section if you’re already familiar with this material.&lt;/p&gt;

&lt;p&gt;What Are Drivers?&lt;br&gt;
There are a few ways that applications can directly communicate with the operating system. One of which is system calls, which there are over 600 of in the PS4 kernel, ~500 of which are FreeBSD - the rest are Sony-implemented. Another method is through something called “Device Drivers”. Drivers are typically used to bridge the gap between software and hardware devices (usb drives, keyboard/mouse, webcams, etc) - though they can also be used just for software purposes.&lt;br&gt;
There are a few operations that a userland application can perform on a driver (if it has sufficient permissions) to interface with it after opening it. In some instances, one can read from it, write to it, or in some cases, issue more complex commands to it via the ioctl() system call. The handlers for these commands are implemented in kernel space - this is important, because any bugs that could be exploited in an ioctl handler can be used as a privilege escalation straight to ring0 - typically the most privileged state.&lt;br&gt;
Drivers are often the more weaker points of an operating system for attackers, because sometimes these drivers are written by developers who don’t understand how the kernel works, or the drivers are older and thus not wise to newer attack methods.&lt;/p&gt;

&lt;p&gt;The BPF Device Driver&lt;br&gt;
If we take a look around inside of WebKit’s sandbox, we’ll find a /dev directory. While this may seem like the root device driver path, it’s a lie. Many of the drivers that the PS4 has are not exposed to this directory, but rather only ones that are needed for WebKit’s operation (for the most part). For some reason though, BPF (aka. the “Berkely Packet Filter”) device is not only exposed to WebKit’s sandbox - it also has the privileges to open the device as R/W. This is very odd, because on most systems this driver is root-only (and for good reason). If you want to read more into this, refer to my previous write-up with 4.55FW.&lt;/p&gt;

&lt;p&gt;What Are Packet Filters?&lt;br&gt;
Below is an excerpt from the 4.55 bpfwrite writeup.&lt;br&gt;
Since the bug is directly in the filter system, it is important to know the basics of what packet filters are. Filters are essentially sets of pseudo-instructions that are parsed by bpf_filter() (which are ran when packets are received). While the pseudo-instruction set is fairly minimal, it allows you to do things like perform basic arithmetic operations and copy values around inside it’s buffer. Breaking down the BPF VM in it’s entirety is far beyond the scope of this write-up, just know that the code produced by it is ran in kernel mode - this is why read/write access to /dev/bpf should be privileged.&lt;/p&gt;

&lt;p&gt;Race Conditions&lt;br&gt;
Race conditions occur when two processes/threads try to access a shared resource at the same time without mutual exclusion. The problem was ultimately solved by introducing concepts such as the “mutex” or “lock”. The idea is when one thread/process tries to access a resource, it will first acquire a lock, access it, then unlock it once it’s finished. If another thread/process tries to access it while the other has the lock, it will wait until the other thread is finished. This works fairly well - when it’s used properly.&lt;br&gt;
Locking is hard to get right, especially when you try to implement fine-grained locking for performance. One single instruction or line of code outside the locking window could introduce a race condition. Not all race conditions are exploitable, but some are (such as this one) - and they can give an attacker very powerful bugs to work with.&lt;/p&gt;

&lt;p&gt;Heap Spraying&lt;br&gt;
The process of heap spraying is fairly simple - allocate a bunch of memory and fill it with controlled data in a loop and pray your allocation doesn’t get stolen from underneath you. It’s a very useful technique when exploiting something such as a use-after-free(), as you can use it to get controlled data into your target object’s backing memory.&lt;br&gt;
By extension, it’s useful to do this for a double free() as well, because once we have a stale reference, we can use a heap spray to control the data. Since the object will be marked “free” - the allocator will eventually provide us with control over this memory, even though something else is still using it. That is, unless, something else has already stolen the pointer from you and corrupts it - then you’ll likely get a system crash, and that’s no fun. This is one factor that adds to the variance of exploits, and typically, the smaller the object, the more likely this is to happen.&lt;/p&gt;

&lt;p&gt;Follow the link to read more of the article&lt;br&gt;
DigitalOcean&lt;br&gt;
&lt;a href="http://do.co/bsdnow" target="_blank" rel="nofollow noopener"&gt;http://do.co/bsdnow&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;OpenBSD gains Wi-Fi “auto-join”&lt;/h3&gt;

&lt;p&gt;In a change which is bound to be welcomed widely, -current has gained “auto-join” for Wi-Fi networks. Peter Hessler (phessler@) has been working on this for quite some time and he wrote about it in his p2k18 hackathon report. He has committed the work from the g2k18 hackathon in Ljubljana:&lt;/p&gt;

&lt;p&gt;CVSROOT:    /cvs&lt;br&gt;
Module name:    src&lt;br&gt;
Changes by: &lt;a href="mailto:phessler@cvs.openbsd.org" target="_blank" rel="nofollow noopener"&gt;phessler@cvs.openbsd.org&lt;/a&gt;    2018/07/11 14:18:09&lt;/p&gt;

&lt;p&gt;Modified files:&lt;br&gt;
    sbin/ifconfig  : ifconfig.8 ifconfig.c &lt;br&gt;
    sys/net80211   : ieee80211_ioctl.c ieee80211_ioctl.h &lt;br&gt;
                     ieee80211_node.c ieee80211_node.h &lt;br&gt;
                     ieee80211_var.h &lt;/p&gt;

&lt;p&gt;Log message:&lt;br&gt;
Introduce 'auto-join' to the wifi 802.11 stack.&lt;/p&gt;

&lt;p&gt;This allows a system to remember which ESSIDs it wants to connect to, any&lt;br&gt;
relevant security configuration, and switch to it when the network we are&lt;br&gt;
currently connected to is no longer available.&lt;br&gt;
Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions.&lt;/p&gt;

&lt;p&gt;example hostname.if:&lt;br&gt;
join home wpakey password&lt;br&gt;
join work wpakey mekmitasdigoat&lt;br&gt;
join open-lounge&lt;br&gt;
join cafe wpakey cafe2018&lt;br&gt;
join "wepnetwork" nwkey "12345"&lt;br&gt;
dhcp&lt;br&gt;
inet6 autoconf&lt;br&gt;
up&lt;/p&gt;

&lt;p&gt;OK stsp@ reyk@&lt;br&gt;
and enthusiasm from every hackroom I've been in for the last 3 years&lt;br&gt;
The usage should be clear from the commit message, but basically you ‘join’ all the networks you want to auto-join as you would previously use ‘nwid’ to connect to one specific network. Then the kernel will join the network that’s actually in range and do the rest automagically for you. When you move out of range of that network you lose connectivity until you come in range of the original (where things will continue to work as you’ve been used to) or one of the other networks (where you will associate and then get a new lease).&lt;/p&gt;

&lt;p&gt;Thanks to Peter for working on this feature - something many a Wi-Fi using OpenBSD user will be able to benefit from.&lt;/p&gt;

&lt;h3&gt;FreeBSD Jails the hard way&lt;/h3&gt;

&lt;p&gt;There are many great options for managing FreeBSD Jails. iocage, warden and ez-jail aim to streamline the process and make it quick an easy to get going. But sometimes the tools built right into the OS are overlooked.&lt;/p&gt;

&lt;p&gt;This post goes over what is involved in creating and managing jails using only the tools built into FreeBSD.&lt;/p&gt;

&lt;p&gt;For this guide, I’m going to be putting my jails in /usr/local/jails.&lt;/p&gt;

&lt;p&gt;I’ll start with a very simple, isolated jail. Then I’ll go over how to use ZFS snapshots, and lastly nullfs mounts to share the FreeBSD base files with multiple jails.&lt;/p&gt;

&lt;p&gt;I’ll also show some examples of how to use the templating power of jail.conf to apply similar settings to all your jails.&lt;/p&gt;

&lt;p&gt;Full Jail&lt;br&gt;
Make a directory for the jail, or a zfs dataset if you prefer.&lt;br&gt;
Download the FreeBSD base files, and any other parts of FreeBSD you want. In this example I’ll include the 32 bit libraries as well.&lt;br&gt;
Update your FreeBSD base install.&lt;br&gt;
Verify your download. We’re downloading these archives over FTP after all, we should confirm that this download is valid and not tampered with. The freebsd-update IDS command verifies the installation using a PGP key which is in your base system, which was presumably installed with an ISO that you verified using the FreeBSD signed checksums. Admittedly this step is a bit of paranoia, but I think it’s prudent.&lt;br&gt;
Make sure you jail has the right timezone and dns servers and a hostname in rc.conf.&lt;br&gt;
Edit jail.conf with the details about your jail.&lt;br&gt;
Start and login to your jail.&lt;br&gt;
11 commands and a config file, but this is the most tedious way to make a jail. With a little bit of templating it can be even easier. So I’ll start by making a template. Making a template is basically the same as steps 1, 2 and 3 above, but with a different destination folder, I’ll condense them here.&lt;/p&gt;

&lt;p&gt;Creating a template&lt;br&gt;
Create a template or a ZFS dataset. If you’d like to use the zfs clone method of deploying templates, you’ll need to create a zfs dataset instead of a folder.&lt;br&gt;
Update your template with freebsd-update.&lt;br&gt;
Verify your install&lt;br&gt;
And that’s it, now you have a fully up to date jail template. If you’ve made this template with zfs, you can easily deploy it using zfs snapshots.&lt;/p&gt;

&lt;p&gt;Deploying a template with ZFS snapshots&lt;br&gt;
Create a snapshot. My last freebsd-update to my template brought it to patch level 17, so I’ll call my snapshot p10.&lt;br&gt;
Clone the snapshot to a new jail.&lt;br&gt;
Configure the jail hostname.&lt;br&gt;
Add the jail definition to jail.conf, make sure you have the global jail settings from jail.conf listed in the fulljail example.&lt;br&gt;
Start the jail.&lt;br&gt;
The downside with the zfs approach is that each jail is now a fully independent, and if you need to update your jails, you have to update them all individually. By sharing a template using nullfs mounts you can have only one copy of the base system that only needs to be updated once.&lt;/p&gt;

&lt;p&gt;Follow the link to see the rest of the article about&lt;br&gt;
Thin jails using NullFS mounts&lt;br&gt;
Simplifying jail.conf&lt;br&gt;
Hopefully this has helped you understand the process of how to create and manage FreeBSD jails without tools that abstract away all the details. Those tools are often quite useful, but there is always benefit in learning to do things the hard way. And in this case, the hard way doesn’t seem to be that hard after all.&lt;/p&gt;

&lt;h2&gt;Beastie Bits&lt;/h2&gt;

&lt;p&gt;Meetup in Zurich #4, July edition (July 19) – Which you likely missed, but now you know to look for the August edition!&lt;br&gt;
The next two BSD-PL User group meetings in Warsaw have been scheduled for July 30th and Aug 9th @ 1830 CEST – Submit your topic proposals now&lt;br&gt;
Linux Geek Books - Humble Bundle&lt;br&gt;
Extend loader(8) geli support to all architectures and all disk-like devices&lt;br&gt;
Upgrading from a bootpool to a single encrypted pool – skip the gptzfsboot part, and manually update your EFI partition with loader.efi&lt;br&gt;
The pkgsrc 2018Q2 for Illumos is available with 18500+ binary packages&lt;br&gt;
NetBSD ARM64 Images Available with SMP for RPi3 / NanoPi / Pine64 Boards&lt;br&gt;
Recently released CDE 2.3.0 running on Tribblix (Illumos)&lt;br&gt;
An Interview With Tech &amp;amp; Science Fiction Author Michael W Lucas&lt;br&gt;
A reminder : MeetBSD CFP&lt;br&gt;
EuroBSDCon talk acceptances have gone out, and once the tutorials are confirmed, registration will open. That will likely have happened by time you see this episode, so go register! See you in Romania&lt;br&gt;
Tarsnap&lt;/p&gt;

&lt;h2&gt;Feedback/Questions&lt;/h2&gt;

&lt;p&gt;Wilyarti - Adblocked on FreeBSD Continued…&lt;br&gt;
Andrew - A Question and a Story&lt;br&gt;
Matthew - Thanks&lt;br&gt;
Brian - PCI-E Controller&lt;br&gt;
Send questions, comments, show ideas/topics, or stories you want mentioned on the show to &lt;a href="mailto:feedback@bsdnow.tv" target="_blank" rel="nofollow noopener"&gt;feedback@bsdnow.tv&lt;/a&gt; &lt;/p&gt;
</description>
  <itunes:keywords>freebsd, openbsd, netbsd, dragonflybsd, trueos, trident, hardenedbsd, tutorial, howto, guide, bsd, interview, ule, cfs, tuxedo, infinitybook, ps4, jails</itunes:keywords>
  <content:encoded>
    <![CDATA[<p>FreeBSD ULE vs. Linux CFS, OpenBSD on Tuxedo InfinityBook, how zfs diff reports filenames efficiently, why choose FreeBSD over Linux, PS4 double free exploit, OpenBSD’s wifi autojoin, and FreeBSD jails the hard way.</p>

<h2>Win</h2>

<p>Celebrate our 256th episode with us. You can win a Mogics Power Bagel (not sponsored).</p>

<p>To enter, go find the 4 episodes we did in December of 2017. In the opening, find the 4 letters in the bookshelf behind me. They spell different words in each of the 4 episodes. Send us these words in order to <a href="mailto:feedback@bsdnow.tv" rel="nofollow">feedback@bsdnow.tv</a> with the subject “bsdnow256” until August 8th, 2018 18:00 UTC and we’ll randomly draw the winner on the live show. We’ll then contact you to ship the item.<br>
Only one item to win. All decisions are final. Better luck next time.</p>

<h2>Headlines</h2>

<h3>Battle of the Schedulers: FreeBSD ULE vs. Linux CFS</h3>

<p>Introduction<br>
This paper analyzes the impact on application performance of the design and implementation choices made in two widely used open-source schedulers: ULE, the default FreeBSD scheduler, and CFS, the default Linux scheduler. We compare ULE and CFS in otherwise identical circumstances. We have ported ULE to Linux, and use it to schedule all threads that are normally scheduled by CFS. We compare the performance of a large suite of applications on the modified kernel running ULE and on the standard Linux kernel running CFS. The observed performance differences are solely the result of scheduling decisions, and do not reflect differences in other subsystems between FreeBSD and Linux. There is no overall winner. On many workloads the two schedulers perform similarly, but for some workloads there are significant and even surprising differences. ULE may cause starvation, even when executing a single application with identical threads, but this starvation may actually lead to better application performance for some workloads. The more complex load balancing mechanism of CFS reacts more quickly to workload changes, but ULE achieves better load balance in the long run.<br>
Operating system kernel schedulers are responsible for maintaining high utilization of hardware resources (CPU cores, memory, I/O devices) while providing fast response time to latency-sensitive applications. They have to react to workload changes, and handle large numbers of cores and threads with minimal overhead [12]. This paper provides a comparison between the default schedulers of two of the most widely deployed open-source operating systems: the Completely Fair Scheduler (CFS) used in Linux, and the ULE scheduler used in FreeBSD. Our goal is not to declare an overall winner.<br>
In fact, we find that for some workloads ULE is better and for others CFS is better. Instead, our goal is to illustrate how differences in the design and the implementation of the two schedulers are reflected in application performance under different workloads. ULE and CFS are both designed to schedule large numbers of threads on large multicore machines. Scalability considerations have led both schedulers to adopt per-core run-queues. On a context switch, a core accesses only its local run-queue to find the next thread to run. Periodically and at select times, e.g., when a thread wakes up, both ULE and CFS perform load balancing, i.e., they try to balance the amount of work waiting in the run-queues of different cores.<br>
ULE and CFS, however, differ greatly in their design and implementation choices. FreeBSD ULE is a simple scheduler (2,950 lines of code in FreeBSD 11.1), while Linux CFS is much more complex (17,900 lines of code in the latest LTS Linux kernel, Linux 4.9). FreeBSD run-queues are FIFO. For load balancing, FreeBSD strives to even out the number of threads per core. In Linux, a core decides which thread to run next based on prior execution time, priority, and perceived cache behavior of the threads in its runqueue. Instead of evening out the number of threads between cores, Linux strives to even out the average amount of pending work.</p>

<p>Performance analysis<br>
We now analyze the impact of the per-core scheduling on the performance of 37 applications. We define “performance” as follows: for database workloads and NAS applications, we compare the number of operations per second, and for the other applications we compare “execution time”. The higher the “performance”, the better a scheduler performs. Figure 5 presents the performance difference between CFS and ULE on a single core, with percentages above 0 meaning that the application executes faster with ULE than CFS.<br>
Overall, the scheduler has little influence on most workloads. Indeed, most applications use threads that all perform the same work, thus both CFS and ULE endup scheduling all of the threads in a round-robin fashion. The average performance difference is 1.5%, in favor of ULE. Still, scimark is 36% slower on ULE than CFS, and apache is 40% faster on ULE than CFS. Scimark is a single-threaded Java application. It launches one compute thread, and the Java runtime executes other Java system threads in the background (for the garbage collector, I/O, etc.).<br>
When the application is executed with ULE, the compute thread can be delayed, because Java system threads are considered interactive and get priority over the computation thread. The apache workload consists of two applications: the main server (httpd) running 100 threads, and ab, a single-threaded load injector.<br>
The performance difference between ULE and CFS is explained by different choices regarding thread preemption. In ULE, full preemption is disabled, while CFS preempts the running thread when the thread that has just been woken up has a vruntime that is much smaller than the vruntime of the currently executing thread (1ms difference in practice). In CFS, ab is preempted 2 million times during the benchmark, while it never preempted with ULE.<br>
This behavior is explained as follows: ab starts by sending 100 requests to the httpd server, and then waits for the server to answer. When ab is woken up, it checks which requests have been processed and sends new requests to the server. Since ab is single-threaded, all requests sent to the server are sent sequentially. In ULE, ab is able to send as many new requests as it has received responses. In CFS, every request sent by ab wakes up a httpd thread, which preempts ab.</p>

<p>Conclusion<br>
Scheduling threads on a multicore machine is hard. In this paper, we perform a fair comparison of the design choices of two widely used schedulers: the ULE scheduler from FreeBSD and CFS from Linux. We show that they behave differently even on simple workloads, and that no scheduler performs better than the other on all workloads.</p>

<h3>OpenBSD 6.3 on Tuxedo InfinityBook</h3>

<p>Disclaimer:<br>
I came across the Tuxedo Computers InfinityBook last year at the Open! Conference where Tuxedo had a small booth. Previously they came to my attention since they’re a member of the OSB Alliance on whose board I’m a member. Furthermore Tuxedo Computers are a sponsor of the OSBAR which I’m part of the organizational team.</p>

<p>OpenBSD on the Tuxedo InfinityBook<br>
I’ve asked the guys over at Tuxedo Computers whether they would be interested to have some tests with *BSD done and that I could test drive one of their machines and give feedback on what works and what does not - and possibly look into it.+</p>

<p>Within a few weeks they shipped me a machine and last week the InfinityBook Pro 14” arrived. Awesome. Thanks already to the folks at Tuxedo Computers. The machine arrived accompanied by lot’s of swag :)</p>

<p>The InfinityBook is a very nice machine and allows a wide range of configuration. The configuration that was shipped to me:</p>

<p>Intel Core i7-8550U<br>
1x 16GB RAM 2400Mhz Crucial Ballistix Sport LT<br>
250 GB Samsung 860 EVO (M.2 SATAIII)</p>

<p>I used a USB-stick to boot install63.fs and re-installed the machine with OpenBSD. Full dmesg.</p>

<p>The installation went flawlessly, the needed intel firmware is being installed after installation automatically via fw_update(1).</p>

<p>Out of the box the graphics works and once installed the machine presents the login.</p>

<p>Video<br>
When X starts the display is turned off for some reason. You will need to hit fn+f12 (the key with the moon on it) then the display will go on. Aside from that little nit, X works just fine and presents one the expected resolution.</p>

<p>External video is working just fine as well. Either via hdmi output or via the mini displayport connector.</p>

<p>The buttons for adjusting brightness (fn+f8 and fn+f9) are not working. Instead one has to use wsconsctl(8) to adjust the brightness.</p>

<p>Networking<br>
The infinityBook has built-in ethernet, driven by re(4) And for the wireless interface the iwm(4) driver is being used. Both work as expected.</p>

<p>ACPI<br>
Neither suspend nor hibernate work. Reporting of battery status is bogus as well. Some of the keyboard function keys work:</p>

<p>LCD on/off works (fn+f2)<br>
Keyboard backlight dimming works (fn+f4)<br>
Volume (fn+f5 / fn+f6) works</p>

<p>Sound<br>
The azalia chipset is being used for audio processing. Works as expected, volume can be controlled via buttons (fn+f5, fn+f6) or via mixerctl.</p>

<p>Touchpad<br>
Can be controlled via wsconsctl(8).<br>
So far I must say, that the InfinityBook makes a nice machine - and I’m enjoying working with it.</p>

<p>iXsystems<br>
iXsystems - Its all NAS</p>

<h3>How ZFS makes things like ‘zfs diff’ report filenames efficiently</h3>

<p>As a copy on write (file)system, ZFS can use the transaction group (txg) numbers that are embedded in ZFS block pointers to efficiently find the differences between two txgs; this is used in, for example, ZFS bookmarks. However, as I noted at the end of my entry on block pointers, this doesn’t give us a filesystem level difference; instead, it essentially gives us a list of inodes (okay, dnodes) that changed.<br>
In theory, turning an inode or dnode number into the path to a file is an expensive operation; you basically have to search the entire filesystem until you find it. In practice, if you’ve ever run ‘zfs diff’, you’ve likely noticed that it runs pretty fast. Nor is this the only place that ZFS quickly turns dnode numbers into full paths, as it comes up in ‘zpool status’ reports about permanent errors. At one level, zfs diff and zpool status do this so rapidly because they ask the ZFS code in the kernel to do it for them. At another level, the question is how the kernel’s ZFS code can be so fast.<br>
The interesting and surprising answer is that ZFS cheats, in a way that makes things very fast when it works and almost always works in normal filesystems and with normal usage patterns. The cheat is that ZFS dnodes record their parent’s object number.<br>
If you’re familiar with the twists and turns of Unix filesystems, you’re now wondering how ZFS deals with hardlinks, which can cause a file to be in several directories at once and so have several parents (and then it can be removed from some of the directories). The answer is that ZFS doesn’t; a dnode only ever tracks a single parent, and ZFS accepts that this parent information can be inaccurate. I’ll quote the comment in zfs_obj_to_pobj:<br>
When a link is removed [the file’s] parent pointer is not changed and will be invalid. There are two cases where a link is removed but the file stays around, when it goes to the delete queue and when there are additional links.<br>
Before I get into the details, I want to say that I appreciate the brute force elegance of this cheat. The practical reality is that most Unix files today don’t have extra hardlinks, and when they do most hardlinks are done in ways that won’t break ZFS’s parent stuff. The result is that ZFS has picked an efficient implementation that works almost all of the time; in my opinion, the great benefit we get from having it around are more than worth the infrequent cases where it fails or malfunctions. Both zfs diff and having filenames show up in zpool status permanent error reports are very useful (and there may be other cases where this gets used).<br>
The current details are that any time you hardlink a file to somewhere or rename it, ZFS updates the file’s parent to point to the new directory. Often this will wind up with a correct parent even after all of the dust settles; for example, a common pattern is to write a file to an initial location, hardlink it to its final destination, and then remove the initial location version. In this case, the parent will be correct and you’ll get the right name.</p>

<h2>News Roundup</h2>

<h3>What is FreeBSD? Why Should You Choose It Over Linux?</h3>

<p>Not too long ago I wondered if and in what situations FreeBSD could be faster than Linux and we received a good amount of informative feedback. So far, Linux rules the desktop space and FreeBSD rules the server space.</p>

<p>In the meantime, though, what exactly is FreeBSD? And at what times should you choose it over a GNU/Linux installation? Let’s tackle these questions.</p>

<p>FreeBSD is a free and open source derivative of BSD (Berkeley Software Distribution) with a focus on speed, stability, security, and consistency, among other features. It has been developed and maintained by a large community ever since its initial release many years ago on November 1, 1993.</p>

<p>BSD is the version of UNIX® that was developed at the University of California in Berkeley. And being a free and open source version, “Free” being a prefix to BSD is a no-brainer.</p>

<p>What’s FreeBSD Good For?</p>

<p>FreeBSD offers a plethora of advanced features and even boasts some not available in some commercial Operating Systems. It makes an excellent Internet and Intranet server thanks to its robust network services that allow it to maximize memory and work with heavy loads to deliver and maintain good response times for thousands of simultaneous user processes.</p>

<p>FreeBSD runs a huge number of applications with ease. At the moment, it has over 32,000 ported applications and libraries with support for desktop, server, and embedded environments. with that being said, let me also add that FreeBSD is excellent for working with advanced embedded platforms. Mail and web appliances, timer servers, routers, MIPS hardware platforms, etc. You name it!</p>

<p>FreeBSD is available to install in several ways and there are directions to follow for any method you want to use; be it via CD-ROM, over a network using NFS or FTP, or DVD.</p>

<p>FreeBSD is easy to contribute to and all you have to do is to locate the section of the FreeBSD code base to modify and carefully do a neat job. Potential contributors are also free to improve on its artwork and documentation, among other project aspects.</p>

<p>FreeBSD is backed by the FreeBSD Foundation, a non-profit organization that you can contribute to financially and all direct contributions are tax deductible.</p>

<p>FreeBSD’s license allows users to incorporate the use of proprietary software which is ideal for companies interested in generating revenues. Netflix, for example, could cite this as one of the reasons for using FreeBSD servers.</p>

<p>Why Should You Choose It over Linux?</p>

<p>From what I’ve gathered about both FreeBSD and Linux, FreeBSD has a better performance on servers than Linux does. Yes, its packaged applications are configured to offer better a performance than Linux and it is usually running fewer services by default, there really isn’t a way to certify which is faster because the answer is dependent on the running hardware and applications and how the system is tuned.</p>

<p>FreeBSD is reportedly more secure than Linux because of the way the whole project is developed and maintained.</p>

<p>Unlike with Linux, the FreeBSD project is controlled by a large community of developers around the world who fall into any of these categories; core team, contributors, and committers.</p>

<p>FreeBSD is much easier to learn and use because there aren’t a thousand and one distros to choose from with different package managers, DEs, etc.</p>

<p>FreeBSD is more convenient to contribute to because it is the entire OS that is preserved and not just the kernel and a repo as is the case with Linux. You can easily access all of its versions since they are sorted by release numbers.</p>

<p>Apart from the many documentations and guides that you can find online, FreeBSD has a single official documentation wherein you can find the solution to virtually any issue you will come across. So, you’re sure to find it resourceful.</p>

<p>FreeBSD has close to no software issues compared to Linux because it has Java, is capable of running Windows programs using Wine, and can run .NET programs using Mono.</p>

<p>FreeBSD’s ports/packages system allows you to compile software with specific configurations, thereby avoiding conflicting dependency and version issues.</p>

<p>Both the FreeBSD and GNU/Linux project are always receiving updates. The platform you decide to go with is largely dependent on what you want to use it for, your technical know-how, willingness to learn new stuff, and ultimately your preference.<br>
What is your take on the topic? For what reasons would you choose FreeBSD over Linux if you would? Let us know what you think about both platforms in the comments section below.</p>

<h3>PS4 5.05 BPF Double Free Kernel Exploit Writeup</h3>

<p>Introduction<br>
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. The full source of the exploit can be found here.<br>
This bug is no longer accessible however past 5.05 firmware, because the BPF driver has finally been blocked from unprivileged processes - WebKit can no longer open it. Sony also introduced a new security mitigation in 5.0x firmwares to prevent the stack pointer from pointing into user space, however we’ll go more in detail on this a bit further down.</p>

<p>Assumptions<br>
Some assumptions are made of the reader’s knowledge for the writeup. The avid reader should have a basic understanding of how memory allocators work - more specifically, how malloc() and free() allocate and deallocate memory respectively. They should also be aware that devices can be issued commands concurrently, as in, one command could be received while another one is being processed via threading. An understanding of C, x86, and exploitation basics is also very helpful, though not necessarily required.</p>

<p>Background<br>
This section contains some helpful information to those newer to exploitation, or are unfamiliar with device drivers, or various exploit techniques such as heap spraying and race conditions. Feel free to skip to the “A Tale of Two Free()&#39;s” section if you’re already familiar with this material.</p>

<p>What Are Drivers?<br>
There are a few ways that applications can directly communicate with the operating system. One of which is system calls, which there are over 600 of in the PS4 kernel, ~500 of which are FreeBSD - the rest are Sony-implemented. Another method is through something called “Device Drivers”. Drivers are typically used to bridge the gap between software and hardware devices (usb drives, keyboard/mouse, webcams, etc) - though they can also be used just for software purposes.<br>
There are a few operations that a userland application can perform on a driver (if it has sufficient permissions) to interface with it after opening it. In some instances, one can read from it, write to it, or in some cases, issue more complex commands to it via the ioctl() system call. The handlers for these commands are implemented in kernel space - this is important, because any bugs that could be exploited in an ioctl handler can be used as a privilege escalation straight to ring0 - typically the most privileged state.<br>
Drivers are often the more weaker points of an operating system for attackers, because sometimes these drivers are written by developers who don’t understand how the kernel works, or the drivers are older and thus not wise to newer attack methods.</p>

<p>The BPF Device Driver<br>
If we take a look around inside of WebKit’s sandbox, we’ll find a /dev directory. While this may seem like the root device driver path, it’s a lie. Many of the drivers that the PS4 has are not exposed to this directory, but rather only ones that are needed for WebKit’s operation (for the most part). For some reason though, BPF (aka. the “Berkely Packet Filter”) device is not only exposed to WebKit’s sandbox - it also has the privileges to open the device as R/W. This is very odd, because on most systems this driver is root-only (and for good reason). If you want to read more into this, refer to my previous write-up with 4.55FW.</p>

<p>What Are Packet Filters?<br>
Below is an excerpt from the 4.55 bpfwrite writeup.<br>
Since the bug is directly in the filter system, it is important to know the basics of what packet filters are. Filters are essentially sets of pseudo-instructions that are parsed by bpf_filter() (which are ran when packets are received). While the pseudo-instruction set is fairly minimal, it allows you to do things like perform basic arithmetic operations and copy values around inside it’s buffer. Breaking down the BPF VM in it’s entirety is far beyond the scope of this write-up, just know that the code produced by it is ran in kernel mode - this is why read/write access to /dev/bpf should be privileged.</p>

<p>Race Conditions<br>
Race conditions occur when two processes/threads try to access a shared resource at the same time without mutual exclusion. The problem was ultimately solved by introducing concepts such as the “mutex” or “lock”. The idea is when one thread/process tries to access a resource, it will first acquire a lock, access it, then unlock it once it’s finished. If another thread/process tries to access it while the other has the lock, it will wait until the other thread is finished. This works fairly well - when it’s used properly.<br>
Locking is hard to get right, especially when you try to implement fine-grained locking for performance. One single instruction or line of code outside the locking window could introduce a race condition. Not all race conditions are exploitable, but some are (such as this one) - and they can give an attacker very powerful bugs to work with.</p>

<p>Heap Spraying<br>
The process of heap spraying is fairly simple - allocate a bunch of memory and fill it with controlled data in a loop and pray your allocation doesn’t get stolen from underneath you. It’s a very useful technique when exploiting something such as a use-after-free(), as you can use it to get controlled data into your target object’s backing memory.<br>
By extension, it’s useful to do this for a double free() as well, because once we have a stale reference, we can use a heap spray to control the data. Since the object will be marked “free” - the allocator will eventually provide us with control over this memory, even though something else is still using it. That is, unless, something else has already stolen the pointer from you and corrupts it - then you’ll likely get a system crash, and that’s no fun. This is one factor that adds to the variance of exploits, and typically, the smaller the object, the more likely this is to happen.</p>

<p>Follow the link to read more of the article<br>
DigitalOcean<br>
<a href="http://do.co/bsdnow" rel="nofollow">http://do.co/bsdnow</a></p>

<h3>OpenBSD gains Wi-Fi “auto-join”</h3>

<p>In a change which is bound to be welcomed widely, -current has gained “auto-join” for Wi-Fi networks. Peter Hessler (phessler@) has been working on this for quite some time and he wrote about it in his p2k18 hackathon report. He has committed the work from the g2k18 hackathon in Ljubljana:</p>

<p>CVSROOT:    /cvs<br>
Module name:    src<br>
Changes by: <a href="mailto:phessler@cvs.openbsd.org" rel="nofollow">phessler@cvs.openbsd.org</a>    2018/07/11 14:18:09</p>

<p>Modified files:<br>
    sbin/ifconfig  : ifconfig.8 ifconfig.c <br>
    sys/net80211   : ieee80211_ioctl.c ieee80211_ioctl.h <br>
                     ieee80211_node.c ieee80211_node.h <br>
                     ieee80211_var.h </p>

<p>Log message:<br>
Introduce &#39;auto-join&#39; to the wifi 802.11 stack.</p>

<p>This allows a system to remember which ESSIDs it wants to connect to, any<br>
relevant security configuration, and switch to it when the network we are<br>
currently connected to is no longer available.<br>
Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions.</p>

<p>example hostname.if:<br>
join home wpakey password<br>
join work wpakey mekmitasdigoat<br>
join open-lounge<br>
join cafe wpakey cafe2018<br>
join &quot;wepnetwork&quot; nwkey &quot;12345&quot;<br>
dhcp<br>
inet6 autoconf<br>
up</p>

<p>OK stsp@ reyk@<br>
and enthusiasm from every hackroom I&#39;ve been in for the last 3 years<br>
The usage should be clear from the commit message, but basically you ‘join’ all the networks you want to auto-join as you would previously use ‘nwid’ to connect to one specific network. Then the kernel will join the network that’s actually in range and do the rest automagically for you. When you move out of range of that network you lose connectivity until you come in range of the original (where things will continue to work as you’ve been used to) or one of the other networks (where you will associate and then get a new lease).</p>

<p>Thanks to Peter for working on this feature - something many a Wi-Fi using OpenBSD user will be able to benefit from.</p>

<h3>FreeBSD Jails the hard way</h3>

<p>There are many great options for managing FreeBSD Jails. iocage, warden and ez-jail aim to streamline the process and make it quick an easy to get going. But sometimes the tools built right into the OS are overlooked.</p>

<p>This post goes over what is involved in creating and managing jails using only the tools built into FreeBSD.</p>

<p>For this guide, I’m going to be putting my jails in /usr/local/jails.</p>

<p>I’ll start with a very simple, isolated jail. Then I’ll go over how to use ZFS snapshots, and lastly nullfs mounts to share the FreeBSD base files with multiple jails.</p>

<p>I’ll also show some examples of how to use the templating power of jail.conf to apply similar settings to all your jails.</p>

<p>Full Jail<br>
Make a directory for the jail, or a zfs dataset if you prefer.<br>
Download the FreeBSD base files, and any other parts of FreeBSD you want. In this example I’ll include the 32 bit libraries as well.<br>
Update your FreeBSD base install.<br>
Verify your download. We’re downloading these archives over FTP after all, we should confirm that this download is valid and not tampered with. The freebsd-update IDS command verifies the installation using a PGP key which is in your base system, which was presumably installed with an ISO that you verified using the FreeBSD signed checksums. Admittedly this step is a bit of paranoia, but I think it’s prudent.<br>
Make sure you jail has the right timezone and dns servers and a hostname in rc.conf.<br>
Edit jail.conf with the details about your jail.<br>
Start and login to your jail.<br>
11 commands and a config file, but this is the most tedious way to make a jail. With a little bit of templating it can be even easier. So I’ll start by making a template. Making a template is basically the same as steps 1, 2 and 3 above, but with a different destination folder, I’ll condense them here.</p>

<p>Creating a template<br>
Create a template or a ZFS dataset. If you’d like to use the zfs clone method of deploying templates, you’ll need to create a zfs dataset instead of a folder.<br>
Update your template with freebsd-update.<br>
Verify your install<br>
And that’s it, now you have a fully up to date jail template. If you’ve made this template with zfs, you can easily deploy it using zfs snapshots.</p>

<p>Deploying a template with ZFS snapshots<br>
Create a snapshot. My last freebsd-update to my template brought it to patch level 17, so I’ll call my snapshot p10.<br>
Clone the snapshot to a new jail.<br>
Configure the jail hostname.<br>
Add the jail definition to jail.conf, make sure you have the global jail settings from jail.conf listed in the fulljail example.<br>
Start the jail.<br>
The downside with the zfs approach is that each jail is now a fully independent, and if you need to update your jails, you have to update them all individually. By sharing a template using nullfs mounts you can have only one copy of the base system that only needs to be updated once.</p>

<p>Follow the link to see the rest of the article about<br>
Thin jails using NullFS mounts<br>
Simplifying jail.conf<br>
Hopefully this has helped you understand the process of how to create and manage FreeBSD jails without tools that abstract away all the details. Those tools are often quite useful, but there is always benefit in learning to do things the hard way. And in this case, the hard way doesn’t seem to be that hard after all.</p>

<h2>Beastie Bits</h2>

<p>Meetup in Zurich #4, July edition (July 19) – Which you likely missed, but now you know to look for the August edition!<br>
The next two BSD-PL User group meetings in Warsaw have been scheduled for July 30th and Aug 9th @ 1830 CEST – Submit your topic proposals now<br>
Linux Geek Books - Humble Bundle<br>
Extend loader(8) geli support to all architectures and all disk-like devices<br>
Upgrading from a bootpool to a single encrypted pool – skip the gptzfsboot part, and manually update your EFI partition with loader.efi<br>
The pkgsrc 2018Q2 for Illumos is available with 18500+ binary packages<br>
NetBSD ARM64 Images Available with SMP for RPi3 / NanoPi / Pine64 Boards<br>
Recently released CDE 2.3.0 running on Tribblix (Illumos)<br>
An Interview With Tech &amp; Science Fiction Author Michael W Lucas<br>
A reminder : MeetBSD CFP<br>
EuroBSDCon talk acceptances have gone out, and once the tutorials are confirmed, registration will open. That will likely have happened by time you see this episode, so go register! See you in Romania<br>
Tarsnap</p>

<h2>Feedback/Questions</h2>

<p>Wilyarti - Adblocked on FreeBSD Continued…<br>
Andrew - A Question and a Story<br>
Matthew - Thanks<br>
Brian - PCI-E Controller<br>
Send questions, comments, show ideas/topics, or stories you want mentioned on the show to <a href="mailto:feedback@bsdnow.tv" rel="nofollow">feedback@bsdnow.tv</a></p>]]>
  </content:encoded>
  <itunes:summary>
    <![CDATA[<p>FreeBSD ULE vs. Linux CFS, OpenBSD on Tuxedo InfinityBook, how zfs diff reports filenames efficiently, why choose FreeBSD over Linux, PS4 double free exploit, OpenBSD’s wifi autojoin, and FreeBSD jails the hard way.</p>

<h2>Win</h2>

<p>Celebrate our 256th episode with us. You can win a Mogics Power Bagel (not sponsored).</p>

<p>To enter, go find the 4 episodes we did in December of 2017. In the opening, find the 4 letters in the bookshelf behind me. They spell different words in each of the 4 episodes. Send us these words in order to <a href="mailto:feedback@bsdnow.tv" rel="nofollow">feedback@bsdnow.tv</a> with the subject “bsdnow256” until August 8th, 2018 18:00 UTC and we’ll randomly draw the winner on the live show. We’ll then contact you to ship the item.<br>
Only one item to win. All decisions are final. Better luck next time.</p>

<h2>Headlines</h2>

<h3>Battle of the Schedulers: FreeBSD ULE vs. Linux CFS</h3>

<p>Introduction<br>
This paper analyzes the impact on application performance of the design and implementation choices made in two widely used open-source schedulers: ULE, the default FreeBSD scheduler, and CFS, the default Linux scheduler. We compare ULE and CFS in otherwise identical circumstances. We have ported ULE to Linux, and use it to schedule all threads that are normally scheduled by CFS. We compare the performance of a large suite of applications on the modified kernel running ULE and on the standard Linux kernel running CFS. The observed performance differences are solely the result of scheduling decisions, and do not reflect differences in other subsystems between FreeBSD and Linux. There is no overall winner. On many workloads the two schedulers perform similarly, but for some workloads there are significant and even surprising differences. ULE may cause starvation, even when executing a single application with identical threads, but this starvation may actually lead to better application performance for some workloads. The more complex load balancing mechanism of CFS reacts more quickly to workload changes, but ULE achieves better load balance in the long run.<br>
Operating system kernel schedulers are responsible for maintaining high utilization of hardware resources (CPU cores, memory, I/O devices) while providing fast response time to latency-sensitive applications. They have to react to workload changes, and handle large numbers of cores and threads with minimal overhead [12]. This paper provides a comparison between the default schedulers of two of the most widely deployed open-source operating systems: the Completely Fair Scheduler (CFS) used in Linux, and the ULE scheduler used in FreeBSD. Our goal is not to declare an overall winner.<br>
In fact, we find that for some workloads ULE is better and for others CFS is better. Instead, our goal is to illustrate how differences in the design and the implementation of the two schedulers are reflected in application performance under different workloads. ULE and CFS are both designed to schedule large numbers of threads on large multicore machines. Scalability considerations have led both schedulers to adopt per-core run-queues. On a context switch, a core accesses only its local run-queue to find the next thread to run. Periodically and at select times, e.g., when a thread wakes up, both ULE and CFS perform load balancing, i.e., they try to balance the amount of work waiting in the run-queues of different cores.<br>
ULE and CFS, however, differ greatly in their design and implementation choices. FreeBSD ULE is a simple scheduler (2,950 lines of code in FreeBSD 11.1), while Linux CFS is much more complex (17,900 lines of code in the latest LTS Linux kernel, Linux 4.9). FreeBSD run-queues are FIFO. For load balancing, FreeBSD strives to even out the number of threads per core. In Linux, a core decides which thread to run next based on prior execution time, priority, and perceived cache behavior of the threads in its runqueue. Instead of evening out the number of threads between cores, Linux strives to even out the average amount of pending work.</p>

<p>Performance analysis<br>
We now analyze the impact of the per-core scheduling on the performance of 37 applications. We define “performance” as follows: for database workloads and NAS applications, we compare the number of operations per second, and for the other applications we compare “execution time”. The higher the “performance”, the better a scheduler performs. Figure 5 presents the performance difference between CFS and ULE on a single core, with percentages above 0 meaning that the application executes faster with ULE than CFS.<br>
Overall, the scheduler has little influence on most workloads. Indeed, most applications use threads that all perform the same work, thus both CFS and ULE endup scheduling all of the threads in a round-robin fashion. The average performance difference is 1.5%, in favor of ULE. Still, scimark is 36% slower on ULE than CFS, and apache is 40% faster on ULE than CFS. Scimark is a single-threaded Java application. It launches one compute thread, and the Java runtime executes other Java system threads in the background (for the garbage collector, I/O, etc.).<br>
When the application is executed with ULE, the compute thread can be delayed, because Java system threads are considered interactive and get priority over the computation thread. The apache workload consists of two applications: the main server (httpd) running 100 threads, and ab, a single-threaded load injector.<br>
The performance difference between ULE and CFS is explained by different choices regarding thread preemption. In ULE, full preemption is disabled, while CFS preempts the running thread when the thread that has just been woken up has a vruntime that is much smaller than the vruntime of the currently executing thread (1ms difference in practice). In CFS, ab is preempted 2 million times during the benchmark, while it never preempted with ULE.<br>
This behavior is explained as follows: ab starts by sending 100 requests to the httpd server, and then waits for the server to answer. When ab is woken up, it checks which requests have been processed and sends new requests to the server. Since ab is single-threaded, all requests sent to the server are sent sequentially. In ULE, ab is able to send as many new requests as it has received responses. In CFS, every request sent by ab wakes up a httpd thread, which preempts ab.</p>

<p>Conclusion<br>
Scheduling threads on a multicore machine is hard. In this paper, we perform a fair comparison of the design choices of two widely used schedulers: the ULE scheduler from FreeBSD and CFS from Linux. We show that they behave differently even on simple workloads, and that no scheduler performs better than the other on all workloads.</p>

<h3>OpenBSD 6.3 on Tuxedo InfinityBook</h3>

<p>Disclaimer:<br>
I came across the Tuxedo Computers InfinityBook last year at the Open! Conference where Tuxedo had a small booth. Previously they came to my attention since they’re a member of the OSB Alliance on whose board I’m a member. Furthermore Tuxedo Computers are a sponsor of the OSBAR which I’m part of the organizational team.</p>

<p>OpenBSD on the Tuxedo InfinityBook<br>
I’ve asked the guys over at Tuxedo Computers whether they would be interested to have some tests with *BSD done and that I could test drive one of their machines and give feedback on what works and what does not - and possibly look into it.+</p>

<p>Within a few weeks they shipped me a machine and last week the InfinityBook Pro 14” arrived. Awesome. Thanks already to the folks at Tuxedo Computers. The machine arrived accompanied by lot’s of swag :)</p>

<p>The InfinityBook is a very nice machine and allows a wide range of configuration. The configuration that was shipped to me:</p>

<p>Intel Core i7-8550U<br>
1x 16GB RAM 2400Mhz Crucial Ballistix Sport LT<br>
250 GB Samsung 860 EVO (M.2 SATAIII)</p>

<p>I used a USB-stick to boot install63.fs and re-installed the machine with OpenBSD. Full dmesg.</p>

<p>The installation went flawlessly, the needed intel firmware is being installed after installation automatically via fw_update(1).</p>

<p>Out of the box the graphics works and once installed the machine presents the login.</p>

<p>Video<br>
When X starts the display is turned off for some reason. You will need to hit fn+f12 (the key with the moon on it) then the display will go on. Aside from that little nit, X works just fine and presents one the expected resolution.</p>

<p>External video is working just fine as well. Either via hdmi output or via the mini displayport connector.</p>

<p>The buttons for adjusting brightness (fn+f8 and fn+f9) are not working. Instead one has to use wsconsctl(8) to adjust the brightness.</p>

<p>Networking<br>
The infinityBook has built-in ethernet, driven by re(4) And for the wireless interface the iwm(4) driver is being used. Both work as expected.</p>

<p>ACPI<br>
Neither suspend nor hibernate work. Reporting of battery status is bogus as well. Some of the keyboard function keys work:</p>

<p>LCD on/off works (fn+f2)<br>
Keyboard backlight dimming works (fn+f4)<br>
Volume (fn+f5 / fn+f6) works</p>

<p>Sound<br>
The azalia chipset is being used for audio processing. Works as expected, volume can be controlled via buttons (fn+f5, fn+f6) or via mixerctl.</p>

<p>Touchpad<br>
Can be controlled via wsconsctl(8).<br>
So far I must say, that the InfinityBook makes a nice machine - and I’m enjoying working with it.</p>

<p>iXsystems<br>
iXsystems - Its all NAS</p>

<h3>How ZFS makes things like ‘zfs diff’ report filenames efficiently</h3>

<p>As a copy on write (file)system, ZFS can use the transaction group (txg) numbers that are embedded in ZFS block pointers to efficiently find the differences between two txgs; this is used in, for example, ZFS bookmarks. However, as I noted at the end of my entry on block pointers, this doesn’t give us a filesystem level difference; instead, it essentially gives us a list of inodes (okay, dnodes) that changed.<br>
In theory, turning an inode or dnode number into the path to a file is an expensive operation; you basically have to search the entire filesystem until you find it. In practice, if you’ve ever run ‘zfs diff’, you’ve likely noticed that it runs pretty fast. Nor is this the only place that ZFS quickly turns dnode numbers into full paths, as it comes up in ‘zpool status’ reports about permanent errors. At one level, zfs diff and zpool status do this so rapidly because they ask the ZFS code in the kernel to do it for them. At another level, the question is how the kernel’s ZFS code can be so fast.<br>
The interesting and surprising answer is that ZFS cheats, in a way that makes things very fast when it works and almost always works in normal filesystems and with normal usage patterns. The cheat is that ZFS dnodes record their parent’s object number.<br>
If you’re familiar with the twists and turns of Unix filesystems, you’re now wondering how ZFS deals with hardlinks, which can cause a file to be in several directories at once and so have several parents (and then it can be removed from some of the directories). The answer is that ZFS doesn’t; a dnode only ever tracks a single parent, and ZFS accepts that this parent information can be inaccurate. I’ll quote the comment in zfs_obj_to_pobj:<br>
When a link is removed [the file’s] parent pointer is not changed and will be invalid. There are two cases where a link is removed but the file stays around, when it goes to the delete queue and when there are additional links.<br>
Before I get into the details, I want to say that I appreciate the brute force elegance of this cheat. The practical reality is that most Unix files today don’t have extra hardlinks, and when they do most hardlinks are done in ways that won’t break ZFS’s parent stuff. The result is that ZFS has picked an efficient implementation that works almost all of the time; in my opinion, the great benefit we get from having it around are more than worth the infrequent cases where it fails or malfunctions. Both zfs diff and having filenames show up in zpool status permanent error reports are very useful (and there may be other cases where this gets used).<br>
The current details are that any time you hardlink a file to somewhere or rename it, ZFS updates the file’s parent to point to the new directory. Often this will wind up with a correct parent even after all of the dust settles; for example, a common pattern is to write a file to an initial location, hardlink it to its final destination, and then remove the initial location version. In this case, the parent will be correct and you’ll get the right name.</p>

<h2>News Roundup</h2>

<h3>What is FreeBSD? Why Should You Choose It Over Linux?</h3>

<p>Not too long ago I wondered if and in what situations FreeBSD could be faster than Linux and we received a good amount of informative feedback. So far, Linux rules the desktop space and FreeBSD rules the server space.</p>

<p>In the meantime, though, what exactly is FreeBSD? And at what times should you choose it over a GNU/Linux installation? Let’s tackle these questions.</p>

<p>FreeBSD is a free and open source derivative of BSD (Berkeley Software Distribution) with a focus on speed, stability, security, and consistency, among other features. It has been developed and maintained by a large community ever since its initial release many years ago on November 1, 1993.</p>

<p>BSD is the version of UNIX® that was developed at the University of California in Berkeley. And being a free and open source version, “Free” being a prefix to BSD is a no-brainer.</p>

<p>What’s FreeBSD Good For?</p>

<p>FreeBSD offers a plethora of advanced features and even boasts some not available in some commercial Operating Systems. It makes an excellent Internet and Intranet server thanks to its robust network services that allow it to maximize memory and work with heavy loads to deliver and maintain good response times for thousands of simultaneous user processes.</p>

<p>FreeBSD runs a huge number of applications with ease. At the moment, it has over 32,000 ported applications and libraries with support for desktop, server, and embedded environments. with that being said, let me also add that FreeBSD is excellent for working with advanced embedded platforms. Mail and web appliances, timer servers, routers, MIPS hardware platforms, etc. You name it!</p>

<p>FreeBSD is available to install in several ways and there are directions to follow for any method you want to use; be it via CD-ROM, over a network using NFS or FTP, or DVD.</p>

<p>FreeBSD is easy to contribute to and all you have to do is to locate the section of the FreeBSD code base to modify and carefully do a neat job. Potential contributors are also free to improve on its artwork and documentation, among other project aspects.</p>

<p>FreeBSD is backed by the FreeBSD Foundation, a non-profit organization that you can contribute to financially and all direct contributions are tax deductible.</p>

<p>FreeBSD’s license allows users to incorporate the use of proprietary software which is ideal for companies interested in generating revenues. Netflix, for example, could cite this as one of the reasons for using FreeBSD servers.</p>

<p>Why Should You Choose It over Linux?</p>

<p>From what I’ve gathered about both FreeBSD and Linux, FreeBSD has a better performance on servers than Linux does. Yes, its packaged applications are configured to offer better a performance than Linux and it is usually running fewer services by default, there really isn’t a way to certify which is faster because the answer is dependent on the running hardware and applications and how the system is tuned.</p>

<p>FreeBSD is reportedly more secure than Linux because of the way the whole project is developed and maintained.</p>

<p>Unlike with Linux, the FreeBSD project is controlled by a large community of developers around the world who fall into any of these categories; core team, contributors, and committers.</p>

<p>FreeBSD is much easier to learn and use because there aren’t a thousand and one distros to choose from with different package managers, DEs, etc.</p>

<p>FreeBSD is more convenient to contribute to because it is the entire OS that is preserved and not just the kernel and a repo as is the case with Linux. You can easily access all of its versions since they are sorted by release numbers.</p>

<p>Apart from the many documentations and guides that you can find online, FreeBSD has a single official documentation wherein you can find the solution to virtually any issue you will come across. So, you’re sure to find it resourceful.</p>

<p>FreeBSD has close to no software issues compared to Linux because it has Java, is capable of running Windows programs using Wine, and can run .NET programs using Mono.</p>

<p>FreeBSD’s ports/packages system allows you to compile software with specific configurations, thereby avoiding conflicting dependency and version issues.</p>

<p>Both the FreeBSD and GNU/Linux project are always receiving updates. The platform you decide to go with is largely dependent on what you want to use it for, your technical know-how, willingness to learn new stuff, and ultimately your preference.<br>
What is your take on the topic? For what reasons would you choose FreeBSD over Linux if you would? Let us know what you think about both platforms in the comments section below.</p>

<h3>PS4 5.05 BPF Double Free Kernel Exploit Writeup</h3>

<p>Introduction<br>
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. The full source of the exploit can be found here.<br>
This bug is no longer accessible however past 5.05 firmware, because the BPF driver has finally been blocked from unprivileged processes - WebKit can no longer open it. Sony also introduced a new security mitigation in 5.0x firmwares to prevent the stack pointer from pointing into user space, however we’ll go more in detail on this a bit further down.</p>

<p>Assumptions<br>
Some assumptions are made of the reader’s knowledge for the writeup. The avid reader should have a basic understanding of how memory allocators work - more specifically, how malloc() and free() allocate and deallocate memory respectively. They should also be aware that devices can be issued commands concurrently, as in, one command could be received while another one is being processed via threading. An understanding of C, x86, and exploitation basics is also very helpful, though not necessarily required.</p>

<p>Background<br>
This section contains some helpful information to those newer to exploitation, or are unfamiliar with device drivers, or various exploit techniques such as heap spraying and race conditions. Feel free to skip to the “A Tale of Two Free()&#39;s” section if you’re already familiar with this material.</p>

<p>What Are Drivers?<br>
There are a few ways that applications can directly communicate with the operating system. One of which is system calls, which there are over 600 of in the PS4 kernel, ~500 of which are FreeBSD - the rest are Sony-implemented. Another method is through something called “Device Drivers”. Drivers are typically used to bridge the gap between software and hardware devices (usb drives, keyboard/mouse, webcams, etc) - though they can also be used just for software purposes.<br>
There are a few operations that a userland application can perform on a driver (if it has sufficient permissions) to interface with it after opening it. In some instances, one can read from it, write to it, or in some cases, issue more complex commands to it via the ioctl() system call. The handlers for these commands are implemented in kernel space - this is important, because any bugs that could be exploited in an ioctl handler can be used as a privilege escalation straight to ring0 - typically the most privileged state.<br>
Drivers are often the more weaker points of an operating system for attackers, because sometimes these drivers are written by developers who don’t understand how the kernel works, or the drivers are older and thus not wise to newer attack methods.</p>

<p>The BPF Device Driver<br>
If we take a look around inside of WebKit’s sandbox, we’ll find a /dev directory. While this may seem like the root device driver path, it’s a lie. Many of the drivers that the PS4 has are not exposed to this directory, but rather only ones that are needed for WebKit’s operation (for the most part). For some reason though, BPF (aka. the “Berkely Packet Filter”) device is not only exposed to WebKit’s sandbox - it also has the privileges to open the device as R/W. This is very odd, because on most systems this driver is root-only (and for good reason). If you want to read more into this, refer to my previous write-up with 4.55FW.</p>

<p>What Are Packet Filters?<br>
Below is an excerpt from the 4.55 bpfwrite writeup.<br>
Since the bug is directly in the filter system, it is important to know the basics of what packet filters are. Filters are essentially sets of pseudo-instructions that are parsed by bpf_filter() (which are ran when packets are received). While the pseudo-instruction set is fairly minimal, it allows you to do things like perform basic arithmetic operations and copy values around inside it’s buffer. Breaking down the BPF VM in it’s entirety is far beyond the scope of this write-up, just know that the code produced by it is ran in kernel mode - this is why read/write access to /dev/bpf should be privileged.</p>

<p>Race Conditions<br>
Race conditions occur when two processes/threads try to access a shared resource at the same time without mutual exclusion. The problem was ultimately solved by introducing concepts such as the “mutex” or “lock”. The idea is when one thread/process tries to access a resource, it will first acquire a lock, access it, then unlock it once it’s finished. If another thread/process tries to access it while the other has the lock, it will wait until the other thread is finished. This works fairly well - when it’s used properly.<br>
Locking is hard to get right, especially when you try to implement fine-grained locking for performance. One single instruction or line of code outside the locking window could introduce a race condition. Not all race conditions are exploitable, but some are (such as this one) - and they can give an attacker very powerful bugs to work with.</p>

<p>Heap Spraying<br>
The process of heap spraying is fairly simple - allocate a bunch of memory and fill it with controlled data in a loop and pray your allocation doesn’t get stolen from underneath you. It’s a very useful technique when exploiting something such as a use-after-free(), as you can use it to get controlled data into your target object’s backing memory.<br>
By extension, it’s useful to do this for a double free() as well, because once we have a stale reference, we can use a heap spray to control the data. Since the object will be marked “free” - the allocator will eventually provide us with control over this memory, even though something else is still using it. That is, unless, something else has already stolen the pointer from you and corrupts it - then you’ll likely get a system crash, and that’s no fun. This is one factor that adds to the variance of exploits, and typically, the smaller the object, the more likely this is to happen.</p>

<p>Follow the link to read more of the article<br>
DigitalOcean<br>
<a href="http://do.co/bsdnow" rel="nofollow">http://do.co/bsdnow</a></p>

<h3>OpenBSD gains Wi-Fi “auto-join”</h3>

<p>In a change which is bound to be welcomed widely, -current has gained “auto-join” for Wi-Fi networks. Peter Hessler (phessler@) has been working on this for quite some time and he wrote about it in his p2k18 hackathon report. He has committed the work from the g2k18 hackathon in Ljubljana:</p>

<p>CVSROOT:    /cvs<br>
Module name:    src<br>
Changes by: <a href="mailto:phessler@cvs.openbsd.org" rel="nofollow">phessler@cvs.openbsd.org</a>    2018/07/11 14:18:09</p>

<p>Modified files:<br>
    sbin/ifconfig  : ifconfig.8 ifconfig.c <br>
    sys/net80211   : ieee80211_ioctl.c ieee80211_ioctl.h <br>
                     ieee80211_node.c ieee80211_node.h <br>
                     ieee80211_var.h </p>

<p>Log message:<br>
Introduce &#39;auto-join&#39; to the wifi 802.11 stack.</p>

<p>This allows a system to remember which ESSIDs it wants to connect to, any<br>
relevant security configuration, and switch to it when the network we are<br>
currently connected to is no longer available.<br>
Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions.</p>

<p>example hostname.if:<br>
join home wpakey password<br>
join work wpakey mekmitasdigoat<br>
join open-lounge<br>
join cafe wpakey cafe2018<br>
join &quot;wepnetwork&quot; nwkey &quot;12345&quot;<br>
dhcp<br>
inet6 autoconf<br>
up</p>

<p>OK stsp@ reyk@<br>
and enthusiasm from every hackroom I&#39;ve been in for the last 3 years<br>
The usage should be clear from the commit message, but basically you ‘join’ all the networks you want to auto-join as you would previously use ‘nwid’ to connect to one specific network. Then the kernel will join the network that’s actually in range and do the rest automagically for you. When you move out of range of that network you lose connectivity until you come in range of the original (where things will continue to work as you’ve been used to) or one of the other networks (where you will associate and then get a new lease).</p>

<p>Thanks to Peter for working on this feature - something many a Wi-Fi using OpenBSD user will be able to benefit from.</p>

<h3>FreeBSD Jails the hard way</h3>

<p>There are many great options for managing FreeBSD Jails. iocage, warden and ez-jail aim to streamline the process and make it quick an easy to get going. But sometimes the tools built right into the OS are overlooked.</p>

<p>This post goes over what is involved in creating and managing jails using only the tools built into FreeBSD.</p>

<p>For this guide, I’m going to be putting my jails in /usr/local/jails.</p>

<p>I’ll start with a very simple, isolated jail. Then I’ll go over how to use ZFS snapshots, and lastly nullfs mounts to share the FreeBSD base files with multiple jails.</p>

<p>I’ll also show some examples of how to use the templating power of jail.conf to apply similar settings to all your jails.</p>

<p>Full Jail<br>
Make a directory for the jail, or a zfs dataset if you prefer.<br>
Download the FreeBSD base files, and any other parts of FreeBSD you want. In this example I’ll include the 32 bit libraries as well.<br>
Update your FreeBSD base install.<br>
Verify your download. We’re downloading these archives over FTP after all, we should confirm that this download is valid and not tampered with. The freebsd-update IDS command verifies the installation using a PGP key which is in your base system, which was presumably installed with an ISO that you verified using the FreeBSD signed checksums. Admittedly this step is a bit of paranoia, but I think it’s prudent.<br>
Make sure you jail has the right timezone and dns servers and a hostname in rc.conf.<br>
Edit jail.conf with the details about your jail.<br>
Start and login to your jail.<br>
11 commands and a config file, but this is the most tedious way to make a jail. With a little bit of templating it can be even easier. So I’ll start by making a template. Making a template is basically the same as steps 1, 2 and 3 above, but with a different destination folder, I’ll condense them here.</p>

<p>Creating a template<br>
Create a template or a ZFS dataset. If you’d like to use the zfs clone method of deploying templates, you’ll need to create a zfs dataset instead of a folder.<br>
Update your template with freebsd-update.<br>
Verify your install<br>
And that’s it, now you have a fully up to date jail template. If you’ve made this template with zfs, you can easily deploy it using zfs snapshots.</p>

<p>Deploying a template with ZFS snapshots<br>
Create a snapshot. My last freebsd-update to my template brought it to patch level 17, so I’ll call my snapshot p10.<br>
Clone the snapshot to a new jail.<br>
Configure the jail hostname.<br>
Add the jail definition to jail.conf, make sure you have the global jail settings from jail.conf listed in the fulljail example.<br>
Start the jail.<br>
The downside with the zfs approach is that each jail is now a fully independent, and if you need to update your jails, you have to update them all individually. By sharing a template using nullfs mounts you can have only one copy of the base system that only needs to be updated once.</p>

<p>Follow the link to see the rest of the article about<br>
Thin jails using NullFS mounts<br>
Simplifying jail.conf<br>
Hopefully this has helped you understand the process of how to create and manage FreeBSD jails without tools that abstract away all the details. Those tools are often quite useful, but there is always benefit in learning to do things the hard way. And in this case, the hard way doesn’t seem to be that hard after all.</p>

<h2>Beastie Bits</h2>

<p>Meetup in Zurich #4, July edition (July 19) – Which you likely missed, but now you know to look for the August edition!<br>
The next two BSD-PL User group meetings in Warsaw have been scheduled for July 30th and Aug 9th @ 1830 CEST – Submit your topic proposals now<br>
Linux Geek Books - Humble Bundle<br>
Extend loader(8) geli support to all architectures and all disk-like devices<br>
Upgrading from a bootpool to a single encrypted pool – skip the gptzfsboot part, and manually update your EFI partition with loader.efi<br>
The pkgsrc 2018Q2 for Illumos is available with 18500+ binary packages<br>
NetBSD ARM64 Images Available with SMP for RPi3 / NanoPi / Pine64 Boards<br>
Recently released CDE 2.3.0 running on Tribblix (Illumos)<br>
An Interview With Tech &amp; Science Fiction Author Michael W Lucas<br>
A reminder : MeetBSD CFP<br>
EuroBSDCon talk acceptances have gone out, and once the tutorials are confirmed, registration will open. That will likely have happened by time you see this episode, so go register! See you in Romania<br>
Tarsnap</p>

<h2>Feedback/Questions</h2>

<p>Wilyarti - Adblocked on FreeBSD Continued…<br>
Andrew - A Question and a Story<br>
Matthew - Thanks<br>
Brian - PCI-E Controller<br>
Send questions, comments, show ideas/topics, or stories you want mentioned on the show to <a href="mailto:feedback@bsdnow.tv" rel="nofollow">feedback@bsdnow.tv</a></p>]]>
  </itunes:summary>
</item>
<item>
  <title>Episode 248: Show Me The Mooney | BSD Now 248</title>
  <link>https://www.bsdnow.tv/248</link>
  <guid isPermaLink="false">http://feed.jupiter.zone/bsdnow#entry-2016</guid>
  <pubDate>Tue, 29 May 2018 14:30:00 -0400</pubDate>
  <author>JT Pennington</author>
  <enclosure url="https://aphid.fireside.fm/d/1437767933/c91b88f1-e824-4815-bcb8-5227818d6010/a0ea5b3c-e781-499e-bfa4-cee1d550f915.mp3" length="62803024" type="audio/mp3"/>
  <itunes:episodeType>full</itunes:episodeType>
  <itunes:author>JT Pennington</itunes:author>
  <itunes:subtitle>DragonflyBSD release 5.2.1 is here, BPF kernel exploit writeup, Remote Debugging the running OpenBSD kernel, interview with Patrick Mooney, FreeBSD buildbot setup in a jail, dumping your USB, and 5 years of gaming on FreeBSD.</itunes:subtitle>
  <itunes:duration>1:44:33</itunes:duration>
  <itunes:explicit>no</itunes:explicit>
  <itunes:image href="https://media24.fireside.fm/file/fireside-images-2024/podcasts/images/c/c91b88f1-e824-4815-bcb8-5227818d6010/cover.jpg?v=4"/>
  <description>&lt;p&gt;DragonflyBSD release 5.2.1 is here, BPF kernel exploit writeup, Remote Debugging the running OpenBSD kernel, interview with Patrick Mooney, FreeBSD buildbot setup in a jail, dumping your USB, and 5 years of gaming on FreeBSD.&lt;/p&gt;

&lt;h2&gt;Headlines&lt;/h2&gt;

&lt;h3&gt;&lt;a href="https://www.dragonflybsd.org/release52/" target="_blank" rel="nofollow noopener"&gt;DragonFlyBSD: release52 (w/stable HAMMER2, as default root)&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DragonflyBSD 5.2.1 was released on May 21, 2018&lt;/li&gt;
&lt;li&gt;&amp;gt; Big Ticket items:


&lt;blockquote&gt;
  Meltdown and Spectre mitigation support
  Meltdown isolation and spectre mitigation support added. Meltdown mitigation is automatically enabled for all Intel cpus. Spectre mitigation must be enabled manually via sysctl if desired, using sysctls machdep.spectre&lt;em&gt;mitigation and machdep.meltdown&lt;/em&gt;mitigation.
  HAMMER2
  H2 has received a very large number of bug fixes and performance improvements. We can now recommend H2 as the default root filesystem in non-clustered mode.
  Clustered support is not yet available.
  ipfw Updates
  Implement state based "redirect", i.e. without using libalias.
  ipfw now supports all possible ICMP types.
  Fix ICMP&lt;em&gt;MAXTYPE assumptions (now 40 as of this release).
  Improved graphics support
  The drm/i915 kernel driver has been updated to support Intel Coffeelake GPUs
  Add 24-bit pixel format support to the EFI frame buffer code.
  Significantly improve fbio support for the "scfb" XOrg driver. This allows EFI frame buffers to be used by X in situations where we do not otherwise support the GPU.
  Partly implement the FBIO&lt;/em&gt;BLANK ioctl for display powersaving.
  Syscons waits for drm modesetting at appropriate places, avoiding races.&lt;/blockquote&gt;
&lt;/li&gt;
  &lt;/ul&gt;
  &lt;hr&gt;


&lt;h3&gt;&lt;a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md" target="_blank" rel="nofollow noopener"&gt;PS4 4.55 BPF Race Condition Kernel Exploit Writeup&lt;/a&gt;&lt;/h3&gt;



&lt;blockquote&gt;
  &lt;p&gt;Note: While this bug is primarily interesting for exploitation on the PS4, this bug can also potentially be exploited on other unpatched platforms using FreeBSD if the attacker has read/write permissions on /dev/bpf, or if they want to escalate from root user to kernel code execution. As such, I've published it under the "FreeBSD" folder and not the "PS4" folder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Welcome to the kernel portion of the PS4 4.55FW full exploit chain write-up. This bug was found by qwerty, and is fairly unique in the way it's exploited, so I wanted to do a detailed write-up on how it worked. The full source of the exploit can be found &lt;a href="https://github.com/Cryptogenic/PS4-4.55-Kernel-Exploit" target="_blank" rel="nofollow noopener"&gt;here&lt;/a&gt;. I've previously covered the webkit exploit implementation for userland access &lt;a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/WebKit/setAttributeNodeNS%20UAF%20Write-up.md" target="_blank" rel="nofollow noopener"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;FreeBSD or Sony's fault? Why not both...&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Interestingly, this bug is actually a FreeBSD bug and was not (at least directly) introduced by Sony code. While this is a FreeBSD bug however, it's not very useful for most systems because the /dev/bpf device driver is root-owned, and the permissions for it are set to 0600 (meaning owner has read/write privileges, and nobody else does) - though it can be used for escalating from root to kernel mode code execution. However, let’s take a look at the make_dev() call inside the PS4 kernel for /dev/bpf (taken from a 4.05 kernel dump).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;
seg000:FFFFFFFFA181F15B                 lea     rdi, unk_FFFFFFFFA2D77640
seg000:FFFFFFFFA181F162                 lea     r9, aBpf        ; "bpf"
seg000:FFFFFFFFA181F169                 mov     esi, 0
seg000:FFFFFFFFA181F16E                 mov     edx, 0
seg000:FFFFFFFFA181F173                 xor     ecx, ecx
seg000:FFFFFFFFA181F175                 mov     r8d, 1B6h
seg000:FFFFFFFFA181F17B                 xor     eax, eax
seg000:FFFFFFFFA181F17D                 mov     cs:qword_FFFFFFFFA34EC770, 0
seg000:FFFFFFFFA181F188                 call    make_dev
&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;We see UID 0 (the UID for the root user) getting moved into the register for the 3rd argument, which is the owner argument. However, the permissions bits are being set to 0x1B6, which in octal is 0666. This means anyone can open /dev/bpf with read/write privileges. I’m not sure why this is the case, qwerty speculates that perhaps bpf is used for LAN gaming. In any case, this was a poor design decision because bpf is usually considered privileged, and should not be accessible to a process that is completely untrusted, such as WebKit. On most platforms, permissions for /dev/bpf will be set to 0x180, or 0600.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Race Conditions - What are they?&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;The class of the bug abused in this exploit is known as a "race condition". Before we get into bug specifics, it's important for the reader to understand what race conditions are and how they can be an issue (especially in something like a kernel). Often in complex software (such as a kernel), resources will be shared (or "global"). This means other threads could potentially execute code that will access some resource that could be accessed by another thread at the same point in time. What happens if one thread accesses this resource while another thread does without exclusive access? Race conditions are introduced.&lt;/p&gt;
  
  &lt;p&gt;Race conditions are defined as possible scenarios where events happen in a sequence different than the developer intended which leads to undefined behavior. In simple, single-threaded programs, this is not an issue because execution is linear. In more complex programs where code can be running in parallel however, this becomes a real issue. To prevent these problems, atomic instructions and locking mechanisms were introduced. When one thread wants to access a critical resource, it will attempt to acquire a "lock". If another thread is already using this resource, generally the thread attempting to acquire the lock will wait until the other thread is finished with it. Each thread must release the lock to the resource after they're done with it, failure to do so could result in a deadlock.&lt;/p&gt;
  
  &lt;p&gt;While locking mechanisms such as mutexes have been introduced, developers sometimes struggle to use them properly. For example, what if a piece of shared data gets validated and processed, but while the processing of the data is locked, the validation is not? There is a window between validation and locking where that data can change, and while the developer thinks the data has been validated, it could be substituted with something malicious after it is validated, but before it is used. Parallel programming can be difficult, especially when, as a developer, you also want to factor in the fact that you don't want to put too much code in between locking and unlocking as it can impact performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;See &lt;a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md" target="_blank" rel="nofollow noopener"&gt;article&lt;/a&gt; for the rest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;p&gt;&lt;strong&gt;iXsystems&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://bijanebrahimi.github.io/blog/remote-debugging-the-running-openbsd-kernel.html" target="_blank" rel="nofollow noopener"&gt;Remote Debugging the running OpenBSD kernel&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Subtitled: A way to understand the OpenBSD internals
+&amp;gt; The Problem
+&amp;gt; A few month ago, I tried porting the FreeBSD kdb along with it's gdb stub implementations to OpenBSD as a practice of learning the internals of an BSD operating system. The ddb code in both FreeBSD and OpenBSD looks pretty much the same and the GDB Remote Serial Protocol looks very minimal.
+&amp;gt; But sadly I got very busy and the work is stalled but I'm planning on resuming the attempt as soon as I get the chance, But there is an alternative way to Debugging the OpenBSD kernel via QEMU. What I did below is basically the same with a few minor changes which I hope to describe it as best.
+&amp;gt; Installing OpenBSD on Qemu
+&amp;gt; For debugging the kernel, we need a working OpenBSD system running on Qemu. I chose to create a raw disk file to be able to easily mount it later via the host and copy the custom kernel onto it.


&lt;blockquote&gt;
  $ qemu-img create -f raw disk.raw 5G
  $ qemu-system-x86&lt;em&gt;64 -m 256M \
  -drive format=raw,file=install63.fs \
  -drive format=raw,file=disk.raw
  +&amp;gt; Custom Kernel
  +&amp;gt; To debug the kernel, we need a version of the kernel with debugging symbols and for that we have to recompile it first. The process is documented at Building the System from Source:
  ...
  +&amp;gt; Then we can copy the bsd kernel to the guest machine and keep the bsd.gdb on the host to start the remote debugging via gdb.
  +&amp;gt; Remote debugging kernel
  +&amp;gt; Now it's to time to boot the guest with the new custom kernel. Remember that the -s argument enables the gdb server on qemu on localhost port 1234 by default:
  $ qemu-system-x86&lt;/em&gt;64 -m 256M -s \
     -net nic -net user \
  -drive format=raw,file=install63.fs \
  +&amp;gt; Now to finally attach to the running kernel:&lt;/blockquote&gt;
&lt;/li&gt;
  &lt;/ul&gt;
  &lt;hr&gt;


&lt;h2&gt;Interview - Patrick Mooney - Software Engineer &lt;a href="pmooney@pfmooney.com" target="_blank" rel="nofollow noopener"&gt;pmooney@pfmooney.com&lt;/a&gt; / &lt;a href="https://twitter.com/pfmooney" target="_blank" rel="nofollow noopener"&gt;@pfmooney&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;BR: How did you first get introduced to UNIX?&lt;/li&gt;
&lt;li&gt;AJ: What got you started contributing to an open source project?&lt;/li&gt;
&lt;li&gt;BR: What sorts of things have you worked on in the past?&lt;/li&gt;
&lt;li&gt;AJ: Can you tell us more about what attracted you to illumos?&lt;/li&gt;
&lt;li&gt;BR: How did you get interested in, and started with, systems development?&lt;/li&gt;
&lt;li&gt;AJ: When did you first get interested in bhyve?&lt;/li&gt;
&lt;li&gt;BR: How much work was it to take the years-old port of bhyve and get it working on modern IllumOS?&lt;/li&gt;
&lt;li&gt;AJ: What was the process for getting the bhyve port caught up to current FreeBSD?&lt;/li&gt;
&lt;li&gt;BR: How usable is bhyve on illumOS?&lt;/li&gt;
&lt;li&gt;AJ: What area are you most interested in improving in bhyve?&lt;/li&gt;
&lt;li&gt;BR: Do you think the FreeBSD and illumos versions of bhyve will stay in sync with each other?&lt;/li&gt;
&lt;li&gt;AJ: What do you do for fun?&lt;/li&gt;
&lt;li&gt;BR: Anything else you want to mention?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;h2&gt;News Roundup&lt;/h2&gt;

&lt;h3&gt;&lt;a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails" target="_blank" rel="nofollow noopener"&gt;Setting up buildbot in FreeBSD Jails&lt;/a&gt;&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;In this article, I would like to present a tutorial to set up buildbot, a continuous integration (CI) software (like Jenkins, drone, etc.), making use of FreeBSD’s containerization mechanism "jails". We will cover terminology, rationale for using both buildbot and jails together, and installation steps. At the end, you will have a working buildbot instance using its sample build configuration, ready to play around with your own CI plans (or even CD, it’s very flexible!). Some hints for production-grade installations are given, but the tutorial steps are meant for a test environment (namely a virtual machine). Buildbot’s configuration and detailed concepts are not in scope here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choosing host operating system and version for buildbot&lt;/li&gt;
&lt;li&gt;Create a FreeBSD playground&lt;/li&gt;
&lt;li&gt;Introduction to jails&lt;/li&gt;
&lt;li&gt;Overview of buildbot&lt;/li&gt;
&lt;li&gt;Set up jails&lt;/li&gt;
&lt;li&gt;Install buildbot master&lt;/li&gt;
&lt;li&gt;Run buildbot master&lt;/li&gt;
&lt;li&gt;Install buildbot worker&lt;/li&gt;
&lt;li&gt;Run buildbot worker&lt;/li&gt;
&lt;li&gt;Set up web server nginx to access buildbot UI&lt;/li&gt;
&lt;li&gt;Run your first build&lt;/li&gt;
&lt;li&gt;Production hints&lt;/li&gt;
&lt;li&gt;Finished!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;&lt;p&gt;Choosing host operating system and version for buildbot&lt;/p&gt;&lt;/li&gt;
&lt;br&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;We choose the released version of FreeBSD (11.1-RELEASE at the moment). There is no particular reason for it, and as a matter of fact buildbot as a Python-based server is very cross-platform; therefore the underlying OS platform and version should not make a large difference.&lt;/p&gt;
  
  &lt;p&gt;It will make a difference for what you do with buildbot, however. For instance, poudriere is the de-facto standard for building packages from source on FreeBSD. Builds run in jails which may be any FreeBSD base system version older or equal to the host’s version (reason will be explained below). In other words, if the host is FreeBSD 11.1, build jails created by poudriere could e.g. use 9.1, 10.3, 11.0, 11.1, but potentially not version 12 or newer because of incompatibilities with the host’s kernel (jails do not run their own kernel as full virtual machines do). To not prolong this article over the intended scope, the details of which nice things could be done or automated with buildbot are not covered.&lt;/p&gt;
  
  &lt;p&gt;Package names on the FreeBSD platform are independent of the OS version, since external software (as in: not part of base system) is maintained in FreeBSD ports. So, if your chosen FreeBSD version (here: 11) is still officially supported, the packages mentioned in this post should work. In the unlikely event of package name changes before you read this article, you should be able to find the actual package names like pkg search buildbot.&lt;/p&gt;
  
  &lt;p&gt;Other operating systems like the various Linux distributions will use different package names but might also offer buildbot pre-packaged. If not, the buildbot installation manual offers steps to install it manually. In such case, the downside is that you will have to maintain and update the buildbot modules outside the stability and (semi-)automatic updates of your OS packages.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;See &lt;a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails" target="_blank" rel="nofollow noopener"&gt;article&lt;/a&gt; for the rest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;p&gt;&lt;strong&gt;DigitalOcean&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://www.grenadille.net/post/2018/03/29/Dumping-your-USB" target="_blank" rel="nofollow noopener"&gt;Dumping your USB&lt;/a&gt;&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;One of the many new features of OpenBSD 6.3 is the possibility to dump USB traffic to userland via bpf(4). This can be done with tcpdump(8) by specifying a USB bus as interface:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;```&lt;/p&gt;

tcpdump -Xx -i usb0

&lt;p&gt;tcpdump: listening on usb0, link-type USBPCAP
12:28:03.317945 bus 0 &amp;lt; addr 1: ep1 intr 2
  0000: 0400                                     ..&lt;/p&gt;

&lt;p&gt;12:28:03.318018 bus 0 &amp;gt; addr 1: ep0 ctrl 8
  0000: 00a3 0000 0002 0004 00                   ......... &lt;br&gt;
[...]
```&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;As you might have noted I decided to implement the existing USBPcap capture format. A capture format is required because USB packets do not include all the necessary information to properly interpret them. I first thought I would implement libpcap's DLT&lt;em&gt;USB but then I quickly realize that this was not a standard. It is instead a FreeBSD specific format which has been since then renamed DLT&lt;/em&gt;USB&lt;em&gt;FREEBSD.
  But I didn't want to embrace xkcd #927, so I look at the existing formats: DLT&lt;/em&gt;USB&lt;em&gt;FREEBSD, DLT&lt;/em&gt;USB&lt;em&gt;LINUX, DLT&lt;/em&gt;USB&lt;em&gt;LINUX&lt;/em&gt;MMAPPED, DLT&lt;em&gt;USB&lt;/em&gt;DARWIN and DLT_USBPCAP. I was first a bit sad to see that nobody could agree on a common format then I moved on and picked the simplest one: USBPcap.
  Implementing an already existing format gives us out-of-box support for all the tools supporting it. That's why having common formats let us share our energy. In the case of USBPcap it is already supported by Wireshark, so you can already inspect your packet graphically. For that you need to first capture raw packets:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;```&lt;/p&gt;

tcpdump -s 3303 -w usb.pcap -i usb0

&lt;p&gt;tcpdump: listening on usb0, link-type USBPCAP
^C
208 packets received by filter
0 packets dropped by kernel
```&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;USB packets can be quite big, that's why I'm not using tcpdump(8)'s default packet size. In this case, I want to make sure I can dump the complete uaudio(4) frames.
  It is important to say that what is dumped to userland is what the USB stack sees. Packets sent on the wire might differ, especially when it comes to retries and timing. So this feature is not here to replace any USB analyser, however I hope that it will help people understand how things work and what the USB stack is doing. Even I found some interesting timing issues while implementing isochronous support.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;h3&gt;&lt;a href="https://www.romanzolotarev.com/openbsd/webserver.html" target="_blank" rel="nofollow noopener"&gt;Run OpenBSD on your web server&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.romanzolotarev.com/vultr.html" target="_blank" rel="nofollow noopener"&gt;Deploy and login to your OpenBSD server first.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;As soon as you're there you can enable an httpd(8) daemon, it's already installed on OpenBSD, you just need to configure it:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;www# vi /etc/httpd.conf&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add two server sections---one for www and another for naked domain (all requests are redirected to www).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;```
server "www.example.com" {
  listen on * port 80
  root "/htdocs/www.example.com"
}&lt;/p&gt;

&lt;p&gt;server "example.com" {
  listen on * port 80
  block return 301 "http://www.example.com$REQUEST_URI"
}
```&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;httpd is chrooted to /var/www by default, so let's make a document root directory:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;www# mkdir -p /var/www/htdocs/www.example.com&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save and check this configuration:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;
www# httpd -n
configuration ok
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable httpd(8) daemon and start it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;
www# rcctl enable httpd
www# rcctl start httpd
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Publish your website&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy your website content into /var/www/htdocs/www.example.com and then test it your web browser.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;http://XXX.XXX.XXX.XXX/&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Your web server should be up and running.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Update DNS records&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;If there is another HTTPS server using this domain, configure that server to redirect all HTTPS requests to HTTP.&lt;/p&gt;
  
  &lt;p&gt;Now as your new server is ready you can update DNS records accordingly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;
    example.com. 300 IN     A XXX.XXX.XXX.XXX
www.example.com. 300 IN     A XXX.XXX.XXX.XXX
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examine your DNS is propagated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$ dig example.com www.example.com&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Check IP addresses it answer sections. If they are correct, you should be able to access your new web server by its domain name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.romanzolotarev.com/openbsd/acme-client.html" target="_blank" rel="nofollow noopener"&gt;What's next? Enable HTTPS on your server.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;h3&gt;&lt;a href="https://euroquis.nl/bobulate/?p=1827" target="_blank" rel="nofollow noopener"&gt;Modern Akonadi and KMail on FreeBSD&lt;/a&gt;&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;For, quite literally a year or more, KMail and Akonadi on FreeBSD have been only marginally useful, at best. KDE4 era KMail was pretty darn good, but everything after that has had a number of FreeBSD users tearing out their hair. Sure, you can go to Trojitá, which has its own special problems and is generally “meh”, or bail out entirely to webmail, but .. KMail is a really great mail client when it works. Which, on Linux desktops, is nearly always, and on FreeBSD, is was nearly never.&lt;/p&gt;
  
  &lt;p&gt;I looked at it with Dan and Volker last summer, briefly, and we got not much further than “hmm”. There’s a message about “The world is going to end!” which hardly makes sense, it means that a message has been truncated or corrupted while traversing a UNIX domain socket.&lt;/p&gt;
  
  &lt;p&gt;Now Alexandre Martins — praise be! — has wandered in with a likely solution. KDE Bug 381850 contains a suggestion, which deserves to be publicised (and tested):&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;sysctl net.local.stream.recvspace=65536&lt;/code&gt;
&lt;code&gt;sysctl net.local.stream.sendspace=65536&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The default FreeBSD UNIX local socket buffer space is 8kiB. Bumping the size up to 64kiB — which matches the size that Linux has by default — suddenly makes KMail and Akonadi shine again. No other changes, no recompiling, just .. bump the sysctls (perhaps also in /etc/sysctl.conf) and KMail from Area51 hums along all day without ending the world.&lt;/p&gt;
  
  &lt;p&gt;Since changing this value may have other effects, and Akonadi shouldn’t be dependent on a specific buffer size anyway, I’m looking into the Akonadi code (encouraged by Dan) to either automatically size the socket buffers, or to figure out where in the underlying code the assumption about buffer size lives. So for now, sysctl can make KMail users on FreeBSD happy, and later we hope to have things fully automatic (and if that doesn’t pan out, well, pkg-message exists).&lt;/p&gt;
  
  &lt;p&gt;PS. Modern KDE PIM applications — Akonadi, KMail — which live in the deskutils/ category of the official FreeBSD ports were added to the official tree April 10th, so you can get your fix now from the official tree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;h2&gt;Beastie Bits&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://lists.dragonflybsd.org/pipermail/users/2018-April/335722.html" target="_blank" rel="nofollow noopener"&gt;pkg-provides support for DragonFly (from Rodrigo Osorio)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://monades.roperzh.com/memories-writing-parser-man-pages/" target="_blank" rel="nofollow noopener"&gt;Memories of writing a parser for man pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developeronfire.com/podcast/episode-198-bryan-cantrill-persistence-and-action" target="_blank" rel="nofollow noopener"&gt;Bryan Cantrill interview over at DeveloperOnFire podcast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://minnie.tuhs.org/pipermail/tuhs/2018-March/013285.html" target="_blank" rel="nofollow noopener"&gt;1978-03-25 - 2018-03-25: 40 years BSD Mail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://imgur.com/a/KOTJS" target="_blank" rel="nofollow noopener"&gt;My 5 years of FreeBSD gaming: a compendium of free games and engines running natively on FreeBSD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reviews.freebsd.org/D15562" target="_blank" rel="nofollow noopener"&gt;Sequential Resilver being upstreamed to FreeBSD, from FreeNAS, where it was ported from ZFS-on-Linux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lists.freebsd.org/pipermail/freebsd-jobs/2018-May/000944.html" target="_blank" rel="nofollow noopener"&gt;University of Aberdeen’s Internet Transport Research Group is hiring  &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;p&gt;&lt;strong&gt;Tarsnap ad&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;Feedback/Questions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dave - &lt;a href="http://dpaste.com/0KHRB4Z#wrap" target="_blank" rel="nofollow noopener"&gt;mounting non-filesystem things inside jails&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Morgan - &lt;a href="http://dpaste.com/10QD42T#wrap" target="_blank" rel="nofollow noopener"&gt;ZFS on Linux Data loss bug&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rene - &lt;a href="http://dpaste.com/30VM51S#wrap" target="_blank" rel="nofollow noopener"&gt;How to keep your ISP’s nose out of your browser history with encrypted DNS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rodriguez - &lt;a href="http://dpaste.com/3WVYR9D#wrap" target="_blank" rel="nofollow noopener"&gt;Feedback question! Relating to Windows&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;hr&gt;

&lt;ul&gt;
&lt;li&gt;Send questions, comments, show ideas/topics, or stories you want mentioned on the show to &lt;a href="mailto:feedback@bsdnow.tv" target="_blank" rel="nofollow noopener"&gt;feedback@bsdnow.tv&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt; 
</description>
  <itunes:keywords>freebsd, openbsd, netbsd, dragonflybsd, trueos, tutorial, howto, guide, bsd, interview, HAMMER2, PS4, Kernel Exploit, debugging</itunes:keywords>
  <content:encoded>
    <![CDATA[<p>DragonflyBSD release 5.2.1 is here, BPF kernel exploit writeup, Remote Debugging the running OpenBSD kernel, interview with Patrick Mooney, FreeBSD buildbot setup in a jail, dumping your USB, and 5 years of gaming on FreeBSD.</p>

<h2>Headlines</h2>

<h3><a href="https://www.dragonflybsd.org/release52/">DragonFlyBSD: release52 (w/stable HAMMER2, as default root)</a></h3>

<ul>
<li>DragonflyBSD 5.2.1 was released on May 21, 2018</li>
<li>> Big Ticket items:


<blockquote>
  Meltdown and Spectre mitigation support
  Meltdown isolation and spectre mitigation support added. Meltdown mitigation is automatically enabled for all Intel cpus. Spectre mitigation must be enabled manually via sysctl if desired, using sysctls machdep.spectre<em>mitigation and machdep.meltdown</em>mitigation.
  HAMMER2
  H2 has received a very large number of bug fixes and performance improvements. We can now recommend H2 as the default root filesystem in non-clustered mode.
  Clustered support is not yet available.
  ipfw Updates
  Implement state based "redirect", i.e. without using libalias.
  ipfw now supports all possible ICMP types.
  Fix ICMP<em>MAXTYPE assumptions (now 40 as of this release).
  Improved graphics support
  The drm/i915 kernel driver has been updated to support Intel Coffeelake GPUs
  Add 24-bit pixel format support to the EFI frame buffer code.
  Significantly improve fbio support for the "scfb" XOrg driver. This allows EFI frame buffers to be used by X in situations where we do not otherwise support the GPU.
  Partly implement the FBIO</em>BLANK ioctl for display powersaving.
  Syscons waits for drm modesetting at appropriate places, avoiding races.</li>
  </ul>
  <hr />
</blockquote>

<h3><a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md">PS4 4.55 BPF Race Condition Kernel Exploit Writeup</a></h3>



<blockquote>
  <p>Note: While this bug is primarily interesting for exploitation on the PS4, this bug can also potentially be exploited on other unpatched platforms using FreeBSD if the attacker has read/write permissions on /dev/bpf, or if they want to escalate from root user to kernel code execution. As such, I've published it under the "FreeBSD" folder and not the "PS4" folder.</p>
</blockquote>

<ul>
<li>Introduction</li>
</ul>

<blockquote>
  <p>Welcome to the kernel portion of the PS4 4.55FW full exploit chain write-up. This bug was found by qwerty, and is fairly unique in the way it's exploited, so I wanted to do a detailed write-up on how it worked. The full source of the exploit can be found <a href="https://github.com/Cryptogenic/PS4-4.55-Kernel-Exploit">here</a>. I've previously covered the webkit exploit implementation for userland access <a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/WebKit/setAttributeNodeNS%20UAF%20Write-up.md">here</a>.</p>
</blockquote>

<ul>
<li>FreeBSD or Sony's fault? Why not both...</li>
</ul>

<blockquote>
  <p>Interestingly, this bug is actually a FreeBSD bug and was not (at least directly) introduced by Sony code. While this is a FreeBSD bug however, it's not very useful for most systems because the /dev/bpf device driver is root-owned, and the permissions for it are set to 0600 (meaning owner has read/write privileges, and nobody else does) - though it can be used for escalating from root to kernel mode code execution. However, let’s take a look at the make_dev() call inside the PS4 kernel for /dev/bpf (taken from a 4.05 kernel dump).</p>
</blockquote>

<p><code>
seg000:FFFFFFFFA181F15B                 lea     rdi, unk_FFFFFFFFA2D77640
seg000:FFFFFFFFA181F162                 lea     r9, aBpf        ; "bpf"
seg000:FFFFFFFFA181F169                 mov     esi, 0
seg000:FFFFFFFFA181F16E                 mov     edx, 0
seg000:FFFFFFFFA181F173                 xor     ecx, ecx
seg000:FFFFFFFFA181F175                 mov     r8d, 1B6h
seg000:FFFFFFFFA181F17B                 xor     eax, eax
seg000:FFFFFFFFA181F17D                 mov     cs:qword_FFFFFFFFA34EC770, 0
seg000:FFFFFFFFA181F188                 call    make_dev
</code></p>

<blockquote>
  <p>We see UID 0 (the UID for the root user) getting moved into the register for the 3rd argument, which is the owner argument. However, the permissions bits are being set to 0x1B6, which in octal is 0666. This means anyone can open /dev/bpf with read/write privileges. I’m not sure why this is the case, qwerty speculates that perhaps bpf is used for LAN gaming. In any case, this was a poor design decision because bpf is usually considered privileged, and should not be accessible to a process that is completely untrusted, such as WebKit. On most platforms, permissions for /dev/bpf will be set to 0x180, or 0600.</p>
</blockquote>

<ul>
<li>Race Conditions - What are they?</li>
</ul>

<blockquote>
  <p>The class of the bug abused in this exploit is known as a "race condition". Before we get into bug specifics, it's important for the reader to understand what race conditions are and how they can be an issue (especially in something like a kernel). Often in complex software (such as a kernel), resources will be shared (or "global"). This means other threads could potentially execute code that will access some resource that could be accessed by another thread at the same point in time. What happens if one thread accesses this resource while another thread does without exclusive access? Race conditions are introduced.</p>
  
  <p>Race conditions are defined as possible scenarios where events happen in a sequence different than the developer intended which leads to undefined behavior. In simple, single-threaded programs, this is not an issue because execution is linear. In more complex programs where code can be running in parallel however, this becomes a real issue. To prevent these problems, atomic instructions and locking mechanisms were introduced. When one thread wants to access a critical resource, it will attempt to acquire a "lock". If another thread is already using this resource, generally the thread attempting to acquire the lock will wait until the other thread is finished with it. Each thread must release the lock to the resource after they're done with it, failure to do so could result in a deadlock.</p>
  
  <p>While locking mechanisms such as mutexes have been introduced, developers sometimes struggle to use them properly. For example, what if a piece of shared data gets validated and processed, but while the processing of the data is locked, the validation is not? There is a window between validation and locking where that data can change, and while the developer thinks the data has been validated, it could be substituted with something malicious after it is validated, but before it is used. Parallel programming can be difficult, especially when, as a developer, you also want to factor in the fact that you don't want to put too much code in between locking and unlocking as it can impact performance.</p>
</blockquote>

<ul>
<li>See <a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md">article</a> for the rest</li>
</ul>

<p><hr /></p>

<p><strong>iXsystems</strong></p>

<h3><a href="http://bijanebrahimi.github.io/blog/remote-debugging-the-running-openbsd-kernel.html">Remote Debugging the running OpenBSD kernel</a></h3>

<ul>
<li>Subtitled: A way to understand the OpenBSD internals
+> The Problem
+> A few month ago, I tried porting the FreeBSD kdb along with it's gdb stub implementations to OpenBSD as a practice of learning the internals of an BSD operating system. The ddb code in both FreeBSD and OpenBSD looks pretty much the same and the GDB Remote Serial Protocol looks very minimal.
+> But sadly I got very busy and the work is stalled but I'm planning on resuming the attempt as soon as I get the chance, But there is an alternative way to Debugging the OpenBSD kernel via QEMU. What I did below is basically the same with a few minor changes which I hope to describe it as best.
+> Installing OpenBSD on Qemu
+> For debugging the kernel, we need a working OpenBSD system running on Qemu. I chose to create a raw disk file to be able to easily mount it later via the host and copy the custom kernel onto it.


<blockquote>
  $ qemu-img create -f raw disk.raw 5G
  $ qemu-system-x86<em>64 -m 256M \
  -drive format=raw,file=install63.fs \
  -drive format=raw,file=disk.raw
  +> Custom Kernel
  +> To debug the kernel, we need a version of the kernel with debugging symbols and for that we have to recompile it first. The process is documented at Building the System from Source:
  ...
  +> Then we can copy the bsd kernel to the guest machine and keep the bsd.gdb on the host to start the remote debugging via gdb.
  +> Remote debugging kernel
  +> Now it's to time to boot the guest with the new custom kernel. Remember that the -s argument enables the gdb server on qemu on localhost port 1234 by default:
  $ qemu-system-x86</em>64 -m 256M -s \
     -net nic -net user \
  -drive format=raw,file=install63.fs \
  +> Now to finally attach to the running kernel:</li>
  </ul>
  <hr />
</blockquote>

<h2>Interview - Patrick Mooney - Software Engineer <a href="pmooney@pfmooney.com">pmooney@pfmooney.com</a> / <a href="https://twitter.com/pfmooney">@pfmooney</a></h2>

<ul>
<li>BR: How did you first get introduced to UNIX?</li>
<li>AJ: What got you started contributing to an open source project?</li>
<li>BR: What sorts of things have you worked on in the past?</li>
<li>AJ: Can you tell us more about what attracted you to illumos?</li>
<li>BR: How did you get interested in, and started with, systems development?</li>
<li>AJ: When did you first get interested in bhyve?</li>
<li>BR: How much work was it to take the years-old port of bhyve and get it working on modern IllumOS?</li>
<li>AJ: What was the process for getting the bhyve port caught up to current FreeBSD?</li>
<li>BR: How usable is bhyve on illumOS?</li>
<li>AJ: What area are you most interested in improving in bhyve?</li>
<li>BR: Do you think the FreeBSD and illumos versions of bhyve will stay in sync with each other?</li>
<li>AJ: What do you do for fun?</li>
<li>BR: Anything else you want to mention?</li>
</ul>

<p><hr /></p>

<h2>News Roundup</h2>

<h3><a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails">Setting up buildbot in FreeBSD Jails</a></h3>

<blockquote>
  <p>In this article, I would like to present a tutorial to set up buildbot, a continuous integration (CI) software (like Jenkins, drone, etc.), making use of FreeBSD’s containerization mechanism "jails". We will cover terminology, rationale for using both buildbot and jails together, and installation steps. At the end, you will have a working buildbot instance using its sample build configuration, ready to play around with your own CI plans (or even CD, it’s very flexible!). Some hints for production-grade installations are given, but the tutorial steps are meant for a test environment (namely a virtual machine). Buildbot’s configuration and detailed concepts are not in scope here.</p>
</blockquote>

<ul>
<li><p>Table of contents</p>

<ul><li>Choosing host operating system and version for buildbot</li>
<li>Create a FreeBSD playground</li>
<li>Introduction to jails</li>
<li>Overview of buildbot</li>
<li>Set up jails</li>
<li>Install buildbot master</li>
<li>Run buildbot master</li>
<li>Install buildbot worker</li>
<li>Run buildbot worker</li>
<li>Set up web server nginx to access buildbot UI</li>
<li>Run your first build</li>
<li>Production hints</li>
<li>Finished!</li></ul></li>
<li><p>Choosing host operating system and version for buildbot</p></li>
</ul>

<blockquote>
  <p>We choose the released version of FreeBSD (11.1-RELEASE at the moment). There is no particular reason for it, and as a matter of fact buildbot as a Python-based server is very cross-platform; therefore the underlying OS platform and version should not make a large difference.</p>
  
  <p>It will make a difference for what you do with buildbot, however. For instance, poudriere is the de-facto standard for building packages from source on FreeBSD. Builds run in jails which may be any FreeBSD base system version older or equal to the host’s version (reason will be explained below). In other words, if the host is FreeBSD 11.1, build jails created by poudriere could e.g. use 9.1, 10.3, 11.0, 11.1, but potentially not version 12 or newer because of incompatibilities with the host’s kernel (jails do not run their own kernel as full virtual machines do). To not prolong this article over the intended scope, the details of which nice things could be done or automated with buildbot are not covered.</p>
  
  <p>Package names on the FreeBSD platform are independent of the OS version, since external software (as in: not part of base system) is maintained in FreeBSD ports. So, if your chosen FreeBSD version (here: 11) is still officially supported, the packages mentioned in this post should work. In the unlikely event of package name changes before you read this article, you should be able to find the actual package names like pkg search buildbot.</p>
  
  <p>Other operating systems like the various Linux distributions will use different package names but might also offer buildbot pre-packaged. If not, the buildbot installation manual offers steps to install it manually. In such case, the downside is that you will have to maintain and update the buildbot modules outside the stability and (semi-)automatic updates of your OS packages.</p>
</blockquote>

<ul>
<li>See <a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails">article</a> for the rest</li>
</ul>

<p><hr /></p>

<p><strong>DigitalOcean</strong></p>

<h3><a href="http://www.grenadille.net/post/2018/03/29/Dumping-your-USB">Dumping your USB</a></h3>

<blockquote>
  <p>One of the many new features of OpenBSD 6.3 is the possibility to dump USB traffic to userland via bpf(4). This can be done with tcpdump(8) by specifying a USB bus as interface:</p>
</blockquote>

<p>```</p>

<h1>tcpdump -Xx -i usb0</h1>

<p>tcpdump: listening on usb0, link-type USBPCAP
12:28:03.317945 bus 0 &lt; addr 1: ep1 intr 2
  0000: 0400                                     ..</p>

<p>12:28:03.318018 bus 0 > addr 1: ep0 ctrl 8
  0000: 00a3 0000 0002 0004 00                   ......... <br />
[...]
```</p>

<blockquote>
  <p>As you might have noted I decided to implement the existing USBPcap capture format. A capture format is required because USB packets do not include all the necessary information to properly interpret them. I first thought I would implement libpcap's DLT<em>USB but then I quickly realize that this was not a standard. It is instead a FreeBSD specific format which has been since then renamed DLT</em>USB<em>FREEBSD.
  But I didn't want to embrace xkcd #927, so I look at the existing formats: DLT</em>USB<em>FREEBSD, DLT</em>USB<em>LINUX, DLT</em>USB<em>LINUX</em>MMAPPED, DLT<em>USB</em>DARWIN and DLT_USBPCAP. I was first a bit sad to see that nobody could agree on a common format then I moved on and picked the simplest one: USBPcap.
  Implementing an already existing format gives us out-of-box support for all the tools supporting it. That's why having common formats let us share our energy. In the case of USBPcap it is already supported by Wireshark, so you can already inspect your packet graphically. For that you need to first capture raw packets:</p>
</blockquote>

<p>```</p>

<h1>tcpdump -s 3303 -w usb.pcap -i usb0</h1>

<p>tcpdump: listening on usb0, link-type USBPCAP
^C
208 packets received by filter
0 packets dropped by kernel
```</p>

<blockquote>
  <p>USB packets can be quite big, that's why I'm not using tcpdump(8)'s default packet size. In this case, I want to make sure I can dump the complete uaudio(4) frames.
  It is important to say that what is dumped to userland is what the USB stack sees. Packets sent on the wire might differ, especially when it comes to retries and timing. So this feature is not here to replace any USB analyser, however I hope that it will help people understand how things work and what the USB stack is doing. Even I found some interesting timing issues while implementing isochronous support.</p>
</blockquote>

<p><hr /></p>

<h3><a href="https://www.romanzolotarev.com/openbsd/webserver.html">Run OpenBSD on your web server</a></h3>

<ul>
<li><a href="https://www.romanzolotarev.com/vultr.html">Deploy and login to your OpenBSD server first.</a></li>
</ul>

<blockquote>
  <p>As soon as you're there you can enable an httpd(8) daemon, it's already installed on OpenBSD, you just need to configure it:</p>
</blockquote>

<p><code>www# vi /etc/httpd.conf</code></p>

<ul>
<li>Add two server sections---one for www and another for naked domain (all requests are redirected to www).</li>
</ul>

<p>```
server "www.example.com" {
  listen on * port 80
  root "/htdocs/www.example.com"
}</p>

<p>server "example.com" {
  listen on * port 80
  block return 301 "http://www.example.com$REQUEST_URI"
}
```</p>

<ul>
<li>httpd is chrooted to /var/www by default, so let's make a document root directory:</li>
</ul>

<p><code>www# mkdir -p /var/www/htdocs/www.example.com</code></p>

<ul>
<li>Save and check this configuration:</li>
</ul>

<p><code>
www# httpd -n
configuration ok
</code></p>

<ul>
<li>Enable httpd(8) daemon and start it.</li>
</ul>

<p><code>
www# rcctl enable httpd
www# rcctl start httpd
</code></p>

<ul>
<li><p>Publish your website</p></li>
<li><p>Copy your website content into /var/www/htdocs/www.example.com and then test it your web browser.</p></li>
</ul>

<p><code>http://XXX.XXX.XXX.XXX/</code></p>

<blockquote>
  <p>Your web server should be up and running.</p>
</blockquote>

<ul>
<li>Update DNS records</li>
</ul>

<blockquote>
  <p>If there is another HTTPS server using this domain, configure that server to redirect all HTTPS requests to HTTP.</p>
  
  <p>Now as your new server is ready you can update DNS records accordingly.</p>
</blockquote>

<p><code>
    example.com. 300 IN     A XXX.XXX.XXX.XXX
www.example.com. 300 IN     A XXX.XXX.XXX.XXX
</code></p>

<ul>
<li>Examine your DNS is propagated.</li>
</ul>

<p><code>$ dig example.com www.example.com</code></p>

<ul>
<li><p>Check IP addresses it answer sections. If they are correct, you should be able to access your new web server by its domain name.</p></li>
<li><p><a href="https://www.romanzolotarev.com/openbsd/acme-client.html">What's next? Enable HTTPS on your server.</a></p></li>
</ul>

<p><hr /></p>

<h3><a href="https://euroquis.nl/bobulate/?p=1827">Modern Akonadi and KMail on FreeBSD</a></h3>

<blockquote>
  <p>For, quite literally a year or more, KMail and Akonadi on FreeBSD have been only marginally useful, at best. KDE4 era KMail was pretty darn good, but everything after that has had a number of FreeBSD users tearing out their hair. Sure, you can go to Trojitá, which has its own special problems and is generally “meh”, or bail out entirely to webmail, but .. KMail is a really great mail client when it works. Which, on Linux desktops, is nearly always, and on FreeBSD, is was nearly never.</p>
  
  <p>I looked at it with Dan and Volker last summer, briefly, and we got not much further than “hmm”. There’s a message about “The world is going to end!” which hardly makes sense, it means that a message has been truncated or corrupted while traversing a UNIX domain socket.</p>
  
  <p>Now Alexandre Martins — praise be! — has wandered in with a likely solution. KDE Bug 381850 contains a suggestion, which deserves to be publicised (and tested):</p>
</blockquote>

<p><code>sysctl net.local.stream.recvspace=65536</code>
<code>sysctl net.local.stream.sendspace=65536</code></p>

<blockquote>
  <p>The default FreeBSD UNIX local socket buffer space is 8kiB. Bumping the size up to 64kiB — which matches the size that Linux has by default — suddenly makes KMail and Akonadi shine again. No other changes, no recompiling, just .. bump the sysctls (perhaps also in /etc/sysctl.conf) and KMail from Area51 hums along all day without ending the world.</p>
  
  <p>Since changing this value may have other effects, and Akonadi shouldn’t be dependent on a specific buffer size anyway, I’m looking into the Akonadi code (encouraged by Dan) to either automatically size the socket buffers, or to figure out where in the underlying code the assumption about buffer size lives. So for now, sysctl can make KMail users on FreeBSD happy, and later we hope to have things fully automatic (and if that doesn’t pan out, well, pkg-message exists).</p>
  
  <p>PS. Modern KDE PIM applications — Akonadi, KMail — which live in the deskutils/ category of the official FreeBSD ports were added to the official tree April 10th, so you can get your fix now from the official tree.</p>
</blockquote>

<p><hr /></p>

<h2>Beastie Bits</h2>

<ul>
<li><a href="http://lists.dragonflybsd.org/pipermail/users/2018-April/335722.html">pkg-provides support for DragonFly (from Rodrigo Osorio)</a></li>
<li><a href="https://monades.roperzh.com/memories-writing-parser-man-pages/">Memories of writing a parser for man pages</a></li>
<li><a href="http://developeronfire.com/podcast/episode-198-bryan-cantrill-persistence-and-action">Bryan Cantrill interview over at DeveloperOnFire podcast</a></li>
<li><a href="http://minnie.tuhs.org/pipermail/tuhs/2018-March/013285.html">1978-03-25 - 2018-03-25: 40 years BSD Mail</a></li>
<li><a href="https://imgur.com/a/KOTJS">My 5 years of FreeBSD gaming: a compendium of free games and engines running natively on FreeBSD</a></li>
<li><a href="https://reviews.freebsd.org/D15562">Sequential Resilver being upstreamed to FreeBSD, from FreeNAS, where it was ported from ZFS-on-Linux</a></li>
<li><a href="https://lists.freebsd.org/pipermail/freebsd-jobs/2018-May/000944.html">University of Aberdeen’s Internet Transport Research Group is hiring  </a></li>
</ul>

<p><hr /></p>

<p><strong>Tarsnap ad</strong></p>

<h2>Feedback/Questions</h2>

<ul>
<li>Dave - <a href="http://dpaste.com/0KHRB4Z#wrap">mounting non-filesystem things inside jails</a></li>
<li>Morgan - <a href="http://dpaste.com/10QD42T#wrap">ZFS on Linux Data loss bug</a></li>
<li>Rene - <a href="http://dpaste.com/30VM51S#wrap">How to keep your ISP’s nose out of your browser history with encrypted DNS</a></li>
<li>Rodriguez - <a href="http://dpaste.com/3WVYR9D#wrap">Feedback question! Relating to Windows</a></li>
</ul>

<p><hr /></p>

<ul>
<li>Send questions, comments, show ideas/topics, or stories you want mentioned on the show to <a href="mailto:feedback@bsdnow.tv">feedback@bsdnow.tv</a></li>
</ul>]]>
  </content:encoded>
  <itunes:summary>
    <![CDATA[<p>DragonflyBSD release 5.2.1 is here, BPF kernel exploit writeup, Remote Debugging the running OpenBSD kernel, interview with Patrick Mooney, FreeBSD buildbot setup in a jail, dumping your USB, and 5 years of gaming on FreeBSD.</p>

<h2>Headlines</h2>

<h3><a href="https://www.dragonflybsd.org/release52/">DragonFlyBSD: release52 (w/stable HAMMER2, as default root)</a></h3>

<ul>
<li>DragonflyBSD 5.2.1 was released on May 21, 2018</li>
<li>> Big Ticket items:


<blockquote>
  Meltdown and Spectre mitigation support
  Meltdown isolation and spectre mitigation support added. Meltdown mitigation is automatically enabled for all Intel cpus. Spectre mitigation must be enabled manually via sysctl if desired, using sysctls machdep.spectre<em>mitigation and machdep.meltdown</em>mitigation.
  HAMMER2
  H2 has received a very large number of bug fixes and performance improvements. We can now recommend H2 as the default root filesystem in non-clustered mode.
  Clustered support is not yet available.
  ipfw Updates
  Implement state based "redirect", i.e. without using libalias.
  ipfw now supports all possible ICMP types.
  Fix ICMP<em>MAXTYPE assumptions (now 40 as of this release).
  Improved graphics support
  The drm/i915 kernel driver has been updated to support Intel Coffeelake GPUs
  Add 24-bit pixel format support to the EFI frame buffer code.
  Significantly improve fbio support for the "scfb" XOrg driver. This allows EFI frame buffers to be used by X in situations where we do not otherwise support the GPU.
  Partly implement the FBIO</em>BLANK ioctl for display powersaving.
  Syscons waits for drm modesetting at appropriate places, avoiding races.</li>
  </ul>
  <hr />
</blockquote>

<h3><a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md">PS4 4.55 BPF Race Condition Kernel Exploit Writeup</a></h3>



<blockquote>
  <p>Note: While this bug is primarily interesting for exploitation on the PS4, this bug can also potentially be exploited on other unpatched platforms using FreeBSD if the attacker has read/write permissions on /dev/bpf, or if they want to escalate from root user to kernel code execution. As such, I've published it under the "FreeBSD" folder and not the "PS4" folder.</p>
</blockquote>

<ul>
<li>Introduction</li>
</ul>

<blockquote>
  <p>Welcome to the kernel portion of the PS4 4.55FW full exploit chain write-up. This bug was found by qwerty, and is fairly unique in the way it's exploited, so I wanted to do a detailed write-up on how it worked. The full source of the exploit can be found <a href="https://github.com/Cryptogenic/PS4-4.55-Kernel-Exploit">here</a>. I've previously covered the webkit exploit implementation for userland access <a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/WebKit/setAttributeNodeNS%20UAF%20Write-up.md">here</a>.</p>
</blockquote>

<ul>
<li>FreeBSD or Sony's fault? Why not both...</li>
</ul>

<blockquote>
  <p>Interestingly, this bug is actually a FreeBSD bug and was not (at least directly) introduced by Sony code. While this is a FreeBSD bug however, it's not very useful for most systems because the /dev/bpf device driver is root-owned, and the permissions for it are set to 0600 (meaning owner has read/write privileges, and nobody else does) - though it can be used for escalating from root to kernel mode code execution. However, let’s take a look at the make_dev() call inside the PS4 kernel for /dev/bpf (taken from a 4.05 kernel dump).</p>
</blockquote>

<p><code>
seg000:FFFFFFFFA181F15B                 lea     rdi, unk_FFFFFFFFA2D77640
seg000:FFFFFFFFA181F162                 lea     r9, aBpf        ; "bpf"
seg000:FFFFFFFFA181F169                 mov     esi, 0
seg000:FFFFFFFFA181F16E                 mov     edx, 0
seg000:FFFFFFFFA181F173                 xor     ecx, ecx
seg000:FFFFFFFFA181F175                 mov     r8d, 1B6h
seg000:FFFFFFFFA181F17B                 xor     eax, eax
seg000:FFFFFFFFA181F17D                 mov     cs:qword_FFFFFFFFA34EC770, 0
seg000:FFFFFFFFA181F188                 call    make_dev
</code></p>

<blockquote>
  <p>We see UID 0 (the UID for the root user) getting moved into the register for the 3rd argument, which is the owner argument. However, the permissions bits are being set to 0x1B6, which in octal is 0666. This means anyone can open /dev/bpf with read/write privileges. I’m not sure why this is the case, qwerty speculates that perhaps bpf is used for LAN gaming. In any case, this was a poor design decision because bpf is usually considered privileged, and should not be accessible to a process that is completely untrusted, such as WebKit. On most platforms, permissions for /dev/bpf will be set to 0x180, or 0600.</p>
</blockquote>

<ul>
<li>Race Conditions - What are they?</li>
</ul>

<blockquote>
  <p>The class of the bug abused in this exploit is known as a "race condition". Before we get into bug specifics, it's important for the reader to understand what race conditions are and how they can be an issue (especially in something like a kernel). Often in complex software (such as a kernel), resources will be shared (or "global"). This means other threads could potentially execute code that will access some resource that could be accessed by another thread at the same point in time. What happens if one thread accesses this resource while another thread does without exclusive access? Race conditions are introduced.</p>
  
  <p>Race conditions are defined as possible scenarios where events happen in a sequence different than the developer intended which leads to undefined behavior. In simple, single-threaded programs, this is not an issue because execution is linear. In more complex programs where code can be running in parallel however, this becomes a real issue. To prevent these problems, atomic instructions and locking mechanisms were introduced. When one thread wants to access a critical resource, it will attempt to acquire a "lock". If another thread is already using this resource, generally the thread attempting to acquire the lock will wait until the other thread is finished with it. Each thread must release the lock to the resource after they're done with it, failure to do so could result in a deadlock.</p>
  
  <p>While locking mechanisms such as mutexes have been introduced, developers sometimes struggle to use them properly. For example, what if a piece of shared data gets validated and processed, but while the processing of the data is locked, the validation is not? There is a window between validation and locking where that data can change, and while the developer thinks the data has been validated, it could be substituted with something malicious after it is validated, but before it is used. Parallel programming can be difficult, especially when, as a developer, you also want to factor in the fact that you don't want to put too much code in between locking and unlocking as it can impact performance.</p>
</blockquote>

<ul>
<li>See <a href="https://github.com/Cryptogenic/Exploit-Writeups/blob/master/FreeBSD/PS4%204.55%20BPF%20Race%20Condition%20Kernel%20Exploit%20Writeup.md">article</a> for the rest</li>
</ul>

<p><hr /></p>

<p><strong>iXsystems</strong></p>

<h3><a href="http://bijanebrahimi.github.io/blog/remote-debugging-the-running-openbsd-kernel.html">Remote Debugging the running OpenBSD kernel</a></h3>

<ul>
<li>Subtitled: A way to understand the OpenBSD internals
+> The Problem
+> A few month ago, I tried porting the FreeBSD kdb along with it's gdb stub implementations to OpenBSD as a practice of learning the internals of an BSD operating system. The ddb code in both FreeBSD and OpenBSD looks pretty much the same and the GDB Remote Serial Protocol looks very minimal.
+> But sadly I got very busy and the work is stalled but I'm planning on resuming the attempt as soon as I get the chance, But there is an alternative way to Debugging the OpenBSD kernel via QEMU. What I did below is basically the same with a few minor changes which I hope to describe it as best.
+> Installing OpenBSD on Qemu
+> For debugging the kernel, we need a working OpenBSD system running on Qemu. I chose to create a raw disk file to be able to easily mount it later via the host and copy the custom kernel onto it.


<blockquote>
  $ qemu-img create -f raw disk.raw 5G
  $ qemu-system-x86<em>64 -m 256M \
  -drive format=raw,file=install63.fs \
  -drive format=raw,file=disk.raw
  +> Custom Kernel
  +> To debug the kernel, we need a version of the kernel with debugging symbols and for that we have to recompile it first. The process is documented at Building the System from Source:
  ...
  +> Then we can copy the bsd kernel to the guest machine and keep the bsd.gdb on the host to start the remote debugging via gdb.
  +> Remote debugging kernel
  +> Now it's to time to boot the guest with the new custom kernel. Remember that the -s argument enables the gdb server on qemu on localhost port 1234 by default:
  $ qemu-system-x86</em>64 -m 256M -s \
     -net nic -net user \
  -drive format=raw,file=install63.fs \
  +> Now to finally attach to the running kernel:</li>
  </ul>
  <hr />
</blockquote>

<h2>Interview - Patrick Mooney - Software Engineer <a href="pmooney@pfmooney.com">pmooney@pfmooney.com</a> / <a href="https://twitter.com/pfmooney">@pfmooney</a></h2>

<ul>
<li>BR: How did you first get introduced to UNIX?</li>
<li>AJ: What got you started contributing to an open source project?</li>
<li>BR: What sorts of things have you worked on in the past?</li>
<li>AJ: Can you tell us more about what attracted you to illumos?</li>
<li>BR: How did you get interested in, and started with, systems development?</li>
<li>AJ: When did you first get interested in bhyve?</li>
<li>BR: How much work was it to take the years-old port of bhyve and get it working on modern IllumOS?</li>
<li>AJ: What was the process for getting the bhyve port caught up to current FreeBSD?</li>
<li>BR: How usable is bhyve on illumOS?</li>
<li>AJ: What area are you most interested in improving in bhyve?</li>
<li>BR: Do you think the FreeBSD and illumos versions of bhyve will stay in sync with each other?</li>
<li>AJ: What do you do for fun?</li>
<li>BR: Anything else you want to mention?</li>
</ul>

<p><hr /></p>

<h2>News Roundup</h2>

<h3><a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails">Setting up buildbot in FreeBSD Jails</a></h3>

<blockquote>
  <p>In this article, I would like to present a tutorial to set up buildbot, a continuous integration (CI) software (like Jenkins, drone, etc.), making use of FreeBSD’s containerization mechanism "jails". We will cover terminology, rationale for using both buildbot and jails together, and installation steps. At the end, you will have a working buildbot instance using its sample build configuration, ready to play around with your own CI plans (or even CD, it’s very flexible!). Some hints for production-grade installations are given, but the tutorial steps are meant for a test environment (namely a virtual machine). Buildbot’s configuration and detailed concepts are not in scope here.</p>
</blockquote>

<ul>
<li><p>Table of contents</p>

<ul><li>Choosing host operating system and version for buildbot</li>
<li>Create a FreeBSD playground</li>
<li>Introduction to jails</li>
<li>Overview of buildbot</li>
<li>Set up jails</li>
<li>Install buildbot master</li>
<li>Run buildbot master</li>
<li>Install buildbot worker</li>
<li>Run buildbot worker</li>
<li>Set up web server nginx to access buildbot UI</li>
<li>Run your first build</li>
<li>Production hints</li>
<li>Finished!</li></ul></li>
<li><p>Choosing host operating system and version for buildbot</p></li>
</ul>

<blockquote>
  <p>We choose the released version of FreeBSD (11.1-RELEASE at the moment). There is no particular reason for it, and as a matter of fact buildbot as a Python-based server is very cross-platform; therefore the underlying OS platform and version should not make a large difference.</p>
  
  <p>It will make a difference for what you do with buildbot, however. For instance, poudriere is the de-facto standard for building packages from source on FreeBSD. Builds run in jails which may be any FreeBSD base system version older or equal to the host’s version (reason will be explained below). In other words, if the host is FreeBSD 11.1, build jails created by poudriere could e.g. use 9.1, 10.3, 11.0, 11.1, but potentially not version 12 or newer because of incompatibilities with the host’s kernel (jails do not run their own kernel as full virtual machines do). To not prolong this article over the intended scope, the details of which nice things could be done or automated with buildbot are not covered.</p>
  
  <p>Package names on the FreeBSD platform are independent of the OS version, since external software (as in: not part of base system) is maintained in FreeBSD ports. So, if your chosen FreeBSD version (here: 11) is still officially supported, the packages mentioned in this post should work. In the unlikely event of package name changes before you read this article, you should be able to find the actual package names like pkg search buildbot.</p>
  
  <p>Other operating systems like the various Linux distributions will use different package names but might also offer buildbot pre-packaged. If not, the buildbot installation manual offers steps to install it manually. In such case, the downside is that you will have to maintain and update the buildbot modules outside the stability and (semi-)automatic updates of your OS packages.</p>
</blockquote>

<ul>
<li>See <a href="https://andidog.de/blog/2018-04-22-buildbot-setup-freebsd-jails">article</a> for the rest</li>
</ul>

<p><hr /></p>

<p><strong>DigitalOcean</strong></p>

<h3><a href="http://www.grenadille.net/post/2018/03/29/Dumping-your-USB">Dumping your USB</a></h3>

<blockquote>
  <p>One of the many new features of OpenBSD 6.3 is the possibility to dump USB traffic to userland via bpf(4). This can be done with tcpdump(8) by specifying a USB bus as interface:</p>
</blockquote>

<p>```</p>

<h1>tcpdump -Xx -i usb0</h1>

<p>tcpdump: listening on usb0, link-type USBPCAP
12:28:03.317945 bus 0 &lt; addr 1: ep1 intr 2
  0000: 0400                                     ..</p>

<p>12:28:03.318018 bus 0 > addr 1: ep0 ctrl 8
  0000: 00a3 0000 0002 0004 00                   ......... <br />
[...]
```</p>

<blockquote>
  <p>As you might have noted I decided to implement the existing USBPcap capture format. A capture format is required because USB packets do not include all the necessary information to properly interpret them. I first thought I would implement libpcap's DLT<em>USB but then I quickly realize that this was not a standard. It is instead a FreeBSD specific format which has been since then renamed DLT</em>USB<em>FREEBSD.
  But I didn't want to embrace xkcd #927, so I look at the existing formats: DLT</em>USB<em>FREEBSD, DLT</em>USB<em>LINUX, DLT</em>USB<em>LINUX</em>MMAPPED, DLT<em>USB</em>DARWIN and DLT_USBPCAP. I was first a bit sad to see that nobody could agree on a common format then I moved on and picked the simplest one: USBPcap.
  Implementing an already existing format gives us out-of-box support for all the tools supporting it. That's why having common formats let us share our energy. In the case of USBPcap it is already supported by Wireshark, so you can already inspect your packet graphically. For that you need to first capture raw packets:</p>
</blockquote>

<p>```</p>

<h1>tcpdump -s 3303 -w usb.pcap -i usb0</h1>

<p>tcpdump: listening on usb0, link-type USBPCAP
^C
208 packets received by filter
0 packets dropped by kernel
```</p>

<blockquote>
  <p>USB packets can be quite big, that's why I'm not using tcpdump(8)'s default packet size. In this case, I want to make sure I can dump the complete uaudio(4) frames.
  It is important to say that what is dumped to userland is what the USB stack sees. Packets sent on the wire might differ, especially when it comes to retries and timing. So this feature is not here to replace any USB analyser, however I hope that it will help people understand how things work and what the USB stack is doing. Even I found some interesting timing issues while implementing isochronous support.</p>
</blockquote>

<p><hr /></p>

<h3><a href="https://www.romanzolotarev.com/openbsd/webserver.html">Run OpenBSD on your web server</a></h3>

<ul>
<li><a href="https://www.romanzolotarev.com/vultr.html">Deploy and login to your OpenBSD server first.</a></li>
</ul>

<blockquote>
  <p>As soon as you're there you can enable an httpd(8) daemon, it's already installed on OpenBSD, you just need to configure it:</p>
</blockquote>

<p><code>www# vi /etc/httpd.conf</code></p>

<ul>
<li>Add two server sections---one for www and another for naked domain (all requests are redirected to www).</li>
</ul>

<p>```
server "www.example.com" {
  listen on * port 80
  root "/htdocs/www.example.com"
}</p>

<p>server "example.com" {
  listen on * port 80
  block return 301 "http://www.example.com$REQUEST_URI"
}
```</p>

<ul>
<li>httpd is chrooted to /var/www by default, so let's make a document root directory:</li>
</ul>

<p><code>www# mkdir -p /var/www/htdocs/www.example.com</code></p>

<ul>
<li>Save and check this configuration:</li>
</ul>

<p><code>
www# httpd -n
configuration ok
</code></p>

<ul>
<li>Enable httpd(8) daemon and start it.</li>
</ul>

<p><code>
www# rcctl enable httpd
www# rcctl start httpd
</code></p>

<ul>
<li><p>Publish your website</p></li>
<li><p>Copy your website content into /var/www/htdocs/www.example.com and then test it your web browser.</p></li>
</ul>

<p><code>http://XXX.XXX.XXX.XXX/</code></p>

<blockquote>
  <p>Your web server should be up and running.</p>
</blockquote>

<ul>
<li>Update DNS records</li>
</ul>

<blockquote>
  <p>If there is another HTTPS server using this domain, configure that server to redirect all HTTPS requests to HTTP.</p>
  
  <p>Now as your new server is ready you can update DNS records accordingly.</p>
</blockquote>

<p><code>
    example.com. 300 IN     A XXX.XXX.XXX.XXX
www.example.com. 300 IN     A XXX.XXX.XXX.XXX
</code></p>

<ul>
<li>Examine your DNS is propagated.</li>
</ul>

<p><code>$ dig example.com www.example.com</code></p>

<ul>
<li><p>Check IP addresses it answer sections. If they are correct, you should be able to access your new web server by its domain name.</p></li>
<li><p><a href="https://www.romanzolotarev.com/openbsd/acme-client.html">What's next? Enable HTTPS on your server.</a></p></li>
</ul>

<p><hr /></p>

<h3><a href="https://euroquis.nl/bobulate/?p=1827">Modern Akonadi and KMail on FreeBSD</a></h3>

<blockquote>
  <p>For, quite literally a year or more, KMail and Akonadi on FreeBSD have been only marginally useful, at best. KDE4 era KMail was pretty darn good, but everything after that has had a number of FreeBSD users tearing out their hair. Sure, you can go to Trojitá, which has its own special problems and is generally “meh”, or bail out entirely to webmail, but .. KMail is a really great mail client when it works. Which, on Linux desktops, is nearly always, and on FreeBSD, is was nearly never.</p>
  
  <p>I looked at it with Dan and Volker last summer, briefly, and we got not much further than “hmm”. There’s a message about “The world is going to end!” which hardly makes sense, it means that a message has been truncated or corrupted while traversing a UNIX domain socket.</p>
  
  <p>Now Alexandre Martins — praise be! — has wandered in with a likely solution. KDE Bug 381850 contains a suggestion, which deserves to be publicised (and tested):</p>
</blockquote>

<p><code>sysctl net.local.stream.recvspace=65536</code>
<code>sysctl net.local.stream.sendspace=65536</code></p>

<blockquote>
  <p>The default FreeBSD UNIX local socket buffer space is 8kiB. Bumping the size up to 64kiB — which matches the size that Linux has by default — suddenly makes KMail and Akonadi shine again. No other changes, no recompiling, just .. bump the sysctls (perhaps also in /etc/sysctl.conf) and KMail from Area51 hums along all day without ending the world.</p>
  
  <p>Since changing this value may have other effects, and Akonadi shouldn’t be dependent on a specific buffer size anyway, I’m looking into the Akonadi code (encouraged by Dan) to either automatically size the socket buffers, or to figure out where in the underlying code the assumption about buffer size lives. So for now, sysctl can make KMail users on FreeBSD happy, and later we hope to have things fully automatic (and if that doesn’t pan out, well, pkg-message exists).</p>
  
  <p>PS. Modern KDE PIM applications — Akonadi, KMail — which live in the deskutils/ category of the official FreeBSD ports were added to the official tree April 10th, so you can get your fix now from the official tree.</p>
</blockquote>

<p><hr /></p>

<h2>Beastie Bits</h2>

<ul>
<li><a href="http://lists.dragonflybsd.org/pipermail/users/2018-April/335722.html">pkg-provides support for DragonFly (from Rodrigo Osorio)</a></li>
<li><a href="https://monades.roperzh.com/memories-writing-parser-man-pages/">Memories of writing a parser for man pages</a></li>
<li><a href="http://developeronfire.com/podcast/episode-198-bryan-cantrill-persistence-and-action">Bryan Cantrill interview over at DeveloperOnFire podcast</a></li>
<li><a href="http://minnie.tuhs.org/pipermail/tuhs/2018-March/013285.html">1978-03-25 - 2018-03-25: 40 years BSD Mail</a></li>
<li><a href="https://imgur.com/a/KOTJS">My 5 years of FreeBSD gaming: a compendium of free games and engines running natively on FreeBSD</a></li>
<li><a href="https://reviews.freebsd.org/D15562">Sequential Resilver being upstreamed to FreeBSD, from FreeNAS, where it was ported from ZFS-on-Linux</a></li>
<li><a href="https://lists.freebsd.org/pipermail/freebsd-jobs/2018-May/000944.html">University of Aberdeen’s Internet Transport Research Group is hiring  </a></li>
</ul>

<p><hr /></p>

<p><strong>Tarsnap ad</strong></p>

<h2>Feedback/Questions</h2>

<ul>
<li>Dave - <a href="http://dpaste.com/0KHRB4Z#wrap">mounting non-filesystem things inside jails</a></li>
<li>Morgan - <a href="http://dpaste.com/10QD42T#wrap">ZFS on Linux Data loss bug</a></li>
<li>Rene - <a href="http://dpaste.com/30VM51S#wrap">How to keep your ISP’s nose out of your browser history with encrypted DNS</a></li>
<li>Rodriguez - <a href="http://dpaste.com/3WVYR9D#wrap">Feedback question! Relating to Windows</a></li>
</ul>

<p><hr /></p>

<ul>
<li>Send questions, comments, show ideas/topics, or stories you want mentioned on the show to <a href="mailto:feedback@bsdnow.tv">feedback@bsdnow.tv</a></li>
</ul>]]>
  </itunes:summary>
</item>
<item>
  <title>12: Collecting SSHells</title>
  <link>https://www.bsdnow.tv/12</link>
  <guid isPermaLink="false">8552d8d2-0590-4641-9780-81ca0dc91bd1</guid>
  <pubDate>Wed, 20 Nov 2013 08:00:00 -0500</pubDate>
  <author>JT Pennington</author>
  <enclosure url="https://aphid.fireside.fm/d/1437767933/c91b88f1-e824-4815-bcb8-5227818d6010/8552d8d2-0590-4641-9780-81ca0dc91bd1.mp3" length="49103236" type="audio/mpeg"/>
  <itunes:episodeType>full</itunes:episodeType>
  <itunes:author>JT Pennington</itunes:author>
  <itunes:subtitle>This week we'll be talking to Amitai Schlair of the NetBSD foundation about pkgsrc, NetBSD's future plans and much more. After that, if you've ever wondered what all this SSH stuff is about, today's tutorial has got you covered. We'll be showing you the basics of SSH, as well as how to combine it with tmux for persistent sessions. News, feedback and everything else, right here on BSD Now - the place to B.. SD.</itunes:subtitle>
  <itunes:duration>1:08:11</itunes:duration>
  <itunes:explicit>no</itunes:explicit>
  <itunes:image href="https://media24.fireside.fm/file/fireside-images-2024/podcasts/images/c/c91b88f1-e824-4815-bcb8-5227818d6010/cover.jpg?v=4"/>
  <description>&lt;p&gt;This week we'll be talking to Amitai Schlair of the NetBSD foundation about pkgsrc, NetBSD's future plans and much more. After that, if you've ever wondered what all this SSH stuff is about, today's tutorial has got you covered. We'll be showing you the basics of SSH, as well as how to combine it with tmux for persistent sessions. News, feedback and everything else, right here on BSD Now - the place to B.. SD.&lt;/p&gt;

&lt;h2&gt;Headlines&lt;/h2&gt;

&lt;h3&gt;&lt;a href="http://freebsdfoundation.blogspot.com/2013/11/faces-of-freebsd-colin-percival.html" target="_blank" rel="nofollow noopener"&gt;Faces of FreeBSD&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The FreeBSD foundation is publishing articles on different FreeBSD developers&lt;/li&gt;
&lt;li&gt;This one is about Colin Percival (cperciva@), the ex-security officer&lt;/li&gt;
&lt;li&gt;Tells the story of how he first found BSD, what he contributed back, how he eventually became the security officer&lt;/li&gt;
&lt;li&gt;Running series with more to come
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="http://www.freebsdnews.net/2013/11/14/eurobsdcon-2013-devsummit-video-recordings/" target="_blank" rel="nofollow noopener"&gt;Lots of BSD presentation videos uploaded&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;EuroBSDCon 2013 dev summit videos, AsiaBSDCon 2013 videos, MWL's presentation video&lt;/li&gt;
&lt;li&gt;Most of us never get to see the dev summit talks since they're only for developers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/bsdconferences" target="_blank" rel="nofollow noopener"&gt;AsiaBSDCon 2013 videos also up&lt;/a&gt; finally&lt;/li&gt;
&lt;li&gt;List of AsiaBSDCon presentation topics &lt;a href="http://2013.asiabsdcon.org/papers/index.html" target="_blank" rel="nofollow noopener"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Our buddy Michael W Lucas gave an &lt;a href="http://blather.michaelwlucas.com/archives/1879" target="_blank" rel="nofollow noopener"&gt;"OpenBSD for Linux users" talk&lt;/a&gt; at a Michigan Unix Users Group.&lt;/li&gt;
&lt;li&gt;He says "Among other things, I compare OpenBSD to Richard Stallman and physically assault an audience member. We also talk long long time, memory randomization, PF, BSD license versus GPL, Microsoft and other OpenBSD stuff"&lt;/li&gt;
&lt;li&gt;Really informative presentation, pretty long, answers some common questions at the end
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="https://blog.netbsd.org/tnf/entry/call_for_presentations_bsd_devroom" target="_blank" rel="nofollow noopener"&gt;Call for Presentations: FOSDEM 2014 and NYCBSDCon 2014&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;FOSDEM 2014 will take place on 1–2 February, 2014, in Brussels, Belgium&lt;/li&gt;
&lt;li&gt;Just like in the last years, there will be both a BSD booth and a developer's room&lt;/li&gt;
&lt;li&gt;The topics of the devroom include all BSD operating systems. Every talk is welcome, from internal hacker discussion to real-world examples and presentations about new and shiny features.&lt;/li&gt;
&lt;li&gt;If you are in the area or want to go, check the show notes for details&lt;/li&gt;
&lt;li&gt;NYCBSDCon &lt;a href="http://undeadly.org/cgi?action=article&amp;amp;sid=20131119053455" target="_blank" rel="nofollow noopener"&gt;is also accepting papers&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;It'll be in New York City at the beginning of February 2014&lt;/li&gt;
&lt;li&gt;If anyone wants to give a talk at one of these conferences, go ahead and send in your stuff!
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="https://lists.freebsd.org/pipermail/freebsd-announce/2013-November/001511.html" target="_blank" rel="nofollow noopener"&gt;FreeBSD foundation's year-end fundraising campaign&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The FreeBSD foundation has been supporting the FreeBSD project and community for over 13 years&lt;/li&gt;
&lt;li&gt;As of today they have raised about half a million dollars, but still have a while to go&lt;/li&gt;
&lt;li&gt;Donations go towards new features, paying for the server infrastructure, conferences, supporting the community, hiring full-time staff members and promoting FreeBSD at events&lt;/li&gt;
&lt;li&gt;They are preparing the debut of a new online magazine, the FreeBSD Journal&lt;/li&gt;
&lt;li&gt;Typically big companies make their huge donations in December, like a couple of anonymous donors that gave around $250,000 each last year&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.freebsdfoundation.org/donate/" target="_blank" rel="nofollow noopener"&gt;Make your donation today&lt;/a&gt; over at freebsdfoundation.org, every little bit helps&lt;/li&gt;
&lt;li&gt;Everyone involved with BSD Now made a donation last year and will do so again this year
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Interview - Amitai Schlair - &lt;a href="mailto:schmonz@netbsd.org" target="_blank" rel="nofollow noopener"&gt;schmonz@netbsd.org&lt;/a&gt; / &lt;a href="https://twitter.com/schmonz" target="_blank" rel="nofollow noopener"&gt;@schmonz&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The NetBSD Foundation, pkgsrc, future plans&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;Tutorial&lt;/h2&gt;

&lt;h3&gt;&lt;a href="http://www.bsdnow.tv/tutorials/ssh-tmux" target="_blank" rel="nofollow noopener"&gt;Combining SSH and tmux&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Note: there was a mistake in the video version of the tutorial, please consult the written version for the proper instructions.&lt;/strong&gt;
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;News Roundup&lt;/h2&gt;

&lt;h3&gt;&lt;a href="http://www.theregister.co.uk/2013/11/16/sony_playstation_4_kernel" target="_blank" rel="nofollow noopener"&gt;PS4 released&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sony's Playstation 4 is finally released&lt;/li&gt;
&lt;li&gt;As previously thought, its OS is heavily based on FreeBSD and uses the kernel among other things&lt;/li&gt;
&lt;li&gt;Link in the show notes contains the &lt;a href="http://www.scei.co.jp/ps4-license/" target="_blank" rel="nofollow noopener"&gt;full list of BSD software they're using&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Always good to see BSD being so widespread
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="http://bsdmag.org/magazine/1853-hast-on-freebsd-how-to-make-storage-highly-availble-by-using-hast" target="_blank" rel="nofollow noopener"&gt;BSD Mag November issue&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Free monthly BSD magazine publishes another issue&lt;/li&gt;
&lt;li&gt;This time their topics include: Configuring a Highly Available Service on FreeBSD, IT Inventory &amp;amp; Asset Management Automation, more FreeBSD Programming Primer, PfSense and Snort and a few others&lt;/li&gt;
&lt;li&gt;PDF linked in the show notes
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="http://mail-index.netbsd.org/pkgsrc-users/2013/11/09/msg018881.html" target="_blank" rel="nofollow noopener"&gt;pbulk builds made easy&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;NetBSD's &lt;a href="https://www.netbsd.org/docs/pkgsrc/bulk.html" target="_blank" rel="nofollow noopener"&gt;pbulk tool&lt;/a&gt; is similar to &lt;a href="http://www.bsdnow.tv/tutorials/poudriere" target="_blank" rel="nofollow noopener"&gt;poudriere&lt;/a&gt;, but for pkgsrc&lt;/li&gt;
&lt;li&gt;While working on updating the documentation, a developer cleaned up quite a lot of code&lt;/li&gt;
&lt;li&gt;He wrote a script that automates pbulk deployment and setup&lt;/li&gt;
&lt;li&gt;The whole setup of a dedicated machine has been reduced to just three commands
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a href="http://blog.pcbsd.org/2013/11/pc-bsd-weekly-feature-digest-111513/" target="_blank" rel="nofollow noopener"&gt;PCBSD weekly digest&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Over 200 PBIs have been populated in to the PC-BSD 10 Stable Appcafe&lt;/li&gt;
&lt;li&gt;Many PC-BSD programs received some necessary bug fixes and updates&lt;/li&gt;
&lt;li&gt;Some include network detection in the package and update managers, nvidia graphic detection, security updates for PCDM
***&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Feedback/Questions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://slexy.org/view/s21oh3vP7t" target="_blank" rel="nofollow noopener"&gt;Peter writes in&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://slexy.org/view/s21zfqcWMP" target="_blank" rel="nofollow noopener"&gt;Kjell-Aleksander writes in&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://slexy.org/view/s2ZmW77Odb" target="_blank" rel="nofollow noopener"&gt;Jordan writes in&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://slexy.org/view/s2BZq7xiyo" target="_blank" rel="nofollow noopener"&gt;Christian writes in&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://slexy.org/view/s21xrk0M4k" target="_blank" rel="nofollow noopener"&gt;entransic writes in&lt;/a&gt;
*** &lt;/li&gt;
&lt;/ul&gt;
</description>
  <itunes:keywords>freebsd, openbsd, netbsd, dragonflybsd, pcbsd, tutorial, howto, guide, bsd, interview, ssh, openssh, gnu, screen, tmux, presentation, talk, foundation, fundraiser, donations, michael w lucas, linux, amitai schlair, schmonz, pkgsrc, tetris, devsummit, dev, developer, summit, eurobsdcon, eurobsdcon2013, 2013, sony, ps4, launch, playstation, playstation4, orbis os, orbisos, asiabsdcon, pbulk</itunes:keywords>
  <content:encoded>
    <![CDATA[<p>This week we&#39;ll be talking to Amitai Schlair of the NetBSD foundation about pkgsrc, NetBSD&#39;s future plans and much more. After that, if you&#39;ve ever wondered what all this SSH stuff is about, today&#39;s tutorial has got you covered. We&#39;ll be showing you the basics of SSH, as well as how to combine it with tmux for persistent sessions. News, feedback and everything else, right here on BSD Now - the place to B.. SD.</p>

<h2>Headlines</h2>

<h3><a href="http://freebsdfoundation.blogspot.com/2013/11/faces-of-freebsd-colin-percival.html" rel="nofollow">Faces of FreeBSD</a></h3>

<ul>
<li>The FreeBSD foundation is publishing articles on different FreeBSD developers</li>
<li>This one is about Colin Percival (cperciva@), the ex-security officer</li>
<li>Tells the story of how he first found BSD, what he contributed back, how he eventually became the security officer</li>
<li>Running series with more to come
***</li>
</ul>

<h3><a href="http://www.freebsdnews.net/2013/11/14/eurobsdcon-2013-devsummit-video-recordings/" rel="nofollow">Lots of BSD presentation videos uploaded</a></h3>

<ul>
<li>EuroBSDCon 2013 dev summit videos, AsiaBSDCon 2013 videos, MWL&#39;s presentation video</li>
<li>Most of us never get to see the dev summit talks since they&#39;re only for developers</li>
<li><a href="https://www.youtube.com/user/bsdconferences" rel="nofollow">AsiaBSDCon 2013 videos also up</a> finally</li>
<li>List of AsiaBSDCon presentation topics <a href="http://2013.asiabsdcon.org/papers/index.html" rel="nofollow">here</a></li>
<li>Our buddy Michael W Lucas gave an <a href="http://blather.michaelwlucas.com/archives/1879" rel="nofollow">&quot;OpenBSD for Linux users&quot; talk</a> at a Michigan Unix Users Group.</li>
<li>He says &quot;Among other things, I compare OpenBSD to Richard Stallman and physically assault an audience member. We also talk long long time, memory randomization, PF, BSD license versus GPL, Microsoft and other OpenBSD stuff&quot;</li>
<li>Really informative presentation, pretty long, answers some common questions at the end
***</li>
</ul>

<h3><a href="https://blog.netbsd.org/tnf/entry/call_for_presentations_bsd_devroom" rel="nofollow">Call for Presentations: FOSDEM 2014 and NYCBSDCon 2014</a></h3>

<ul>
<li>FOSDEM 2014 will take place on 1–2 February, 2014, in Brussels, Belgium</li>
<li>Just like in the last years, there will be both a BSD booth and a developer&#39;s room</li>
<li>The topics of the devroom include all BSD operating systems. Every talk is welcome, from internal hacker discussion to real-world examples and presentations about new and shiny features.</li>
<li>If you are in the area or want to go, check the show notes for details</li>
<li>NYCBSDCon <a href="http://undeadly.org/cgi?action=article&sid=20131119053455" rel="nofollow">is also accepting papers</a>.</li>
<li>It&#39;ll be in New York City at the beginning of February 2014</li>
<li>If anyone wants to give a talk at one of these conferences, go ahead and send in your stuff!
***</li>
</ul>

<h3><a href="https://lists.freebsd.org/pipermail/freebsd-announce/2013-November/001511.html" rel="nofollow">FreeBSD foundation&#39;s year-end fundraising campaign</a></h3>

<ul>
<li>The FreeBSD foundation has been supporting the FreeBSD project and community for over 13 years</li>
<li>As of today they have raised about half a million dollars, but still have a while to go</li>
<li>Donations go towards new features, paying for the server infrastructure, conferences, supporting the community, hiring full-time staff members and promoting FreeBSD at events</li>
<li>They are preparing the debut of a new online magazine, the FreeBSD Journal</li>
<li>Typically big companies make their huge donations in December, like a couple of anonymous donors that gave around $250,000 each last year</li>
<li><a href="http://www.freebsdfoundation.org/donate/" rel="nofollow">Make your donation today</a> over at freebsdfoundation.org, every little bit helps</li>
<li>Everyone involved with BSD Now made a donation last year and will do so again this year
***</li>
</ul>

<h2>Interview - Amitai Schlair - <a href="mailto:schmonz@netbsd.org" rel="nofollow">schmonz@netbsd.org</a> / <a href="https://twitter.com/schmonz" rel="nofollow">@schmonz</a></h2>

<p>The NetBSD Foundation, pkgsrc, future plans</p>

<hr>

<h2>Tutorial</h2>

<h3><a href="http://www.bsdnow.tv/tutorials/ssh-tmux" rel="nofollow">Combining SSH and tmux</a></h3>

<ul>
<li><strong>Note: there was a mistake in the video version of the tutorial, please consult the written version for the proper instructions.</strong>
***</li>
</ul>

<h2>News Roundup</h2>

<h3><a href="http://www.theregister.co.uk/2013/11/16/sony_playstation_4_kernel" rel="nofollow">PS4 released</a></h3>

<ul>
<li>Sony&#39;s Playstation 4 is finally released</li>
<li>As previously thought, its OS is heavily based on FreeBSD and uses the kernel among other things</li>
<li>Link in the show notes contains the <a href="http://www.scei.co.jp/ps4-license/" rel="nofollow">full list of BSD software they&#39;re using</a></li>
<li>Always good to see BSD being so widespread
***</li>
</ul>

<h3><a href="http://bsdmag.org/magazine/1853-hast-on-freebsd-how-to-make-storage-highly-availble-by-using-hast" rel="nofollow">BSD Mag November issue</a></h3>

<ul>
<li>Free monthly BSD magazine publishes another issue</li>
<li>This time their topics include: Configuring a Highly Available Service on FreeBSD, IT Inventory &amp; Asset Management Automation, more FreeBSD Programming Primer, PfSense and Snort and a few others</li>
<li>PDF linked in the show notes
***</li>
</ul>

<h3><a href="http://mail-index.netbsd.org/pkgsrc-users/2013/11/09/msg018881.html" rel="nofollow">pbulk builds made easy</a></h3>

<ul>
<li>NetBSD&#39;s <a href="https://www.netbsd.org/docs/pkgsrc/bulk.html" rel="nofollow">pbulk tool</a> is similar to <a href="http://www.bsdnow.tv/tutorials/poudriere" rel="nofollow">poudriere</a>, but for pkgsrc</li>
<li>While working on updating the documentation, a developer cleaned up quite a lot of code</li>
<li>He wrote a script that automates pbulk deployment and setup</li>
<li>The whole setup of a dedicated machine has been reduced to just three commands
***</li>
</ul>

<h3><a href="http://blog.pcbsd.org/2013/11/pc-bsd-weekly-feature-digest-111513/" rel="nofollow">PCBSD weekly digest</a></h3>

<ul>
<li>Over 200 PBIs have been populated in to the PC-BSD 10 Stable Appcafe</li>
<li>Many PC-BSD programs received some necessary bug fixes and updates</li>
<li>Some include network detection in the package and update managers, nvidia graphic detection, security updates for PCDM
***</li>
</ul>

<h2>Feedback/Questions</h2>

<ul>
<li><a href="http://slexy.org/view/s21oh3vP7t" rel="nofollow">Peter writes in</a></li>
<li><a href="http://slexy.org/view/s21zfqcWMP" rel="nofollow">Kjell-Aleksander writes in</a></li>
<li><a href="http://slexy.org/view/s2ZmW77Odb" rel="nofollow">Jordan writes in</a></li>
<li><a href="http://slexy.org/view/s2BZq7xiyo" rel="nofollow">Christian writes in</a></li>
<li><a href="http://slexy.org/view/s21xrk0M4k" rel="nofollow">entransic writes in</a>
***</li>
</ul>]]>
  </content:encoded>
  <itunes:summary>
    <![CDATA[<p>This week we&#39;ll be talking to Amitai Schlair of the NetBSD foundation about pkgsrc, NetBSD&#39;s future plans and much more. After that, if you&#39;ve ever wondered what all this SSH stuff is about, today&#39;s tutorial has got you covered. We&#39;ll be showing you the basics of SSH, as well as how to combine it with tmux for persistent sessions. News, feedback and everything else, right here on BSD Now - the place to B.. SD.</p>

<h2>Headlines</h2>

<h3><a href="http://freebsdfoundation.blogspot.com/2013/11/faces-of-freebsd-colin-percival.html" rel="nofollow">Faces of FreeBSD</a></h3>

<ul>
<li>The FreeBSD foundation is publishing articles on different FreeBSD developers</li>
<li>This one is about Colin Percival (cperciva@), the ex-security officer</li>
<li>Tells the story of how he first found BSD, what he contributed back, how he eventually became the security officer</li>
<li>Running series with more to come
***</li>
</ul>

<h3><a href="http://www.freebsdnews.net/2013/11/14/eurobsdcon-2013-devsummit-video-recordings/" rel="nofollow">Lots of BSD presentation videos uploaded</a></h3>

<ul>
<li>EuroBSDCon 2013 dev summit videos, AsiaBSDCon 2013 videos, MWL&#39;s presentation video</li>
<li>Most of us never get to see the dev summit talks since they&#39;re only for developers</li>
<li><a href="https://www.youtube.com/user/bsdconferences" rel="nofollow">AsiaBSDCon 2013 videos also up</a> finally</li>
<li>List of AsiaBSDCon presentation topics <a href="http://2013.asiabsdcon.org/papers/index.html" rel="nofollow">here</a></li>
<li>Our buddy Michael W Lucas gave an <a href="http://blather.michaelwlucas.com/archives/1879" rel="nofollow">&quot;OpenBSD for Linux users&quot; talk</a> at a Michigan Unix Users Group.</li>
<li>He says &quot;Among other things, I compare OpenBSD to Richard Stallman and physically assault an audience member. We also talk long long time, memory randomization, PF, BSD license versus GPL, Microsoft and other OpenBSD stuff&quot;</li>
<li>Really informative presentation, pretty long, answers some common questions at the end
***</li>
</ul>

<h3><a href="https://blog.netbsd.org/tnf/entry/call_for_presentations_bsd_devroom" rel="nofollow">Call for Presentations: FOSDEM 2014 and NYCBSDCon 2014</a></h3>

<ul>
<li>FOSDEM 2014 will take place on 1–2 February, 2014, in Brussels, Belgium</li>
<li>Just like in the last years, there will be both a BSD booth and a developer&#39;s room</li>
<li>The topics of the devroom include all BSD operating systems. Every talk is welcome, from internal hacker discussion to real-world examples and presentations about new and shiny features.</li>
<li>If you are in the area or want to go, check the show notes for details</li>
<li>NYCBSDCon <a href="http://undeadly.org/cgi?action=article&sid=20131119053455" rel="nofollow">is also accepting papers</a>.</li>
<li>It&#39;ll be in New York City at the beginning of February 2014</li>
<li>If anyone wants to give a talk at one of these conferences, go ahead and send in your stuff!
***</li>
</ul>

<h3><a href="https://lists.freebsd.org/pipermail/freebsd-announce/2013-November/001511.html" rel="nofollow">FreeBSD foundation&#39;s year-end fundraising campaign</a></h3>

<ul>
<li>The FreeBSD foundation has been supporting the FreeBSD project and community for over 13 years</li>
<li>As of today they have raised about half a million dollars, but still have a while to go</li>
<li>Donations go towards new features, paying for the server infrastructure, conferences, supporting the community, hiring full-time staff members and promoting FreeBSD at events</li>
<li>They are preparing the debut of a new online magazine, the FreeBSD Journal</li>
<li>Typically big companies make their huge donations in December, like a couple of anonymous donors that gave around $250,000 each last year</li>
<li><a href="http://www.freebsdfoundation.org/donate/" rel="nofollow">Make your donation today</a> over at freebsdfoundation.org, every little bit helps</li>
<li>Everyone involved with BSD Now made a donation last year and will do so again this year
***</li>
</ul>

<h2>Interview - Amitai Schlair - <a href="mailto:schmonz@netbsd.org" rel="nofollow">schmonz@netbsd.org</a> / <a href="https://twitter.com/schmonz" rel="nofollow">@schmonz</a></h2>

<p>The NetBSD Foundation, pkgsrc, future plans</p>

<hr>

<h2>Tutorial</h2>

<h3><a href="http://www.bsdnow.tv/tutorials/ssh-tmux" rel="nofollow">Combining SSH and tmux</a></h3>

<ul>
<li><strong>Note: there was a mistake in the video version of the tutorial, please consult the written version for the proper instructions.</strong>
***</li>
</ul>

<h2>News Roundup</h2>

<h3><a href="http://www.theregister.co.uk/2013/11/16/sony_playstation_4_kernel" rel="nofollow">PS4 released</a></h3>

<ul>
<li>Sony&#39;s Playstation 4 is finally released</li>
<li>As previously thought, its OS is heavily based on FreeBSD and uses the kernel among other things</li>
<li>Link in the show notes contains the <a href="http://www.scei.co.jp/ps4-license/" rel="nofollow">full list of BSD software they&#39;re using</a></li>
<li>Always good to see BSD being so widespread
***</li>
</ul>

<h3><a href="http://bsdmag.org/magazine/1853-hast-on-freebsd-how-to-make-storage-highly-availble-by-using-hast" rel="nofollow">BSD Mag November issue</a></h3>

<ul>
<li>Free monthly BSD magazine publishes another issue</li>
<li>This time their topics include: Configuring a Highly Available Service on FreeBSD, IT Inventory &amp; Asset Management Automation, more FreeBSD Programming Primer, PfSense and Snort and a few others</li>
<li>PDF linked in the show notes
***</li>
</ul>

<h3><a href="http://mail-index.netbsd.org/pkgsrc-users/2013/11/09/msg018881.html" rel="nofollow">pbulk builds made easy</a></h3>

<ul>
<li>NetBSD&#39;s <a href="https://www.netbsd.org/docs/pkgsrc/bulk.html" rel="nofollow">pbulk tool</a> is similar to <a href="http://www.bsdnow.tv/tutorials/poudriere" rel="nofollow">poudriere</a>, but for pkgsrc</li>
<li>While working on updating the documentation, a developer cleaned up quite a lot of code</li>
<li>He wrote a script that automates pbulk deployment and setup</li>
<li>The whole setup of a dedicated machine has been reduced to just three commands
***</li>
</ul>

<h3><a href="http://blog.pcbsd.org/2013/11/pc-bsd-weekly-feature-digest-111513/" rel="nofollow">PCBSD weekly digest</a></h3>

<ul>
<li>Over 200 PBIs have been populated in to the PC-BSD 10 Stable Appcafe</li>
<li>Many PC-BSD programs received some necessary bug fixes and updates</li>
<li>Some include network detection in the package and update managers, nvidia graphic detection, security updates for PCDM
***</li>
</ul>

<h2>Feedback/Questions</h2>

<ul>
<li><a href="http://slexy.org/view/s21oh3vP7t" rel="nofollow">Peter writes in</a></li>
<li><a href="http://slexy.org/view/s21zfqcWMP" rel="nofollow">Kjell-Aleksander writes in</a></li>
<li><a href="http://slexy.org/view/s2ZmW77Odb" rel="nofollow">Jordan writes in</a></li>
<li><a href="http://slexy.org/view/s2BZq7xiyo" rel="nofollow">Christian writes in</a></li>
<li><a href="http://slexy.org/view/s21xrk0M4k" rel="nofollow">entransic writes in</a>
***</li>
</ul>]]>
  </itunes:summary>
</item>
  </channel>
</rss>
