BSD Now

BSD Now

Download on the App Store

BSD Now episodes

  • 214: The history of man, kind

    The costs of open sourcing a project are explored, we discover why PS4 downloads are so slow, delve into the history of UNIX man pages, and more.

    This episode was brought to you by

    Headlines
    The Cost Of Open Sourcing Your Project

    Accusing a company of “dumping” their project as open source is probably misplaced – it’s an expensive business no-one would do frivolously.

    If you see an active move to change software licensing or governance, it’s likely someone is paying for it and thus could justify the expense to an executive.

    • A Little History
    • Some case study cameos may help. From 2004 onwards, Sun Microsystems had a policy of all its software moving to open source. The company migrated almost all products to open source licenses, and had varying degrees of success engaging communities around the various projects, largely related to the outlooks of the product management and Sun developers for the project.

      Sun occasionally received requests to make older, retired products open source. For example, Sun acquired a company called Lighthouse Design which created a respected suite of office productivity software for Steve Jobs’ NeXT platform. Strategy changes meant that software headed for the vault (while Jonathan Schwartz, a founder of Lighthouse, headed for the executive suite). Members of the public asked if Sun would open source some of this software, but these requests were declined because there was no business unit willing to fund the move.
      When Sun was later bought by Oracle, a number of those projects that had been made open source were abandoned. “Abandoning” software doesn’t mean leaving it for others; it means simply walking away from wherever you left it. In the case of Sun’s popular identity middleware products, that meant Oracle let the staff go and tried to migrate customers to other products, while remaining silent in public on the future of the project. But the code was already open source, so the user community was able to pick up the pieces and carry on, with help from Forgerock.
      It costs a lot of money to open source a mature piece of commercial software, even if all you are doing is “throwing a tarball over the wall”. That’s why companies abandoning software they no longer care about so rarely make it open source, and those abandoning open source projects rarely move them to new homes that benefit others.

      • If all you have thought about is the eventual outcome, you may be surprised how expensive it is to get there. Costs include: For throwing a tarball over the wall:
      • Legal clearance.
      • Having the right to use the software is not the same as giving everyone in the world an unrestricted right to use it and create derivatives. Checking every line of code to make sure you have the rights necessary to release under an OSI-approved license is a big task requiring high-value employees on the “liberation team”. That includes both developers and lawyers; neither come cheap.

        • Repackaging.
        • To pass it to others, a self-contained package containing all necessary source code, build scripts and non-public source and tool dependencies has to be created since it is quite unlikely to exist internally. Again, the liberation team will need your best developers.

          • Preserving provenance.
          • Just because you have confidence that you have the rights to the code, that doesn’t mean anyone else will. The version control system probably contains much of the information that gives confidence about who wrote which code, so the repackaging needs to also include a way to migrate the commit information.

            • Code cleaning.
            • The file headers will hopefully include origin information but the liberation team had better check. They also need to check the comments for libel and profanities, not to mention trade secrets (especially those from third parties) and other IP issues.

              • For a sustainable project, all the above plus:
              • Compliance with host governance.
              • It is a fantastic idea to move your project to a host like Apache, Conservancy, Public Software and so on. But doing so requires preparatory work. As a minimum you will need to negotiate with the new host organisation, and they may well need you to satisfy their process requirements. Paperwork obviously, but also the code may need conforming copyright statements and more. That’s more work for your liberation team.

                • Migration of rights.
                • Your code has an existing community who will need to migrate to your new host. That includes your staff – they are community too! They will need commit rights, governance rights, social media rights and more. Your liberation team will need your community manager, obviously, but may also need HR input.

                  • Endowment.
                  • Keeping your project alive will take money. It’s all been coming from you up to this point, but if you simply walk away before the financial burden has been accepted by the new community and hosts there may be a problem. You should consider making an endowment to your new host to pay for their migration costs plus the cost of hosting the community for at least a year.

                    • Marketing.
                    • Explaining the move you are making, the reasons why you are making it and the benefits for you and the community is important. If you don’t do it, there are plenty of trolls around who will do it for you. Creating a news blog post and an FAQ — the minimum effort necessary — really does take someone experienced and you’ll want to add such a person to your liberation team.

                      • Motivations
                      • There has to be some commercial reason that makes the time, effort and thus expense worth incurring. Some examples of motivations include:
                      • Market Strategy.
                      • An increasing number of companies are choosing to create substantial, openly-governed open source communities around software that contributes to their business. An open multi-stakeholder co-developer community is an excellent vehicle for innovation at the lowest cost to all involved. As long as your market strategy doesn’t require creating artificial scarcity.

                        • Contract with a third party.
                        • While the owner of the code may no longer be interested, there may be one or more parties to which they owe a contractual responsibility. Rather than breaching that contract, or buying it out, a move to open source may be better. Some sources suggest a contractual obligation to IBM was the reason Oracle abandoned OpenOffice.org by moving it over to the Apache Software Foundation for example.

                          • Larger dependent ecosystem.
                          • You may have no further use for the code itself, but you may well have other parts of your business which depend on it. If they are willing to collectively fund development you might consider an “inner source” strategy which will save you many of the costs above. But the best way to proceed may well be to open the code so your teams and those in other companies can fund the code.

                            • Internal politics.
                            • From the outside, corporations look monolithic, but from the inside it becomes clear they are a microcosm of the market in which they exist. As a result, they have political machinations that may be addressed by open source. One of Oracle’s motivations for moving NetBeans to Apache seems to have been political. Despite multiple internal groups needing it to exist, the code was not generating enough direct revenue to satisfy successive executive owners, who allegedly tried to abandon it on more than one occasion. Donating it to Apache meant that couldn’t happen again.

                              None of this is to say a move to open source guarantees the success of a project. A “Field of Dreams” strategy only works in the movies, after all. But while it may be tempting to look at a failed corporate liberation and describe it as “abandonware”, chances are it was intended as nothing of the kind.

                              Why PS4 downloads are so slow
                              • From the blog that brought us “The origins of XXX as FIXME” and “The mystery of the hanging S3 downloads”, this week it is: “Why are PS4 downloads so slow?”
                              • Game downloads on PS4 have a reputation of being very slow, with many people reporting downloads being an order of magnitude faster on Steam or Xbox. This had long been on my list of things to look into, but at a pretty low priority. After all, the PS4 operating system is based on a reasonably modern FreeBSD (9.0), so there should not be any crippling issues in the TCP stack.

                                The implication is that the problem is something boring, like an inadequately dimensioned CDN. But then I heard that people were successfully using local HTTP proxies as a workaround. It should be pretty rare for that to actually help with download speeds, which made this sound like a much more interesting problem.
                                Before running any experiments, it's good to have a mental model of how the thing we're testing works, and where the problems might be. If nothing else, it will guide the initial experiment design.
                                The speed of a steady-state TCP connection is basically defined by three numbers. The amount of data the client is will to receive on a single round-trip (TCP receive window), the amount of data the server is willing to send on a single round-trip (TCP congestion window), and the round trip latency between the client and the server (RTT). To a first approximation, the connection speed will be:
                                speed = min(rwin, cwin) / RTT
                                With this model, how could a proxy speed up the connection?

                                • The speed through the proxy should be the minimum of the speed between the client and proxy, and the proxy and server. It should only possibly be slower
                                • With a local proxy the client-proxy RTT will be very low; that connection is almost guaranteed to be the faster one. The improvement will have to be from the server-proxy connection being somehow better than the direct client-server one. The RTT will not change, so there are just two options: either the client has a much smaller receive window than the proxy, or the client is somehow causing the server's congestion window to decrease. (E.g. the client is randomly dropping received packets, while the proxy isn't).

                                  • After setting up a test rig, where the PS4’s connection was bridged through a linux box so packets could be captured, and artificial latency could be added, some interested results came up:
                                  • The differences in receive windows at different times are striking. And more important, the changes in the receive windows correspond very well to specific things I did on the PS4

                                    When the download was started, the game Styx: Shards of Darkness was running in the background (just idling in the title screen). The download was limited by a receive window of under 7kB. This is an incredibly low value; it's basically going to cause the downloads to take 100 times longer than they should. And this was not a coincidence, whenever that game was running, the receive window would be that low.
                                    Having an app running (e.g. Netflix, Spotify) limited the receive window to 128kB, for about a 5x reduction in potential download speed.
                                    Moving apps, games, or the download window to the foreground or background didn't have any effect on the receive window.
                                    Playing an online match in a networked game (Dreadnought) caused the receive window to be artificially limited to 7kB.
                                    I ran a speedtest at a time when downloads were limited to 7kB receive window. It got a decent receive window of over 400kB; the conclusion is that the artificial receive window limit appears to only apply to PSN downloads.
                                    When a game was started (causing the previously running game to be stopped automatically), the receive window could increase to 650kB for a very brief period of time. Basically it appears that the receive window gets unclamped when the old game stops, and then clamped again a few seconds later when the new game actually starts up.
                                    I did a few more test runs, and all of them seemed to support the above findings. The only additional information from that testing is that the rest mode behavior was dependent on the PS4 settings. Originally I had it set up to suspend apps when in rest mode. If that setting was disabled, the apps would be closed when entering in rest mode, and the downloads would proceed at full speed.
                                    The PS4 doesn't make it very obvious exactly what programs are running. For games, the interaction model is that opening a new game closes the previously running one. This is not how other apps work; they remain in the background indefinitely until you explicitly close them.

                                    • So, FreeBSD and its network stack are not to blame
                                    • Sony used a poor method to try to keep downloads from interfering with your gameplay
                                    • The impact of changing the receive window is highly dependant upon RTT, so it doesn’t work as evenly as actual traffic shaping or queueing would.
                                    • An interesting deep dive, it is well worth reading the full article and checking out the graphs
                                    • ***
                                      OpenSSH 7.6 Released
                                      • From the release notes:
                                      • This release includes a number of changes that may affect existing

                                        configurations:
                                        ssh(1): delete SSH protocol version 1 support, associated
                                        configuration options and documentation.
                                        ssh(1)/sshd(8): remove support for the hmac-ripemd160 MAC.
                                        ssh(1)/sshd(8): remove support for the arcfour, blowfish and CAST
                                        Refuse RSA keys <1024 bits in length and improve reporting for keys that do not meet
                                        this requirement.
                                        ssh(1): do not offer CBC ciphers by default.

                                        • Changes since OpenSSH 7.5
                                        • This is primarily a bugfix release. It also contains substantial internal refactoring.
                                        • Security: sftp-server(8): in read-only mode, sftp-server was incorrectly permitting creation of zero-length files. Reported by Michal Zalewski.

                                          • New features:
                                          • ssh(1): add RemoteCommand option to specify a command in the ssh config file instead of giving it on the client's command line. This allows the configuration file to specify the command that will be executed on the remote host.

                                            sshd(8): add ExposeAuthInfo option that enables writing details of the authentication methods used (including public keys where applicable) to a file that is exposed via a $SSH_USER_AUTH environment variable in the subsequent session.
                                            ssh(1): add support for reverse dynamic forwarding. In this mode, ssh will act as a SOCKS4/5 proxy and forward connections to destinations requested by the remote SOCKS client. This mode is requested using extended syntax for the -R and RemoteForward options and, because it is implemented solely at the client, does not require the server be updated to be supported.
                                            sshd(8): allow LogLevel directive in sshd_config Match blocks;
                                            ssh-keygen(1): allow inclusion of arbitrary string or flag certificate extensions and critical options.
                                            ssh-keygen(1): allow ssh-keygen to use a key held in ssh-agent as a CA when signing certificates.
                                            ssh(1)/sshd(8): allow IPQoS=none in ssh/sshd to not set an explicit ToS/DSCP value and just use the operating system default.
                                            ssh-add(1): added -q option to make ssh-add quiet on success.
                                            ssh(1): expand the StrictHostKeyChecking option with two new settings. The first "accept-new" will automatically accept hitherto-unseen keys but will refuse connections for changed or invalid hostkeys. This is a safer subset of the current behaviour of StrictHostKeyChecking=no. The second setting "off", is a synonym for the current behaviour of StrictHostKeyChecking=no: accept new host keys, and continue connection for hosts with incorrect hostkeys. A future release will change the meaning of StrictHostKeyChecking=no to the behaviour of "accept-new".
                                            ssh(1): add SyslogFacility option to ssh(1) matching the equivalent option in sshd(8).

                                            • Check out the bugfixes and portability sections, too.
                                            • ***
                                              News Roundup
                                              FreeBSD comes to FiFo 0.9.3 with vmadm
                                              • What is Project FiFo? It’s an Open Source SmartOS Cloud Management and orchestration software. FiFo can be installed on SmartOS zones, running on standard compute nodes. There is no need for dedicated hardware or server roles.
                                              • FiFo 0.9.3 has been in the works for a while, and it comes with quite a few new features. With our last release, we started experimenting with FreeBSD support. Since then much work has gone into improving this. We also did something rather exciting with the mystery box! However, more on that in a later post.

                                                The stable release of 0.9.3 will land within a few days with only packaging and documentation tasks left to do. Part of this means that we’ll have packages for all major components that work natively on BSD. There is no more need for a SmartOS box to run the components!
                                                When we introduced FreeBSD support last version we marked it as an experimental feature. We needed to try out and experiment what works and what does not. Understand the way FreeBSD does things, what tools exist, and how those align with our workflow. Bottomline we were not even sure BSD support was a thing in the future.
                                                We are happy to announce that with 0.9.3 we are now sure BSD support is a thing, and it is here to remain. That said it was good that we experimented in the last release, we did some significant changes to what we have now. When first looking at FreeBSD we went ahead and used existing tooling, namely iocage, to manage jails. It turns out the tooling around jails is not on par with what exists on illumos and especially SmartOS. The goodness of vmadm as a CLI for managing zones is just unparalleled. So we do what every (in)sane person would do!
                                                So with 0.9.3, we did what every (in)sane person would do! We implemented a version of vmadm that would work with FreeBSD and jails and keep the same CLI. Our clone works completely stand alone; vmadm is a compiled binary, written in rust which is blazing fast! The design takes up lessons learned from both zoneadm and vmadm in illumos/SmartOS for how things work instead of trying to reinvent the wheel. Moreover, while we love giving the FreeBSD community a tool we learned to love on SmartOS this also makes things a lot easier for us. FiFo now can use the same logic on SmartOS and FreeBSD as the differences are abstracted away inside of vmadm. That said there are a few notable differences.
                                                First of all, vmadm uses datasets the same way it does on SmartOS. However, there is no separate imgadm tool. Instead, we encapsulate the commands under vmadm images. To make this work we also provide a dataset server with base images for FreeBSD that used the same API as SmartOS dataset servers. Second, we needed to work around some limitations in VNET to make jails capable of being fully utilized in multi-tenancy environments.
                                                Nested vnet jails on freebsd While on illumos a virtual nic can be bound to an IP that can not be changed from inside the zone, VNET does not support this. Preventing tenants from messing with IP settings is crucial from a security standpoint!
                                                To work around that each jail created by vmadm are two jails: a minimal outer jail with nothing but a VNET interface, no IP or anything and an internal one that runs the user code. This outer jail then creates an inner jail with an inherited NIC that gets a fixed IP, combining both the security of a VNET jail as well as the security of a fixed IP interface.
                                                The nested jail layout resembles the way that SmartOS handles KVM machines, running KVM inside a zone. So in addition to working around VNET limitations, this already paves the way for bhyve nested in jails that might come in a future release. We hope to leverage the same two-step with just a different executable started in the outer jail instead of the jail command itself.

                                                History of UNIX Manpages

                                                Where do UNIX manpages come from? Who introduced the section-based layout of NAME, SYNOPSIS, and so on? And for manpage source writers and readers: where were those economical two- and three-letter instructions developed? The many accounts available on the Internet lack citations and are at times inconsistent.

                                                In this article, I reconstruct the history of the UNIX manpage based on source code, manuals, and first-hand accounts.
                                                Special thanks to Paul Pierce for his CTSS source archive; Bernard Nivelet for the Multics Internet Server; the UNIX Heritage Society for their research UNIX source reconstruction; Gunnar Ritter for the Heirloom Project sources; Alcatel-Lucent Bell Labs for the Plan 9 sources; BitSavers for their historical archive; and last but not least, Rudd Canaday, James Clarke, Brian Kernighan, Douglas McIlroy, Nils-Peter Nelson, Jerome Saltzer, Henry Spencer, Ken Thompson, and Tom Van Vleck for their valuable contributions.

                                                Please see the Copyright section if you plan on reproducing parts of this work.

                                                • People:
                                                  • Abell, Vic
                                                  • Canaday, Rudd
                                                  • Capps, Dennis
                                                  • Clarke, James
                                                  • Dzonsons, Kristaps
                                                  • Kernighan, Brian
                                                  • Madnick, Stuart
                                                  • McIlroy, Douglas
                                                  • Morris, Robert
                                                  • Ossanna, Joseph F.
                                                  • Ritchie, Dennis
                                                  • Ritter, Gunnar
                                                  • Saltzer, Jerome H.
                                                  • Spencer, Henry
                                                  • Thompson, Ken
                                                  • ***
                                                    BSDCam 2017 Trip Report: Mathieu Arnold

                                                    It seems that every time I try to go to England using the Eurostar, it gets delayed between 30 minutes and 2 hours. This year, it got my 45 minute layover down to 10 minutes. Luckily, King’s Cross is literally across the street from Saint Pancras, and I managed to get into my second train just in time.

                                                    I arrived in Cambridge on Tuesday right on time for tea. A quick walk from the station got me to St Catharine’s College. This year, we were in a different building for the rooms, so I listened to the convoluted explanation the porter gave me to get to my room, I managed to get there without getting lost more than once. That evening was almost organized as we got together for dinner at the usual pub, the Maypole.

                                                    • Wednesday:
                                                    • The weather is lovely, and it is a good thing as there is a 25-30 minute walk from the College to the Computer Laboratory where the devsummit happens. The first morning is for deciding what we are going to talk about for the rest of the week, so we all go in turn introducing ourselves and voicing about what we would like to talk about. There are a few subjects that are of interest to me, so I listen to the toolchain discussions while writing new bits for the Porter’s Handbook.

                                                      • Thursday:
                                                      • I spent most of the day writing documentation, and talked a bit with a couple of DocEng members about joining the team as I would like to give some love to the build framework that has not been touched in a long time. At the end of the afternoon is a packaging session, we talked about the status of package in base, which is not really going anywhere right now. On the ports side, three aspects that are making good progress include, package flavors, sub packages, and migrating some base libraries to private libraries, which is a nightmare because of openssl, and kerberos, and pam. That evening, we had the formal diner at St John’s College, I love those old buildings that reminds me of Hogwarts. (I am sure there is a quidditch pitch somewhere nearby.)

                                                        • Friday:
                                                        • Last day. I continued to write documentation, while listening to a provisioning session. It would be great to have bhyve support in existing orchestration tools like vagrant, openstack, or maybe ganeti. We end the day, and the devsummit with short talks, some very interesting, some going way over my head.

                                                          The weekend is here. I spent most of Saturday strolling in some of the numerous Cambridge parks, gardens, greens, fens… and I worked on a knitting pattern in the evening. On Sunday, I ate my last full gargantuan english breakfast of the year, and then back in a train to King’s Cross, and a Eurostar (this one on time) back to Paris.
                                                          I would like to thank the FreeBSD Foundation for making this trip possible for me.

                                                          GSoC 2017 Reports: Add SUBPACKAGES support to pkgsrc, part 1
                                                          • Introduction
                                                          • SUBPACKAGES (on some package systems they are known as multi-packages, but this term for pkgsrc is already used by packages that can be built against several versions (e.g. Python, PHP, Ruby packages)) consist in generating multiple binary packages from a single pkgsrc package. For example, from a pkgsrc package - local/frobnitzem - we will see how to generate three separate binary packages: frobnitzem-foo, frobnitzem-bar and frobnitzem-baz.
                                                          • This can be useful to separate several components of binary packages (and avoid to run the extract and configure phase two times!), for debugpkgs (so that all *.debug files containing debug symbols are contained in a separate -debugpkg package that can be installed only when it is needed), etc..
                                                          • An high-level look at how SUBPACKAGES support is implemented
                                                          • Most of the changes needed are in mk/pkgformat/pkg/ hierarchy (previously known as mk/flavour and then renamed and generalized to other package formats during Anton Panev's Google Summer of Code 2011).
                                                          • The code in mk/pkgformat/${PKG_FORMAT}/ handle the interaction of pkgsrc with the particular ${PKG_FORMAT}, e.g. for pkg populate meta-data files used by pkg_create(1), install/delete packages via pkg_add(1), and pkg_delete(1), etc.
                                                          • Conclusion
                                                          • In this first part of this blog post series we have seen what are SUBPACKAGES, when and why they can be useful.
                                                          • We have then seen a practical example of them taking a very trivial package and learned how to "subpackage-ify" it.
                                                          • Then we have described - from an high-level perspective - the changes needed to the pkgsrc infrastructure for the SUBPACKAGES features that we have used. If you are more interested in them please give a look to the pkgsrc debugpkg branch that contains all work done described in this blog post.
                                                          • In the next part we will see how to handle DEPENDS and buildlink3 inclusion for subpackages.
                                                          • **
                                                            Beastie Bits
                                                            • First partial boot of FreeBSD on Power8
                                                            • The new TNF Board of Directors are installed and patched for 2017.
                                                            • Open Source Summit 2017 October 23-26, 2017, Prague, Czech Republic Giovanni Bechis will give a talk about seccomp(2) vs pledge(2)
                                                            • My first patch to OpenBSD
                                                            • Feedback/Questions
                                                              • Brian - OPNSense Facebook Group
                                                              • Mark Felder - ZFS Health via SNMP
                                                              • Matt - Cantrill Presentation
                                                              • ***
                                                                1 hr 31 min
                                                              • 213: The French CONnection

                                                                We recap EuroBSDcon in Paris, tell the story behind a pf PR, and show you how to do screencasting with OpenBSD.

                                                                This episode was brought to you by

                                                                Headlines
                                                                Recap of EuroBSDcon 2017 in Paris, France
                                                                • EuroBSDcon was held in Paris, France this year, which drew record numbers this year.
                                                                • With over 300 attendees, it was the largest BSD event I have ever attended, and I was encouraged by the higher than expected number of first time attendees.
                                                                • The FreeBSD Foundation held a board meeting on Wednesday afternoon with the members who were in Paris. Topics included future conferences (including a conference kit we can mail to people who want to represent FreeBSD) and planning for next year.
                                                                • The FreeBSD Devsummit started on Thursday at the beautiful Mozilla Office in Paris. After registering and picking up our conference bag, everyone gathered for a morning coffee with lots of handshaking and greeting. We then gathered in the next room which had a podium with microphone, screens as well as tables and chairs. After developers sat down, Benedict opened the devsummit with a small quiz about France for developers to win a Mogics Power Bagel. 45 developers participated and DES won the item in the end. After introductions and collecting topics of interest from everyone, we started with the Work in Progress (WIP) session.
                                                                • The WIP session had different people present a topic they are working on in 7 minute timeslots. Topics ranged from FreeBSD Forwarding Performance, fast booting options, and a GELI patch under review to attach multiple providers. See their slides on the FreeBSD wiki.
                                                                • After lunch, the FreeBSD Foundation gave a general update on staff and funding, as well as a more focused presentation about our partnership with Intel. People were interested to hear what was done so far and asked a few questions to the Intel representative Glenn Weinberg.
                                                                • After lunch, developers worked quietly on their own projects. The mic remained open and occasionally, people would step forward and gave a short talk without slides or motivated a discussion of common interest. The day concluded with a dinner at a nice restaurant in Paris, which allowed to continue the discussions of the day.
                                                                • The second day of the devsummit began with a talk about the CAM-based SDIO stack by Ilya Bakulin. His work would allow access to wifi cards/modules on embedded boards like the Raspberry Pi Zero W and similar devices as many of these are using SDIO for data transfers.
                                                                • Next up was a discussion and Q&A session with the FreeBSD core team members who were there (missing only Benno Rice, Kris Moore, John Baldwin, and Baptiste Daroussin, the latter being busy with conference preparations). The new FCP (FreeBSD community proposals) were introduced for those who were not at BSDCan this year and the hows and whys about it. Allan and I were asked to describe our experiences as new members of core and we encouraged people to run for core when the next election happens. After a short break, Scott Long gave an overview of the work that’s been started on NUMA (Non-Uniform Memory Architecture), what the goals of the project are and who is working on it.
                                                                • Before lunch, Christian Schwarz presented his work on zrepl, a new ZFS replication solution he developed using Go. This sparked interest in developers, a port was started and people suggested to Christian that he should submit his talk to AsiaBSDcon and BSDCan next year. Benedict had to leave before lunch was done to teach his Ansible tutorial (which was well attended) at the conference venue.
                                                                • There were organized dinners, for those two nights, quite a feat of organization to fit over 100 people into a restaurant and serve them quickly.
                                                                • On Saturday, there was a social event, a river cruise down the Seine. This took the form of a ‘standing’ dinner, with a wide selection of appetizer type dishes, designed to get people to walk around and converse with many different people, rather than sit at a table with the same 6-8 people. I talked to a much larger group of people than I had managed to at the other dinners.
                                                                • I like having both dinner formats.
                                                                • We would also like to thank all of the BSDNow viewers who attended the conference and made the point of introducing themselves to us. It was nice to meet you all.
                                                                • The recordings of the live video stream from the conference are available immediately, so you can watch the raw versions of the talks now:
                                                                • Auditorium
                                                                  • Keynote 1: Software Development in the Age of Heroes by Thomas Pornin
                                                                  • Tuning FreeBSD for routing and firewalling by Olivier Cochard-Labbé
                                                                  • My BSD sucks less than yours, Act I by Antoine Jacoutot and Baptiste Daroussin
                                                                  • My BSD sucks less than yours, Act II by Antoine Jacoutot and Baptiste Daroussin
                                                                  • Reproducible builds on NetBSD by Christos Zoulas
                                                                  • Your scheduler is not the problem by Martin Pieuchot
                                                                  • Keynote 2: A French story on cybercrime by Éric Freyssinet
                                                                  • Case studies of sandboxing base system with Capsicum by Mariusz Zaborski
                                                                  • OpenBSD’s small steps towards DTrace (a tale about DDB and CTF) by Jasper Lievisse Adriaanse
                                                                  • The Realities of DTrace on FreeBSD by George Neville-Neil
                                                                  • OpenSMTPD, current state of affairs by Gilles Chehade
                                                                  • Hoisting: lessons learned integrating pledge into 500 programs by Theo de Raadt
                                                                  • Keynote 3: System Performance Analysis Methodologies by Brendan Gregg
                                                                  • Closing Session
                                                                  • Karnak
                                                                    • “Is it done yet ?” The never ending story of pkg tools by Marc Espie
                                                                    • A Tale of six motherboards, three BSDs and coreboot by Piotr Kubaj and Katarzyna Kubaj
                                                                    • State of the DragonFly’s graphics stack by François Tigeot
                                                                    • From NanoBSD to ZFS and Jails – FreeBSD as a Hosting Platform, Revisited by Patrick M. Hausen
                                                                    • Bacula – nobody ever regretted making a backup by Dan Langille
                                                                    • Never Lose a Syslog Message by Alexander Bluhm
                                                                    • Running CloudABI applications on a FreeBSD-based Kubernetes cluster by Ed Schouten
                                                                    • The OpenBSD web stack by Michael W. Lucas
                                                                    • The LLDB Debugger on NetBSD by Kamil Rytarowski
                                                                    • What’s in store for NetBSD 8.0? by Alistair Crooks
                                                                    • Louxor
                                                                      • A Modern Replacement for BSD spell(1) by Abhinav Upadhyay
                                                                      • Portable Hotplugging: NetBSD’s uvm_hotplug(9) API development by Cherry G. Mathew
                                                                      • Hardening pkgsrc by Pierre Pronchery
                                                                      • Discovering OpenBSD on AWS by Laurent Bernaille
                                                                      • OpenBSD Testing Infrastructure Behind bluhm.genua.de by Jan Klemkow
                                                                      • The school of hard knocks – PT1 by Sevan Janiyan
                                                                      • 7 years of maintaining firefox, and still looking ahead by Landry Breuil
                                                                      • Branch VPN solution based on OpenBSD, OSPF, RDomains and Ansible by Remi Locherer
                                                                      • Running BSD on AWS by Julien Simon and Nicolas David
                                                                      • Getting started with OpenBSD device driver development by Stefan Sperling
                                                                      • A huge thanks to the organizers, program committee, and sponsors of EuroBSDCon. Next year, EuroBSDcon will be in Bucharest, Romania.
                                                                      • ***
                                                                        The story of PR 219251
                                                                        • The actual story I wanted Kristof to tell, the pf bug he fixed at the Essen Hackathon earlier this summer.
                                                                        • As I threatened to do in my previous post, I'm going to talk about PR 219251 for a bit. The bug report dates from only a few months ago, but the first report (that I can remeber) actually came from Shawn Webb on Twitter, of all places

                                                                          Despite there being a stacktrace it took quite a while (nearly 6 months in fact) before I figured this one out.
                                                                          It took Reshad Patuck managing to distill the problem down to a small-ish test script to make real progress on this. His testcase meant that I could get core dumps and experiment. It also provided valuable clues because it could be tweaked to see what elements were required to trigger the panic.
                                                                          This test script starts a (vnet) jail, adds an epair interface to it, sets up pf in the jail, and then reloads the pf rules on the host. Interestingly the panic does not seem to occur if that last step is not included.

                                                                          • Obviously not the desired behaviour, but it seems strange. The instances of pf in the jails are supposed to be separate.
                                                                          • We try to fetch a counter value here, but instead we dereference a bad pointer. There's two here, so already we need more information. Inspection of the core dump reveals that the state pointer is valid, and contains sane information. The rule pointer (rule.ptr) points to a sensible location, but the data is mostly 0xdeadc0de. This is the memory allocator being helpful (in debug mode) and writing garbage over freed memory, to make use-after-free bugs like this one easier to find.

                                                                            In other words: the rule has been free()d while there was still a state pointing to it. Somehow we have a state (describing a connection pf knows about) which points to a rule which no longer exists. The core dump also shows that the problem always occurs with states and rules in the default vnet (i.e. the host pf instance), not one of the pf instances in one of the vnet jails. That matches with the observation that the test script does not trigger the panic unless we also reload the rules on the host.
                                                                            Great, we know what's wrong, but now we need to work out how we can get into this state. At this point we're going to have to learn something about how rules and states get cleaned up in pf. Don't worry if you had no idea, because before this bug I didn't either.
                                                                            The states keep a pointer to the rule they match, so when rules are changed (or removed) we can't just delete them. States get cleaned up when connections are closed or they time out. This means we have to keep old rules around until the states that use them expire.
                                                                            When rules are removed pf_unlink_rule() adds then to the V_pf_unlinked_rules list (more on that funny V_ prefix later). From time to time the pf purge thread will run over all states and mark the rules that are used by a state. Once that's done for all states we know that all rules that are not marked as in-use can be removed (because none of the states use it). That can be a lot of work if we've got a lot of states, so pf_purge_thread() breaks that up into smaller chuncks, iterating only part of the state table on every run.
                                                                            We iterate over all of our virtual pf instances (VNET_FOREACH()), check if it's active (for FreeBSD-EN-17.08, where we've seen this code before) and then check the expired states with pf_purge_expired_states(). We start at state 'idx' and only process a certain number (determined by the PFTM_INTERVAL setting) states. The pf_purge_expired_states() function returns a new idx value to tell us how far we got.
                                                                            So, remember when I mentioned the odd V_ prefix? Those are per-vnet variables. They work a bit like thread-local variables. Each vnet (virtual network stack) keeps its state separate from the others, and the V_ variables use a pointer that's changed whenever we change the currently active vnet (say with CURVNET_SET() or CURVNET_RESTORE()). That's tracked in the 'curvnet' variable. In other words: there are as many V_pf_vnet_active variables as there are vnets: number of vnet jails plus one (for the host system).
                                                                            Why is that relevant here? Note that idx is not a per-vnet variable, but we handle multiple pf instances here. We run through all of them in fact. That means that we end up checking the first X states in the first vnet, then check the second X states in the second vnet, the third X states in the third and so on and so on.
                                                                            That of course means that we think we've run through all of the states in a vnet while we really only checked some of them. So when pf_purge_unlinked_rules() runs it can end up free()ing rules that actually are still in use because pf_purge_thread() skipped over the state(s) that actually used the rule. The problem only happened if we reloaded rules in the host, because the active ruleset is never free()d, even if there are no states pointing to the rule.
                                                                            That explains the panic, and the fix is actually quite straightforward: idx needs to be a per-vnet variable, V_pf_purge_idx, and then the problem is gone. As is often the case, the solution to a fairly hard problem turns out to be really simple.

                                                                            • As you might expect, finding the problem takes a lot more work that fixing it
                                                                            • Thanks to Kristof for writing up this detailed post explaining how the problem was found, and what caused it.
                                                                            • ***
                                                                              vBSDcon 2017: BSD at Work

                                                                              The third biennial vBSDcon hosted by Verisign took place September 7th through 9th with the FreeBSD Developer Summit taking place the first day. vBSDcon and iXsystems’ MeetBSD event have been alternating between the East and West coasts of the U.S.A. and these two events play vital roles in reaching Washington, DC-area and Bay Area/Silicon Valley audiences. Where MeetBSD serves many BSD Vendors, vBSDcon attracts a unique government and security industry demographic that isn’t found anywhere else. Conference time and travel budgets are always limited and bringing these events to their attendees is a much-appreciated service provided by their hosts.

                                                                              The vBSDcon FreeBSD DevSummit had a strong focus on OpenZFS, the build system and networking with the FreeBSD 12 wish list of features in mind. How to best incorporate the steady flow of new OpenZFS features into FreeBSD such as dataset-level encryption was of particular interest. This feature from a GNU/Linux-based storage vendor is tribute to the growth of the OpenZFS community which is vital in light of the recent “Death of Solaris and ZFS” at Oracle. There has never been more demand for OpenZFS on FreeBSD and the Oracle news further confirms our collective responsibility to meet that demand.
                                                                              The official conference opened with my talk on “Isolated BSD Build Environments” in which I explained how the bhyve hypervisor can be used to effortlessly tour FreeBSD 5.0-onward and build specific source releases on demand to trace regressions to their offending commit. I was followed by a FreeNAS user who made the good point that FreeNAS is an exemplary “entry vector” into Unix and Enterprise Storage fundamentals, given that many of the vectors our generation had are gone. Where many of us discovered Unix and the Internet via console terminals at school or work, smart phones are only delivering the Internet without the Unix. With some irony, both iOS and Android are Unix-based yet offer few opportunities for their users to learn and leverage their Unix environments.
                                                                              The next two talks were The History and Future of Core Dumps in FreeBSD by Sam Gwydir and Using pkgsrc for multi-platform deployments in heterogeneous environments by G. Clifford Williams. I strongly recommend that anyone wanting to speak at AsiaBSDCon read Sam’s accompanying paper on core dumps because I consider it the perfect AsiaBSDCon topic and his execution is excellent. Core dumps are one of those things you rarely think about until they are a DROP EVERYTHING! priority. G. Clifford’s talk was about what I consider a near-perfect BSD project: pkgsrc, the portable BSD package manager. I put it up there with OpenSSH and mandoc as projects that have provided significant value to other Open Source operating systems. G. Clifford’s real-world experiences are perfectly inline with vBSDcon’s goal to be more production-oriented than other BSDCons.
                                                                              Of the other talks, any and all Dtrace talks are always appreciated and George Neville-Neil’s did not disappoint. He based it on his experiences with the Teach BSD project which is bringing FreeBSD-based computer science education to schools around the world. The security-related talks by John-Mark Gurney, Dean Freeman and Michael Shirk also represented vBSDcon’s consideration of the local community and made a convincing point that the BSDs should make concerted efforts to qualify for Common Criteria, FIPS, and other Government security requirements. While some security experts will scoff at these, they are critical to the adoption of BSD-based products by government agencies.
                                                                              BSD Now hosts Allan Jude and Benedict Reuschling hosted an OpenZFS BoF and Ansible talk respectively and I hosted a bhyve hypervisor BoF. The Hallway Track and food at vBSDcon were excellent and both culminated with an after-dinner dramatic reading of Michael W. Lucas’ latest book that raised money for the FreeBSD Foundation. A great time was had by all and it was wonderful to see everyone!

                                                                              News Roundup
                                                                              FreeBSD 10.4-RC2 Available
                                                                              • FreeBSD 10.4 will be released soon, this is the last chance to find bugs before the official release is cut.
                                                                              • Noteworthy Changes Since 10.4-RC1:
                                                                                • Given that the amd64 disc1 image was overflowing, more of the base components installed into the disc1 (live) file systems had to be disabled. Most notably, this removed the compiler toolchain from the disc1 images. All disabled tools are still available with the dvd1 images, though.
                                                                                • The aesni(4) driver now no longer shares a single FPU context across multiple sessions in multiple threads, addressing problems seen when employing aesni(4) for ipsec(4).
                                                                                • Support for netmap(4) by the ixgbe(4) driver has been brought into line with the netmap(4) API present in stable/10. Also, ixgbe(4) now correctly handles VFs in its netmap(4) support again instead of treating these as PFs.
                                                                                • During the creation of amd64 and i386 VM images, etcupdate(8) and mergemaster(8) databases now are bootstrapped, akin to what happens along the extraction of base.txz as part of a new installation via bsdinstall(8). This change allows for both of these tools to work out-of-box on the VM images and avoids errors seen when upgrading these images via freebsd-update(8).
                                                                                • If you are still on the stable/10 branch, you should test upgrading to 10.4, and make sure there are no problems with your workload
                                                                                • Additional testing specifically of the features that have changed since 10.4-BETA1 would also be most helpful
                                                                                • This will be the last release from the stable/10 branch
                                                                                • ***
                                                                                  OpenBSD changes of note 628

                                                                                  EuroBSDCon in two weeks. Be sure to attend early and often.

                                                                                  • Many and various documentation improvements for libcrypto. New man pages, rewrites, expanded bugs sections, and more.
                                                                                  • Only allow upward migration in vmd.
                                                                                  • There’s a README for the syspatch build system if you want to run your own.

                                                                                    • Move the kernel relinking code from /etc/rc into a seperate script usable by syspatch. Kernel patches can now be reduced to just the necessary files.
                                                                                    • Make the callers of sogetopt() responsible for allocating memory. Now allocation and free occur in the same place.
                                                                                    • Use waitpid() instead of wait() in most programs to avoid accidentally collecting the wrong child.
                                                                                    • Have cu call isatty() before making assumptions.
                                                                                    • Switch mandoc rendering of mathematical symbols and greek letters from trying to imitate the characters’ graphical shapes, which resulted in unintelligible renderings in many cases, to transliterations conveying the characters’ meanings.
                                                                                    • Update libexpat to 2.2.4. Fix copying partial UTF-8 characters.
                                                                                    • Sigh, here we go again.

                                                                                      • Work around bug in F5’s handling of the supported elliptic curves extension. RFC 4492 only defines elliptic_curves for ClientHello. However, F5 is sending it in ServerHello. We need to skip over it since our TLS extension parsing code is now more strict.
                                                                                      • After a first install, run syspatch -c to check for patches.
                                                                                      • If SMAP is present, clear PSL_AC on kernel entry and interrupt so that only the code in copy{in,out}* that need it run with it set. Panic if it’s set on entry to trap() or syscall(). Prompted by Maxime Villard’s NetBSD work. Errata.
                                                                                      • New drivers for arm: rktemp, mvpinctrl, mvmpic, mvneta, mvmdio, mvpxa, rkiic, rkpmic.
                                                                                      • No need to exec rm from within mandoc. We know there’s exactly one file and directory to remove. Similarly with running cmp.
                                                                                      • Revert to Mesa 13.0.6 to hopefully address rendering issues a handful of people have reported with xpdf/fvwm on ivy bridge with modesetting driver.
                                                                                      • Rewrite ALPN extension using CBB/CBS and the new extension framework. Rewrite SRTP extension using CBB/CBS and the new extension framework.
                                                                                      • Revisit 2q queue sizes. Limit the hot queue to 1/20th the cache size up to a max of 4096 pages. Limit the warm and cold queues to half the cache. This allows us to more effectively notice re-interest in buffers instead of losing it in a large hot queue.
                                                                                      • Add glass console support for arm64. Probably not yet for your machine, though.
                                                                                      • Replace heaps of hand-written syscall stubs in ld.so with a simpler framework.
                                                                                      • 65535 is a valid port to listen on.
                                                                                      • When xinit starts an X server that listens only on UNIX socket, prefer DISPLAY=unix:0 rather than DISPLAY=:0. This will prevent applications from ever falling back to TCP if the UNIX socket connection fails (such as when the X server crashes). Reverted.
                                                                                      • Add -z and -Z options to apmd to auto suspend or hibernate when low on battery.
                                                                                      • Remove the original (pre-IETF) chacha20-poly1305 cipher suites.
                                                                                      • Add urng(4) which supports various USB RNG devices. Instead of adding one driver per device, start bundling them into a single driver.
                                                                                      • Remove old deactivated pledge path code. A replacement mechanism is being brewed.
                                                                                      • Fix a bug from the extension parsing rewrite. Always parse ALPN even if no callback has been installed to prevent leaving unprocessed data which leads to a decode error.
                                                                                      • Clarify what is meant by syslog priorities being ordered, since the numbers and priorities are backwards.
                                                                                      • Remove a stray setlocale() from ksh, eliminating a lot of extra statically linked code.
                                                                                      • Unremove some NPN symbols from libssl because ports software thinks they should be there for reasons.
                                                                                      • Fix saved stack location after resume. Somehow clang changed it. Resume works again on i386.
                                                                                      • Improve error messages in vmd and vmctl to be more informative.
                                                                                      • Stop building the miniroot installer for OMAP3 Beagleboards. It hasn’t worked in over a year and nobody noticed.
                                                                                      • Have the callers of sosetopt() free the mbuf for symmetry.
                                                                                      • On octeon, let the kernel use the hardware FPU even if emulation is compiled in. It’s faster.
                                                                                      • Fix support for 486DX CPUs by not calling cpuid. I used to own a 486. Now I don’t.
                                                                                      • Merge some drm fixes from linux.
                                                                                      • Defer probing of floppy drives, eliminating delays during boot.
                                                                                      • Better handling of probes and beacons and timeouts and scans in wifi stack to avoid disconnects.
                                                                                      • Move mutex, condvar, and thread-specific data routes, pthread_once, and pthread_exit from libpthread to libc, along with low-level bits to support them. Let’s thread aware (but not actually threaded) code work with just libc.
                                                                                      • New POSIX xlocale implementation. Complete as long as you only use ASCII and UTF-8, as you should.
                                                                                      • Round and round it goes; when 6.2 stops, nobody knows. A peak at the future?
                                                                                      • ***
                                                                                        Screencasting with OpenBSD
                                                                                        • USB Audio
                                                                                        • Any USB microphone should appear as a new audio device. Here is the dmesg for my mic by ART:


                                                                                          uaudio0 at uhub0 port 2 configuration 1 interface 0 "M-One USB" rev 1.10/0.01 addr 2
                                                                                          uaudio0: audio rev 1.00, 8 mixer controls
                                                                                          audio1 at uaudio0

                                                                                          audioctl can read off all of the specific characterisitcs of this device


                                                                                          $ audioctl -f /dev/audio1 | grep record
                                                                                          mode=play,record
                                                                                          record.rate=48000
                                                                                          record.channels=1
                                                                                          record.precision=16
                                                                                          record.bps=2
                                                                                          record.msb=1
                                                                                          record.encoding=slinear_le
                                                                                          record.pause=0
                                                                                          record.active=0
                                                                                          record.block_size=1960
                                                                                          record.bytes=0
                                                                                          record.errors=0

                                                                                          Now test the recording from the second audio device using aucat(1)


                                                                                          aucat -f rsnd/1 -o file.wav

                                                                                          If the device also has a headset audio can be played through the same device.


                                                                                          aucat -f rsnd/1 -i file.wav

                                                                                          • Screen Capture using Xvfb
                                                                                          • The rate at which a framebuffer for your video card is a feature of the hardware and software your using, and it's often very slow. x11vnc will print an estimate of the banwidth for the system your running.


                                                                                            x11vnc
                                                                                            ...
                                                                                            09/05/2012 22:23:45 fb read rate: 7 MB/sec

                                                                                            This is about 4fps. We can do much better by using a virtual framebuffer. Here I'm setting up a new screen, setting the background color, starting cwm and an instance of xterm


                                                                                            Xvfb :1 -screen 0 720x540x16 &
                                                                                            DISPLAY=:1 xsetroot -solid steelblue &
                                                                                            DISPLAY=:1 cwm &
                                                                                            DISPLAY=:1 xterm +sb -fa Hermit -fs 14 &

                                                                                            Much better! Now we're up around 20fps.


                                                                                            x11vnc -display :1 &
                                                                                            ...
                                                                                            11/05/2012 18:04:07 fb read rate: 168 MB/sec

                                                                                            Make a connection to this virtual screen using raw encoding to eliminate time wasted on compression.


                                                                                            vncviewer localhost -encodings raw

                                                                                            A test recording with sound then looks like this


                                                                                            ffmpeg -f sndio -i snd/1 -y -f x11grab -r 12 -s 800x600 -i :1.0 -vcodec ffv1 ~/out.avi

                                                                                            Note: always stop the recording and playback using q, not Ctrl-C so that audio inputs are shut down properly.

                                                                                            • Screen Capture using Xephyr
                                                                                            • Xephyr is perhaps the easiest way to run X with a shadow framebuffer. This solution also avoids reading from the video card's RAM, so it's reasonably fast.


                                                                                              Xephyr -ac -br -noreset -screen 800x600 :1 &
                                                                                              DISPLAY=:1 xsetroot -solid steelblue &
                                                                                              DISPLAY=:1 cwm &
                                                                                              DISPLAY=:1 xrdb -load ~/.Xdefaults &
                                                                                              DISPLAY=:1 xterm +sb -fa "Hermit" -fs 14 &

                                                                                              Capture works in exactally the same way. This command tries to maintain 12fps.


                                                                                              ffmpeg -f sndio -i snd/1 -y -f x11grab -r 12 -s 800x600 -i :1.0 -vcodec ffv1 -acodec copy ~/out.avi
                                                                                              To capture keyboard and mouse input press Ctrl then Shift. This is very handy for using navigating a window manager in the nested X session.

                                                                                              • Arranging Windows
                                                                                              • I have sometimes found it helpful to launch applications and arrange them in a specific way. This will open up a web browser listing the current directory and position windows using xdotool


                                                                                                DISPLAY=:1 midori "file:///pwd" &
                                                                                                sleep 2
                                                                                                DISPLAY=:1 xdotool search --name "xterm" windowmove 0 0
                                                                                                DISPLAY=:1 xdotool search --class "midori" windowmove 400 0
                                                                                                DISPLAY=:1 xdotool search --class "midori" windowsize 400 576

                                                                                                This will position the window precisely so that it appears to be in a tmux window on the right.

                                                                                                • Audio/Video Sync
                                                                                                • If you find that the audio is way out of sync with the video, you can ajust the start using the -ss before the audio input to specify the number of seconds to delay. My final recording command line, that delays the audio by 0.5 seconds, writing 12fps


                                                                                                  ffmpeg -ss 0.5 -f sndio -i snd/1 -y -f x11grab -r 12 -s 800x600 -i :1.0 -vcodec ffv1 -acodec copy ~/out.avi

                                                                                                  • Sharing a Terminal with tmux
                                                                                                  • If you're trying to record a terminal session, tmux is able to share a session. In this way a recording of an X framebuffer can be taken without even using the screen. Start by creating the session.


                                                                                                    tmux -2 -S /tmp/tmux0

                                                                                                    Then on the remote side connect on the same socket


                                                                                                    tmux -2 -S /tmp/tmux0 attach

                                                                                                    • Taking Screenshots
                                                                                                    • Grabbing a screenshots on Xvfb server is easily accomplished with ImageMagick's import command


                                                                                                      DISPLAY=:1 import -window root screenshot.png

                                                                                                      • Audio Processing and Video Transcoding
                                                                                                      • The first step is to ensure that the clip begins and ends where you'd like it to. The following will make a copy of the recording starting at time 00:00 and ending at 09:45


                                                                                                        ffmpeg -i interactive-sql.avi \
                                                                                                        -vcodec copy -acodec copy
                                                                                                        -ss 00:00:00 -t 00:09:45
                                                                                                        interactive-sql-trimmed.avi
                                                                                                        mv interactive-sql-trimmed.avi interactive-sql.avi

                                                                                                        Setting the gain correctly is very important with an analog mixer, but if you're using a USB mic there may not be a gain option; simply record using it's built-in settings and then adjust the levels afterwards using a utility such as normalize. First extact the audio as a raw PCM file and then run normalize


                                                                                                        ffmpeg -i interactive-sql.avi -c:a copy -vn audio.wav
                                                                                                        normalize audio.wav

                                                                                                        Next merge the audio back in again


                                                                                                        ffmpeg -i interactive-sql.avi -i audio.wav \
                                                                                                        -map 0:0 -map 1:0 -c copy interactive-sql-normalized.avi

                                                                                                        The final step is to compress the screencast for distribution. Encoding to VP8/Vorbis is easy:


                                                                                                        ffmpeg -i interactive-sql-normalized.avi -c:v libvpx -b:v 1M
                                                                                                        -c:a libvorbis -q:a 6 interactive-sql.webm

                                                                                                        H.264/AAC is tricky. For most video players the color space needs to be set to yuv420p. The -movflags puts the index data at the beginning of the file to enable streaming/partial content requests over HTTP:


                                                                                                        ffmpeg -y -i interactive-sql-normalized.avi -c:v libx264 \
                                                                                                        -preset slow -crf 14 -pix_fmt yuv420p -movflags +faststart \
                                                                                                        -c:a aac -q:a 6 interactive-sql.mp4

                                                                                                        TrueOS @ Ohio Linuxfest ’17!
                                                                                                        • Dru Lavigne and Ken Moore are both giving presentations on Saturday the 30th. Sit in and hear about new developments for the Lumina and FreeNAS projects.
                                                                                                        • Ken is offering Lumina Rising: Challenging Desktop Orthodoxy at 10:15 am in Franklin A. Hear his thoughts about the ideas propelling desktop environment development and how Lumina, especially Lumina 2, is seeking to offer a new model of desktop architecture. Elements discussed include session security, application dependencies, message handling, and operating system integration.
                                                                                                        • Dru is talking about What’s New in FreeNAS 11 at 2:00 pm in Franklin D. She’ll be providing an overview of some of the new features added in FreeNAS 11.0, including:
                                                                                                          • Alert Services
                                                                                                          • Starting specific services at boot time
                                                                                                          • AD Monitoring to ensure the AD service restarts if disconnected
                                                                                                          • A preview of the new user interface
                                                                                                          • support for S3-compatible storage and the bhyve hypervisor
                                                                                                          • She’s also giving a sneak peek of FreeNAS 11.1, which has some neat features:
                                                                                                            • A complete rewrite of the Jails/Plugins system as FreeNAS moves from warden to iocage
                                                                                                            • Writing new plugins with just a few lines of code
                                                                                                            • A brand new asynchronous middleware API
                                                                                                            • Who’s going? Attending this year are:
                                                                                                              • Dru Lavigne (dlavigne): Dru leads the technical documentation team at iX, and contributes heavily to open source documentation projects like FreeBSD, FreeNAS, and TrueOS.
                                                                                                              • Ken Moore (beanpole134): Ken is the lead developer of Lumina and a core contributor to TrueOS. He also works on a number of other Qt5 projects for iXsystems.
                                                                                                              • J.T. Pennington (q5sys): Some of you may be familiar with his work on BSDNow, but J.T. also contributes to the TrueOS, Lumina, and SysAdm projects, helping out with development and general bug squashing.
                                                                                                              • ***
                                                                                                                Beastie Bits
                                                                                                                • Lumina Development Preview: Theme Engine
                                                                                                                • It's happening! Official retro Thinkpad lappy spotted in the wild
                                                                                                                • LLVM libFuzzer and SafeStack ported to NetBSD
                                                                                                                • Remaining 2017 FreeBSD Events
                                                                                                                • ***
                                                                                                                  Feedback/Questions
                                                                                                                  • Andrew - BSD Teaching Material
                                                                                                                  • Seth - Switching to Tarsnap after Crashplan becomes no more
                                                                                                                  • Thomas - Native encryption in ZFS
                                                                                                                  • Coding Cowboy - Coding Cowboy - Passwords and clipboards
                                                                                                                  • ***
                                                                                                                    1 hr 31 min
                                                                                                                  • 212: The Solaris Eclipse

                                                                                                                    We recap vBSDcon, give you the story behind a PF EN, reminisce in Solaris memories, and show you how to configure different DEs on FreeBSD.

                                                                                                                    This episode was brought to you by

                                                                                                                    Headlines
                                                                                                                    [vBSDCon]
                                                                                                                    • vBSDCon was held September 7 - 9th. We recorded this only a few days after getting home from this great event.
                                                                                                                    • Things started on Wednesday night, as attendees of the thursday developer summit arrived and broke into smallish groups for disorganized dinner and drinks.
                                                                                                                    • We then held an unofficial hacker lounge in a medium sized seating area, working and talking until we all decided that the developer summit started awfully early tomorrow.
                                                                                                                    • The developer summit started with a light breakfast and then then we dove right in
                                                                                                                    • Ed Maste started us off, and then Glen Barber gave a presentation about lessons learned from the 11.1-RELEASE cycle, and comparing it to previous releases. 11.1 was released on time, and was one of the best releases so far. The slides are linked on the DevSummit wiki page.
                                                                                                                    • The group then jumped into hackmd.io a collaborative note taking application, and listed of various works in progress and upstreaming efforts. Then we listed wants and needs for the 12.0 release.
                                                                                                                    • After lunch we broke into pairs of working groups, with additional space for smaller meetings. The first pair were, ZFS and Toolchain, followed by a break and then a discussion of IFLIB and network drivers in general. After another break, the last groups of the day met, pkgbase and secure boot.
                                                                                                                    • Then it was time for the vBSDCon reception dinner. This standing dinner was a great way to meet new people, and for attendees to mingle and socialize.
                                                                                                                    • The official hacking lounge Thursday night was busy, and included some great storytelling, along with a bunch of work getting done.
                                                                                                                    • It was very encouraging to watch a struggling new developer getting help from a seasoned veteran. Watching the new developers eyes light up as the new information filled in gaps and they now understood so much more than just a few minutes before, and they raced off to continue working, was inspirational, and reminded me why these conferences are so important.
                                                                                                                    • The hacker lounge shut down relatively early by BSD conference standards, but, the conference proper started at 8:45 sharp the next morning, so it made sense.
                                                                                                                    • Friday saw a string of good presentations, I think my favourite was Jonathan Anderson’s talk on Oblivious sandboxing. Jonathan is a very energetic speaker, and was able to keep everyone focused even during relatively complicated explanations.
                                                                                                                    • Friday night I went for dinner at ‘Big Bowl’, a stir-fry bar, with a largish group of developers and users of both FreeBSD and OpenBSD. The discussions were interesting and varied, and the food was excellent. Benedict had dinner with JT and some other folks from iXsystems.
                                                                                                                    • Friday night the hacker lounge was so large we took over a bigger room (it had better WiFi too).
                                                                                                                    • Saturday featured more great talks. The talk I was most interested in was from Eric McCorkle, who did the EFI version of my GELIBoot work. I had reviewed some of the work, but it was interesting to hear the story of how it happened, and to see the parallels with my own story.
                                                                                                                    • My favourite speaker was Paul Vixie, who gave a very interesting talk about the gets() function in libc. gets() was declared unsafe before the FreeBSD project even started. The original import of the CSRG code into FreeBSD includes the compile time, and run-time warnings against using gets(). OpenBSD removed gets() in version 5.6, in 2014. Following Paul’s presentation, various patches were raised, to either cause use of gets() to crash the program, or to remove gets() entirely, causing such programs to fail to link.
                                                                                                                    • The last talk before the closing was Benedict’s BSD Systems Management with Ansible.
                                                                                                                    • Shortly after, Allan won a MacBook Pro by correctly guessing the number of components in a jar that was standing next to the registration desk (Benedict was way off, but had a good laugh about the unlikely future Apple user).
                                                                                                                    • Saturday night ended with the Conference Social, and excellent dinner with more great conversations
                                                                                                                    • On Sunday morning, a number of us went to the Smithsonian Air and Space Museum site near the airport, and saw a Concorde, an SR-71, and the space shuttle Discovery, among many other exhibits.
                                                                                                                    • Check out the full photo album by JT, our producer.
                                                                                                                    • Thanks to all the sponsors for vBSDcon and all the organizers from Verisign, who made it such a great event.
                                                                                                                    • ***
                                                                                                                      The story behind FreeBSD-EN-17.08.pf
                                                                                                                      • After our previous deep dive on a bug in episode 209, Kristof Provost, the maintainer of pf on FreeBSD (he is going to hate me for saying that) has written the story behind a recent ERRATA notice for FreeBSD
                                                                                                                      • First things first, so I have to point out that I think Allan misremembered things. The heroic debugging story is PR 219251, which I'll try to write about later.

                                                                                                                        FreeBSD-EN-17:08.pf is an issue that affected some FreeBSD 11.x systems, where FreeBSD would panic at startup. There were no reports for CURRENT.
                                                                                                                        There's very little to go on here, but we do know the cause of the panic ("integer divide fault"), and that the current process was "pf purge". The pf purge thread is part of the pf housekeeping infrastructure. It's a housekeeping kernel thread which cleans up things like old states and expired fragments.
                                                                                                                        The lack of mention of pf functions in the backtrace is a hint unto itself. It suggests that the error is probably directly in pf_purge_thread(). It might also be in one of the static functions it calls, because compilers often just inline those so they don't generate stack frames.
                                                                                                                        Remember that the problem is an "integer divide fault". How can integer divisions be a problem? Well, you can try to divide by zero. The most obvious suspect for this is this code:
                                                                                                                        idx = pf_purge_expired_states(idx, pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10));
                                                                                                                        However, this variable is both correctly initialised (in pfattach_vnet()) and can only be modified through the DIOCSETTIMEOUT ioctl() call and that one checks for zero.
                                                                                                                        At that point I had no idea how this could happen, but because the problem did not affect CURRENT I looked at the commit history and found this commit from Luiz Otavio O Souza:
                                                                                                                        Do not run the pf purge thread while the VNET variables are not initialized, this can cause a divide by zero (if the VNET initialization takes to long to complete).
                                                                                                                        Obtained from: pfSense
                                                                                                                        Sponsored by: Rubicon Communications, LLC (Netgate)
                                                                                                                        That sounds very familiar, and indeed, applying the patch fixed the problem. Luiz explained it well: it's possible to use V_pf_default_rule.timeout before it's initialised, which caused this panic.
                                                                                                                        To me, this reaffirms the importance of writing good commit messages: because Luiz mentioned both the pf purge thread and the division by zero I was easily able to find the relevant commit. If I hadn't found it this fix would have taken a lot longer.

                                                                                                                        • Next week we’ll look at the more interesting story I was interested in, which I managed to nag Kristof into writing
                                                                                                                        • ***
                                                                                                                          The sudden death and eternal life of Solaris
                                                                                                                          • A blog post from Bryan Cantrill about the death of Solaris
                                                                                                                          • As had been rumored for a while, Oracle effectively killed Solaris. When I first saw this, I had assumed that this was merely a deep cut, but in talking to Solaris engineers still at Oracle, it is clearly much more than that. It is a cut so deep as to be fatal: the core Solaris engineering organization lost on the order of 90% of its people, including essentially all management.

                                                                                                                            Of note, among the engineers I have spoken with, I heard two things repeatedly: “this is the end” and (from those who managed to survive Friday) “I wish I had been laid off.” Gone is any of the optimism (however tepid) that I have heard over the years — and embarrassed apologies for Oracle’s behavior have been replaced with dismay about the clumsiness, ineptitude and callousness with which this final cut was handled. In particular, that employees who had given their careers to the company were told of their termination via a pre-recorded call — “robo-RIF’d” in the words of one employee — is both despicable and cowardly. To their credit, the engineers affected saw themselves as Sun to the end: they stayed to solve hard, interesting problems and out of allegiance to one another — not out of any loyalty to the broader Oracle. Oracle didn’t deserve them and now it doesn’t have them — they have been liberated, if in a depraved act of corporate violence.
                                                                                                                            Assuming that this is indeed the end of Solaris (and it certainly looks that way), it offers a time for reflection. Certainly, the demise of Solaris is at one level not surprising, but on the other hand, its very suddenness highlights the degree to which proprietary software can suffer by the vicissitudes of corporate capriciousness. Vulnerable to executive whims, shareholder demands, and a fickle public, organizations can simply change direction by fiat. And because — in the words of the late, great Roger Faulkner — “it is easier to destroy than to create,” these changes in direction can have lasting effect when they mean stopping (or even suspending!) work on a project. Indeed, any engineer in any domain with sufficient longevity will have one (or many!) stories of exciting projects being cancelled by foolhardy and myopic management. For software, though, these cancellations can be particularly gutting because (in the proprietary world, anyway) so many of the details of software are carefully hidden from the users of the product — and much of the innovation of a cancelled software project will likely die with the project, living only in the oral tradition of the engineers who knew it. Worse, in the long run — to paraphrase Keynes — proprietary software projects are all dead. However ubiquitous at their height, this lonely fate awaits all proprietary software.
                                                                                                                            There is, of course, another way — and befitting its idiosyncratic life and death, Solaris shows us this path too: software can be open source. In stark contrast to proprietary software, open source does not — cannot, even — die. Yes, it can be disused or rusty or fusty, but as long as anyone is interested in it at all, it lives and breathes. Even should the interest wane to nothing, open source software survives still: its life as machine may be suspended, but it becomes as literature, waiting to be discovered by a future generation. That is, while proprietary software can die in an instant, open source software perpetually endures by its nature — and thrives by the strength of its communities. Just as the existence of proprietary software can be surprisingly brittle, open source communities can be crazily robust: they can survive neglect, derision, dissent — even sabotage.
                                                                                                                            In this regard, I speak from experience: from when Solaris was open sourced in 2005, the OpenSolaris community survived all of these things. By the time Oracle bought Sun five years later in 2010, the community had decided that it needed true independence — illumos was born. And, it turns out, illumos was born at exactly the right moment: shortly after illumos was announced, Oracle — in what remains to me a singularly loathsome and cowardly act — silently re-proprietarized Solaris on August 13, 2010. We in illumos were indisputably on our own, and while many outsiders gave us no chance of survival, we ourselves had reason for confidence: after all, open source communities are robust because they are often united not only by circumstance, but by values, and in our case, we as a community never lost our belief in ZFS, Zones, DTrace and myriad other technologies like MDB, FMA and Crossbow.
                                                                                                                            Indeed, since 2010, illumos has thrived; illumos is not only the repository of record for technologies that have become cross-platform like OpenZFS, but we have also advanced our core technologies considerably, while still maintaining highest standards of quality. Learning some of the mistakes of OpenSolaris, we have a model that allows for downstream innovation, experimentation and differentiation. For example, Joyent’s SmartOS has always been focused on our need for a cloud hypervisor (causing us to develop big features like hardware virtualization and Linux binary compatibility), and it is now at the heart of a massive buildout for Samsung (who acquired Joyent a little over a year ago). For us at Joyent, the Solaris/illumos/SmartOS saga has been formative in that we have seen both the ill effects of proprietary software and the amazing resilience of open source software — and it very much informed our decision to open source our entire stack in 2014.
                                                                                                                            Judging merely by its tombstone, the life of Solaris can be viewed as tragic: born out of wedlock between Sun and AT&T and dying at the hands of a remorseless corporate sociopath a quarter century later. And even that may be overstating its longevity: Solaris may not have been truly born until it was made open source, and — certainly to me, anyway — it died the moment it was again made proprietary. But in that shorter life, Solaris achieved the singular: immortality for its revolutionary technologies. So while we can mourn the loss of the proprietary embodiment of Solaris (and we can certainly lament the coarse way in which its technologists were treated!), we can rejoice in the eternal life of its technologies — in illumos and beyond!

                                                                                                                            News Roundup
                                                                                                                            OpenBSD on the Lenovo Thinkpad X1 Carbon (5th Gen)
                                                                                                                            • Joshua Stein writes about his experiences running OpenBSD on the 5th generation Lenovo Thinkpad X1 Carbon:
                                                                                                                            • ThinkPads have sort of a cult following among OpenBSD developers and users because the hardware is basic and well supported, and the keyboards are great to type on. While no stranger to ThinkPads myself, most of my OpenBSD laptops in recent years have been from various vendors with brand new hardware components that OpenBSD does not yet support. As satisfying as it is to write new kernel drivers or extend existing ones to make that hardware work, it usually leaves me with a laptop that doesn't work very well for a period of months.

                                                                                                                              After exhausting efforts trying to debug the I2C touchpad interrupts on the Huawei MateBook X (and other 100-Series Intel chipset laptops), I decided to take a break and use something with better OpenBSD support out of the box: the fifth generation Lenovo ThinkPad X1 Carbon.

                                                                                                                              • Hardware
                                                                                                                              • Like most ThinkPads, the X1 Carbon is available in a myriad of different internal configurations. I went with the non-vPro Core i7-7500U (it was the same price as the Core i5 that I normally opt for), 16Gb of RAM, a 256Gb NVMe SSD, and a WQHD display.

                                                                                                                                This generation of X1 Carbon finally brings a thinner screen bezel, allowing the entire footprint of the laptop to be smaller which is welcome on something with a 14" screen. The X1 now measures 12.7" wide, 8.5" deep, and 0.6" thick, and weighs just 2.6 pounds. While not available at initial launch, Lenovo is now offering a WQHD IPS screen option giving a resolution of 2560x1440. Perhaps more importantly, this display also has much better brightness than the FHD version, something ThinkPads have always struggled with.
                                                                                                                                On the left side of the laptop are two USB-C ports, a USB-A port, a full-size HDMI port, and a port for the ethernet dongle which, despite some reviews stating otherwise, is not included with the laptop. On the right side is another USB-A port and a headphone jack, along with a fan exhaust grille. On the back is a tray for the micro-SIM card for the optional WWAN device, which also covers the Realtek microSD card reader. The tray requires a paperclip to eject which makes it inconvenient to remove, so I think this microSD card slot is designed to house a card semi-permanently as a backup disk or something.
                                                                                                                                On the bottom are the two speakers towards the front and an exhaust grille near the center. The four rubber feet are rather plastic feeling, which allows the laptop to slide around on a desk a bit too much for my liking. I wish they were a bit softer to be stickier.
                                                                                                                                Charging can be done via either of the two USB-C ports on the left, though I wish more vendors would do as Google did on the Chromebook Pixel and provide a port on both sides. This makes it much more convenient to charge when not at one's desk, rather than having to route a cable around to one specific side. The X1 Carbon includes a 65W USB-C PD with a fixed USB-C cable and removable country-specific power cable, which is not very convenient due to its large footprint. I am using an Apple 61W USB-C charger and an Anker cable which charge the X1 fine (unlike HP laptops which only work with HP USB-C chargers).
                                                                                                                                Wireless connectivity is provided by a removable Intel 8265 802.11a/b/g/n/ac WiFi and Bluetooth 4.1 card. An Intel I219-V chip provides ethernet connectivity and requires an external dongle for the physical cable connection.
                                                                                                                                The screen hinge is rather tight, making it difficult to open with one hand. The tradeoff is that the screen does not wobble in the least bit when typing.
                                                                                                                                The fan is silent at idle, and there is no coil whine even under heavy load. During a make -j4 build, the fan noise is reasonable and medium-pitched, rather than a high-pitched whine like on some laptops. The palm rest and keyboard area remain cool during high CPU utilization.
                                                                                                                                The full-sized keyboard is backlit and offers two levels of adjustment. The keys have a soft surface and a somewhat clicky feel, providing very quiet typing except for certain keys like Enter, Backspace, and Escape. The keyboard has a reported key travel of 1.5mm and there are dedicated Page Up and Page Down keys above the Left and Right arrow keys. Dedicated Home, End, Insert, and Delete keys are along the top row. The Fn key is placed to the left of Control, which some people hate (although Lenovo does provide a BIOS option to swap it), but it's in the same position on Apple keyboards so I'm used to it. However, since there are dedicated Page Up, Page Down, Home, and End keys, I don't really have a use for the Fn key anyway.

                                                                                                                                • Firmware
                                                                                                                                • The X1 Carbon has a very detailed BIOS/firmware menu which can be entered with the F1 key at boot. F12 can be used to temporarily select a different boot device.

                                                                                                                                  A neat feature of the Lenovo BIOS is that it supports showing a custom boot logo instead of the big red Lenovo logo. From Windows, download the latest BIOS Update Utility for the X1 Carbon (my model was 20HR). Run it and it'll extract everything to C:\drivers\flash(some random string). Drop a logo.gif file in that directory and run winuptp.exe. If a logo file is present, it'll ask whether to use it and then write the new BIOS to its staging area, then reboot to actually flash it.

                                                                                                                                  • OpenBSD support
                                                                                                                                  • Secure Boot has to be disabled in the BIOS menu, and the "CSM Support" option must be enabled, even when "UEFI/Legacy Boot" is left on "UEFI Only". Otherwise the screen will just go black after the OpenBSD kernel loads into memory.

                                                                                                                                    • Based on this component list, it seems like everything but the fingerprint sensor works fine on OpenBSD.
                                                                                                                                    • ***
                                                                                                                                      Configuring 5 different desktop environments on FreeBSD
                                                                                                                                      • This fairly quick tutorial over at LinuxSecrets.com is a great start if you are new to FreeBSD, especially if you are coming from Linux and miss your favourite desktop environment
                                                                                                                                      • It just goes to show how easy it is to build the desktop you want on modern FreeBSD
                                                                                                                                      • The tutorial covers: GNOME, KDE, Xfce, Mate, and Cinnamon
                                                                                                                                      • The instructions for each boil down to some variation of:
                                                                                                                                      • Install the desktop environment and a login manager if it is not included:
                                                                                                                                      • > sudo pkg install gnome3
                                                                                                                                      • Enable the login manager, and usually dbus and hald:
                                                                                                                                      • > sudo sysrc dbus_enable="YES" hald_enable="YES" gdm_enable="YES" gnome_enable="YES"?
                                                                                                                                      • If using a generic login manager, add the DE startup command to your .xinitrc:
                                                                                                                                      • > echo "exec cinnamon" > ~/.xinitrc
                                                                                                                                      • And that is about it.
                                                                                                                                      • The tutorial goes into more detail on other configuration you can do to get your desktop just the way you like it.
                                                                                                                                      • To install Lumina:
                                                                                                                                      • > sudo pkg install lumina pcbsd-utils-qt5
                                                                                                                                      • This will install Lumina and the pcbsd utilities package which includes pcdm, the login manager. In the near future we hear the login manager and some of the other utilities will be split into separate packages, making it easier to use them on vanilla FreeBSD.
                                                                                                                                      • > sudo sysrc pcdm_enable=”YES” dbus_enable="YES" hald_enable="YES"
                                                                                                                                      • Reboot, and you should be greeted with the graphical login screen
                                                                                                                                      • ***
                                                                                                                                        A return-oriented programming defense from OpenBSD
                                                                                                                                        • We talked a bit about RETGUARD last week, presenting Theo’s email announcing the new feature
                                                                                                                                        • Linux Weekly News has a nice breakdown on just how it works
                                                                                                                                        • Stack-smashing attacks have a long history; they featured, for example, as a core part of the Morris worm back in 1988. Restrictions on executing code on the stack have, to a great extent, put an end to such simple attacks, but that does not mean that stack-smashing attacks are no longer a threat. Return-oriented programming (ROP) has become a common technique for compromising systems via a stack-smashing vulnerability. There are various schemes out there for defeating ROP attacks, but a mechanism called "RETGUARD" that is being implemented in OpenBSD is notable for its relative simplicity.

                                                                                                                                          In a classic stack-smashing attack, the attack code would be written directly to the stack and executed there. Most modern systems do not allow execution of on-stack code, though, so this kind of attack will be ineffective. The stack does affect code execution, though, in that the call chain is stored there; when a function executes a "return" instruction, the address to return to is taken from the stack. An attacker who can overwrite the stack can, thus, force a function to "return" to an arbitrary location.
                                                                                                                                          That alone can be enough to carry out some types of attacks, but ROP adds another level of sophistication. A search through a body of binary code will turn up a great many short sequences of instructions ending in a return instruction. These sequences are termed "gadgets"; a large program contains enough gadgets to carry out almost any desired task — if they can be strung together into a chain. ROP works by locating these gadgets, then building a series of stack frames so that each gadget "returns" to the next.
                                                                                                                                          There is, of course, a significant limitation here: a ROP chain made up of exclusively polymorphic gadgets will still work, since those gadgets were not (intentionally) created by the compiler and do not contain the return-address-mangling code. De Raadt acknowledged this limitation, but said: "we believe once standard-RET is solved those concerns become easier to address separately in the future. In any case a substantial reduction of gadgets is powerful".
                                                                                                                                          Using the compiler to insert the hardening code greatly eases the task of applying RETGUARD to both the OpenBSD kernel and its user-space code. At least, that is true for code written in a high-level language. Any code written in assembly must be changed by hand, though, which is a fair amount of work. De Raadt and company have done that work; he reports that: "We are at the point where userland and base are fully working without regressions, and the remaining impacts are in a few larger ports which directly access the return address (for a variety of reasons)". It can be expected that, once these final issues are dealt with, OpenBSD will ship with this hardening enabled.

                                                                                                                                          • The article wonders about applying the same to Linux, but notes it would be difficult because the Linux kernel cannot currently be compiled using LLVM
                                                                                                                                          • If any benchmarks have been run to determine the cost of using RETGUARD, they have not been publicly posted. The extra code will make the kernel a little bigger, and the extra overhead on every function is likely to add up in the end. But if this technique can make the kernel that much harder to exploit, it may well justify the extra execution overhead that it brings with it. All that's needed is somebody to actually do the work and try it out.

                                                                                                                                            Videos from BSDCan have started to appear!
                                                                                                                                            • Henning Brauer: tcp synfloods - BSDCan 2017
                                                                                                                                            • Benno Rice: The Trouble with FreeBSD - BSDCan 2017
                                                                                                                                            • Li-Wen Hsu: Continuous Integration of The FreeBSD Project - BSDCan 2017
                                                                                                                                            • Andrew Turner: GENERIC ARM - BSDCan 2017
                                                                                                                                            • Bjoern A. Zeeb: From the outside - BSDCan 2017
                                                                                                                                            • Rodney W. Grimes: FreeBSD as a Service - BSDCan 2017
                                                                                                                                            • Reyk Floeter: The OpenBSD virtual machine daemon - BSDCan 2017
                                                                                                                                            • Brian Kidney: The Realities of DTrace on FreeBSD - BSDCan 2017
                                                                                                                                            • The rest will continue to trickle out, likely not until after EuroBSDCon
                                                                                                                                            • ***
                                                                                                                                              Beastie Bits
                                                                                                                                              • Oracle has killed sun
                                                                                                                                              • Configure Thunderbird to send patch friendly
                                                                                                                                              • FreeBSD 10.4-BETA4 Available
                                                                                                                                              • iXsystems looking to hire kernel and zfs developers (especially Sun/Oracle Refugees)
                                                                                                                                              • Speaking of job postings, UnitedBSD.com has few job postings related to BSD
                                                                                                                                              • Call for papers
                                                                                                                                                • USENIX FAST ‘18 - February 12-15, 2018, Due: September 28 2017
                                                                                                                                                • Scale 16x - March 8-11, 2018, Due: October 31, 2017
                                                                                                                                                • FOSDEM ‘18 - February 3-4, 2018, Due: November 3 2017
                                                                                                                                                • Feedback/Questions
                                                                                                                                                  • Jason asks about cheap router hardware
                                                                                                                                                  • Prashant asks about latest kernels with freebsd-update
                                                                                                                                                  • Matt wants know about VM Performance & CPU Steal Time
                                                                                                                                                  • John has config questions regarding Dell precision 7720, FreeBSD, NVME, and ZFS
                                                                                                                                                  • ***
                                                                                                                                                    1 hr 41 min
                                                                                                                                                  • 211: It's HAMMER2 Time!

                                                                                                                                                    We explore whether a BSD can replicate Cisco router performance; RETGUARD, OpenBSDs new exploit mitigation technology, Dragonfly’s HAMMER2 filesystem implementation & more!

                                                                                                                                                    This episode was brought to you by

                                                                                                                                                    Headlines
                                                                                                                                                    Can a BSD system replicate the performance of a Cisco router?
                                                                                                                                                    • Short Answer: No, but it might be good enough for what you need
                                                                                                                                                    • Traditionally routers were built with a tightly coupled data plane and control plane. Back in the 80s and 90s the data plane was running in software on commodity CPUs with proprietary software. As the needs and desires for more speeds and feeds grew, the data plane had to be implemented in ASICs and FPGAs with custom memories and TCAMs. While these were still programmable in a sense, they certainly weren't programmable by anyone but a small handful of people who developed the hardware platform. The data plane was often layered, where features not handled by the hardware data plane were punted to a software only data path running on a more general CPU. The performance difference between the two were typically an order or two of magnitude. source

                                                                                                                                                      Except for encryption (e.g. IPsec) or IDS/IPS, the true measure of router performance is packets forwarded per unit time. This is normally expressed as Packets-per-second, or PPS. To 'line-rate' forward on a 1gbps interface, you must be able to forward packets at 1.488 million pps (Mpps). To forward at "line-rate" between 10Gbps interfaces, you must be able to forward at 14.88Mpps.

                                                                                                                                                      Even on large hardware, kernel-forwarding is limited to speeds that top out below 2Mpps. George Neville-Neil and I did a couple papers on this back in 2014/2015. You can read the papers for the results.

                                                                                                                                                      However, once you export the code from the kernel, things start to improve. There are a few open source code bases that show the potential of kernel-bypass networking for building a software-based router. The first of these is netmap-fwd which is the FreeBSD ip_forward() code hosted on top of netmap, a kernel-bypass technology present in FreeBSD (and available for linux). Full-disclosure, netmap-fwd was done at my company, Netgate. netmap-fwd will l3 forward around 5 Mpps per core. slides

                                                                                                                                                      The first of these is netmap-fwd which is the FreeBSD ip_forward() code hosted on top of netmap, a kernel-bypass technology present in FreeBSD (and available for linux). Full-disclosure, netmap-fwd was done at my company, Netgate. (And by "my company" I mean that I co-own it with my spouse.). netmap-fwd will l3 forward around 5 Mpps per core. slides

                                                                                                                                                      Nanako Momiyama of the Keio Univ Tokuda Lab presented on IP Forwarding Fastpath at BSDCan this past May. She got about 5.6Mpps (roughly 10% faster than netmap-fwd) using a similar approach where the ip_foward() function was rewritten as a module for VALE (the netmap-based in-kernel switch). Slides from her previous talk at EuroBSDCon 2016 are available. (Speed at the time was 2.8Mpps.). Also a paper from that effort, if you want to read it. Of note: They were showing around 1.6Mpps even after replacing the in-kernel routing lookup algorithm with DXR. (DXR was written by Luigi Rizzo, who is also the primary author of netmap.)

                                                                                                                                                      Not too long after netmap-fwd was open sourced, Ghandi announced packet-journey, an application based on drivers and libraries and from DPDK. Packet-journey is also an L3 router. The GitHub page for packet-journey lists performance as 21,773.47 mbps (so 21.77Gbps) for 64-byte UDP frames with 50 ACLs and 500,000 routes. Since they're using 64-byte frames, this translates to roughly 32.4Mpps.

                                                                                                                                                      Finally, there is recent work in FreeBSD (which is part of 11.1-RELEASE) that gets performance up to 2x the level of netmap-fwd or the work by Nanako Momiyama. 10 million PPS: Here is a decent introduction.

                                                                                                                                                      • But of course, even as FreeBSD gets up to being able to do 10gbps at line-rate, 40 and 100 gigabits are not uncommon now
                                                                                                                                                      • Even with the fastest modern CPUs, this is very little time to do any kind of meaningful packet processing. At 10Gbps, your total budget per packet, to receive (Rx) the packet, process the packet, and transmit (Tx) the packet is 67.2 ns. Complicating the task is the simple fact that main memory (RAM) is 70 ns away. The simple conclusion here is that, even at 10Gbps, if you have to hit RAM, you can't generate the PPS required for line-rate forwarding.

                                                                                                                                                        • There is some detail about design tradeoffs in the Ryzen architecture and how that might impact using those machines as routers
                                                                                                                                                        • Anyway... those are all interesting, but the natural winner here is FD.io's Vector Packet Processing (VPP). Read this

                                                                                                                                                          VPP is an efficient, flexible open source data plane. It consists of a set of forwarding nodes arranged in a directed graph and a supporting framework. The framework has all the basic data structures, timers, drivers (and interfaces to both DPDK and netmap), a scheduler which allocates the CPU time between the graph nodes, performance and debugging tools, like counters and built-in packet trace. The latter allows you to capture the paths taken by the packets within the graph with high timestamp granularity, giving full insight into the processing on a per-packet level.
                                                                                                                                                          The net result here is that Cisco (again, Cisco) has shown the ability to route packets at 1 Tb/s using VPP on a four socket Purley system

                                                                                                                                                          • There is also much discussion of the future of pfSense, as they transition to using VPP
                                                                                                                                                          • This is a very lengthy write up which deserves a full read, plus there are some comments from other people
                                                                                                                                                          • ***
                                                                                                                                                            RETGUARD, the OpenBSD next level in exploit mitigation, is about to debut

                                                                                                                                                            This year I went to BSDCAN in Ottawa. I spent much of it in the 'hallway track', and had an extended conversation with various people regarding our existing security mitigations and hopes for new ones in the future. I spoke a lot with Todd Mortimer. Apparently I told him that I felt return-address protection was impossible, so a few weeks later he sent a clang diff to address that issue...

                                                                                                                                                            The first diff is for amd64 and i386 only -- in theory RISC architectures can follow this approach soon.
                                                                                                                                                            The mechanism is like a userland 'stackghost' in the function prologue and epilogue. The preamble XOR's the return address at top of stack with the stack pointer value itself. This perturbs by introducing bits from ASLR. The function epilogue undoes the transform immediately before the RET instruction. ROP attack methods are impacted because existing gadgets are transformed to consist of " RET". That pivots the return sequence off the ROP chain in a highly unpredictable and inconvenient fashion.
                                                                                                                                                            The compiler diff handles this for all the C code, but the assembly functions have to be done by hand. I did this work first for amd64, and more recently for i386. I've fixed most of the functions and only a handful of complex ones remain.
                                                                                                                                                            For those who know about polymorphism and pop/jmp or JOP, we believe once standard-RET is solved those concerns become easier to address seperately in the future. In any case a substantial reduction of gadgets is powerful.
                                                                                                                                                            For those worried about introducing worse polymorphism with these "xor; ret" epilogues themselves, the nested gadgets for 64bit and 32bit variations are +1 "xor %esp,(%rsp); ret", +2 "and $0x24,%al; ret" and +3 "and $0xc3,%al; int3". Not bad.
                                                                                                                                                            Over the last two weeks, we have received help and advice to ensure debuggers (gdb, egdb, ddb, lldb) can still handle these transformed callframes. Also in the kernel, we discovered we must use a smaller XOR, because otherwise userland addresses are generated, and cannot rely on SMEP as it is really new feature of the architecture. There were also issues with pthreads and dlsym, which leads to a series of uplifts around __builtin_return_address and DWARF CFI.
                                                                                                                                                            Application of this diff doesn't require anything special, a system can simply be built twice. Or shortcut by building & installing gnu/usr.bin/clang first, then a full build.
                                                                                                                                                            We are at the point where userland and base are fully working without regressions, and the remaining impacts are in a few larger ports which directly access the return address (for a variety of reasons).
                                                                                                                                                            So work needs to continue with handling the RET-addr swizzle in those ports, and then we can move forward.

                                                                                                                                                            • You can find the full message with the diff here
                                                                                                                                                            • ***
                                                                                                                                                              Interview - Ed Maste, Charlie & Siva - @ed_maste, @yzgyyang & @svmhdvn
                                                                                                                                                              • Co-op Students for the FreeBSD Foundation
                                                                                                                                                              • ***
                                                                                                                                                                News Roundup
                                                                                                                                                                Next DFly release will have an initial HAMMER2 implementation

                                                                                                                                                                The next DragonFly release (probably in September some time) will have an initial HAMMER2 implementation. It WILL be considered experimental and won't be an installer option yet. This initial release will only have single-image support operational plus basic features. It will have live dedup (for cp's), compression, fast recovery, snapshot, and boot support out of the gate.

                                                                                                                                                                This first H2 release will not have clustering or multi-volume support, so don't expect those features to work. I may be able to get bulk dedup and basic mirroring operational by release time, but it won't be very efficient. Also, right now, sync operations are fairly expensive and will stall modifying operations to some degree during the flush, and there is no reblocking (yet). The allocator has a 16KB granularity (on HAMMER1 it was 2MB), so for testing purposes it will still work fairly well even without reblocking.
                                                                                                                                                                The design is in a good place. I'm quite happy with how the physical layout turned out. Allocations down to 1KB are supported. The freemap has a 16KB granularity with a linear counter (one counter per 512KB) for packing smaller allocations. INodes are 1KB and can directly embed 512 bytes of file data for files <= 512 bytes, or have four top-level blockrefs for files > 512 bytes. The freemap is also zoned by type for I/O locality.
                                                                                                                                                                The blockrefs are 'fat' at 128 bytes but enormously powerful. That will allow us to ultimately support up to a 512-bit crypto hash and blind dedup using said hash. Not on release, but that's the plan.
                                                                                                                                                                I came up with an excellent solution for directory entries. The 1KB allocation granularity was a bit high but I didn't want to reduce it. However, because blockrefs are now 128 byte entities, and directory entries are hashed just like in H1, I was able to code them such that a directory entry is embedded in the blockref itself and does not require a separate data reference or allocation beyond that. Filenames up to 64 bytes long can be accomodated in the blockref using the check-code area of the blockref. Longer filenames will use an additional data reference hanging off the blockref to accomodate up to 255 char filenames. Of course, a minimum of 1KB will have to be allocated in that case, but filenames are <= 64 bytes in the vast majority of use cases so it just isn't an issue.
                                                                                                                                                                This gives directory entries optimal packing and indexing and is a huge win in terms of performance since blockrefs are arrayed in 16KB and 64KB blocks. In addition, since inodes can embed up to four blockrefs, the directory entries for 'small' directories with <= 4 entries ('.' and '..' don't count) can actually be embedded in the directory inode itself.
                                                                                                                                                                So, generally speaking, the physical layout is in a very happy place. The basics are solid on my test boxes so it's now a matter of implementing as many of the more sophisticated features as I can before release, and continuing to work on the rest after the release.

                                                                                                                                                                Removing Some Code

                                                                                                                                                                This is another update on our effort to re-license the OpenSSL software. Our previous post in March was about the launch of our effort to reach all contributors, with the hope that they would support this change.

                                                                                                                                                                So far, about 40% of the people have responded. For a project that is as old as OpenSSL (including its predecessor, SSLeay, it’s around 20 years) that’s not bad. We’ll be continuing our efforts over the next couple of months to contact everyone.
                                                                                                                                                                Of those people responding, the vast majority have been in favor of the license change – less then a dozen objected. This post describes what we’re doing about those and how we came to our conclusions. The goal is to be very transparent and open with our processes.
                                                                                                                                                                First, we want to mention that we respect their decision. While it is inconvenient to us, we acknowledge their rights to keep their code under the terms that they originally agreed to. We are asking permission to change the license terms, and it is fully within their rights to say no.
                                                                                                                                                                The license website is driven by scripts that are freely available in the license section of our tools repository on GitHub. When we started, we imported every single git commit, looked for anything that resembled an email address, and created tables for each commit, each user we found, and a log that connects users to commits. This did find false positives: sometimes email Message-ID’s showed up, and there were often mentions of folks just as a passing side-comment, or because they were in the context diff. (That script is also in the tools repository, of course.)
                                                                                                                                                                The user table also has columns to record approval or rejection of the license change, and comments. Most of the comments have been supportive, and (a bit surprisingly) only one or two were obscene.
                                                                                                                                                                The whattoremove script finds the users who refused, and all commits they were named in. We then examined each commit – there were 86 in all – and filtered out those that were cherry-picks to other releases. We are planning on only changing the license for the master branch, so the other releases branches aren’t applicable. There were also some obvious false positives. At the end of this step, we had 43 commits to review.
                                                                                                                                                                We then re-read every single commit, looking for what we could safely ignore as not relevant. We found the following:
                                                                                                                                                                Nine of them showed up only because the person was mentioned in a comment.
                                                                                                                                                                Sixteen of them were changes to the OpenBSD configuration data. The OpenSSL team had completely rewritten this, refactoring all BSD configurations into a common hierarchy, and the config stuff changed a great deal for 1.1.0.
                                                                                                                                                                Seven were not copyrightable as because they were minimal changes (e.g., fixing a typo in a comment).
                                                                                                                                                                One was a false positive.
                                                                                                                                                                This left us with 10 commits. Two of them them were about the CryptoDev engine. We are removing that engine, as can be seen in this PR, but we expect to have a replacement soon (for at least Linux and FreeBSD). As for the other commits, we are removing that code, as can be seen in this first PR. and this second PR. Fortunately, none of them are particularly complex.
                                                                                                                                                                Copyright, however, is a complex thing – at times it makes debugging look simple. If there is only one way to write something, then that content isn’t copyrightable. If the work is very small, such as a one-line patch, then it isn’t copyrightable. We aren’t lawyers, and have no wish to become such, but those viewpoints are valid. It is not official legal advice, however.
                                                                                                                                                                For the next step, we hope that we will be able to “put back” the code that we removed. We are looking to the community for help, and encourage you to create the appropriate GitHub pull requests. We ask the community to look at that second PR and provide fixes.
                                                                                                                                                                And finally, we ask everyone to look at the list of authors and see if their name, or the name of anyone they know, is listed. If so please email us.

                                                                                                                                                                deraadt@ moves us to 6.2-beta!

                                                                                                                                                                Theo has just committed the diff that marks the end of the development cycle and the beginning of the testing phase for the upcoming 6.2 release:

                                                                                                                                                                `

                                                                                                                                                                CVSROOT: /cvs

                                                                                                                                                                Module name: src

                                                                                                                                                                Changes by: [email protected] 2017/08/20 10:56:43

                                                                                                                                                                Modified files:

                                                                                                                                                                etc/root : root.mail

                                                                                                                                                                share/mk : sys.mk

                                                                                                                                                                sys/arch/macppc/stand/tbxidata: bsd.tbxi

                                                                                                                                                                sys/conf : newvers.sh

                                                                                                                                                                sys/sys : param.h

                                                                                                                                                                Log message:

                                                                                                                                                                crank to 6.2-beta

                                                                                                                                                                `

                                                                                                                                                                You all know what this means: get to testing! Find whatever hardware you have and install the latest snapshots, stress the upgrade procedure, play your favorite games, build your own code - whatever you use OpenBSD for, try it in the new snaps and report any problems you find. Your testing efforts will help make sure 6.2 is another great release!

                                                                                                                                                                Beastie Bits
                                                                                                                                                                • 64 Hijacked ARMs
                                                                                                                                                                • Smartisan Makes Another Iridium Donation to the OpenBSD Foundation
                                                                                                                                                                • Andrey A. Chernov (ache), long-time FreeBSD core team member and dev, has passed away
                                                                                                                                                                • OpenBSD hacker Mickey Shalayeff has passed away
                                                                                                                                                                • FreeBSD 10.4-BETA1 Available
                                                                                                                                                                • vmadm in action, from getting a dataset to running a jail w/ vnet networking in just a few commands
                                                                                                                                                                • Interview with Patrick Wildt (from t2k17 OpenBSD Hackathon)
                                                                                                                                                                • ***
                                                                                                                                                                  Feedback/Questions
                                                                                                                                                                  • Seth - Switching to tarsnap
                                                                                                                                                                  • Johnny - memcmp
                                                                                                                                                                  • Thomas - Drives and NAS
                                                                                                                                                                  • Ben - Nvidia
                                                                                                                                                                  • David - ZFS performance variations over nfs
                                                                                                                                                                  • ***
                                                                                                                                                                    2 hr 3 min
                                                                                                                                                                  • 210: Your questions, part I

                                                                                                                                                                    In this episode, we take a look at the reimplementation of NetBSD using a Microkernel, check out what makes DHCP faster, and see what high-process count support for DragonflyBSD has to offer, and we answer the questions you’ve always wanted to ask us.

                                                                                                                                                                    This episode was brought to you by

                                                                                                                                                                    Headlines
                                                                                                                                                                    A Reimplementation Of Netbsd Using a Microkernel
                                                                                                                                                                    • Minix author Andy Tanenbaum writes in Part 1 of a-reimplementation-of-netbsd-using-a-microkernel
                                                                                                                                                                    • Based on the MINIX 3 microkernel, we have constructed a system that to the user looks a great deal like NetBSD. It uses pkgsrc, NetBSD headers and libraries, and passes over 80% of the KYUA tests). However, inside, the system is completely different. At the bottom is a small (about 13,000 lines of code) microkernel that handles interrupts, message passing, low-level scheduling, and hardware related details. Nearly all of the actual operating system, including memory management, the file system(s), paging, and all the device drivers run as user-mode processes protected by the MMU. As a consequence, failures or security issues in one component cannot spread to other ones. In some cases a failed component can be replaced automatically and on the fly, while the system is running, and without user processes noticing it. The talk will discuss the history, goals, technology, and status of the project.

                                                                                                                                                                      Research at the Vrije Universiteit has resulted in a reimplementation of NetBSD using a microkernel instead of the traditional monolithic kernel. To the user, the system looks a great deal like NetBSD (it passes over 80% of the KYUA tests). However, inside, the system is completely different. At the bottom is a small (about 13,000 lines of code) microkernel that handles interrupts, message passing, low-level scheduling, and hardware related details. Nearly all of the actual operating system, including memory management, the file system(s), paging, and all the device drivers run as user-mode processes protected by the MMU. As a consequence, failures or security issues in one component cannot spread to other ones. In some cases a failed component can be replaced automatically and on the fly, while the system is running.
                                                                                                                                                                      The latest work has been adding live update, making it possible to upgrade to a new version of the operating system WITHOUT a reboot and without running processes even noticing. No other operating system can do this.
                                                                                                                                                                      The system is built on MINIX 3, a derivative of the original MINIX system, which was intended for education. However, after the original author, Andrew Tanenbaum, received a 2 million euro grant from the Royal Netherlands Academy of Arts and Sciences and a 2.5 million euro grant from the European Research Council, the focus changed to building a highly reliable, secure, fault tolerant operating system, with an emphasis on embedded systems. The code is open source and can be downloaded from www.minix3.org. It runs on the x86 and ARM Cortex V8 (e.g., BeagleBones). Since 2007, the Website has been visited over 3 million times and the bootable image file has been downloaded over 600,000 times. The talk will discuss the history, goals, technology, and status of the project.

                                                                                                                                                                      • Part 2 is also available.
                                                                                                                                                                      • ***
                                                                                                                                                                        Rapid DHCP: Or, how do Macs get on the network so fast?
                                                                                                                                                                        • One of life's minor annoyances is having to wait on my devices to connect to the network after I wake them from sleep. All too often, I'll open the lid on my EeePC netbook, enter a web address, and get the dreaded "This webpage is not available" message because the machine is still working on connecting to my Wi-Fi network. On some occasions, I have to twiddle my thumbs for as long as 10-15 seconds before the network is ready to be used. The frustrating thing is that I know it doesn't have to be this way. I know this because I have a Mac. When I open the lid of my MacBook Pro, it connects to the network nearly instantaneously. In fact, no matter how fast I am, the network comes up before I can even try to load a web page. My curiosity got the better of me, and I set out to investigate how Macs are able to connect to the network so quickly, and how the network connect time in other operating systems could be improved.
                                                                                                                                                                        • I figure there are three main categories of time-consuming activities that occur during network initialization:

                                                                                                                                                                          Link establishment. This is the activity of establishing communication with the network's link layer. In the case of Wi-Fi, the radio must be powered on, the access point detected, and the optional encryption layer (e.g. WPA) established. After link establishment, the device is able to send and receive Ethernet frames on the network.
                                                                                                                                                                          Dynamic Host Configuration Protocol (DHCP). Through DHCP handshaking, the device negotiates an IP address for its use on the local IP network. A DHCP server is responsible for managing the IP addresses available for use on the network.
                                                                                                                                                                          Miscellaneous overhead. The operating system may perform any number of mundane tasks during the process of network initialization, including running scripts, looking up preconfigured network settings in a local database, launching programs, etc.
                                                                                                                                                                          My investigation thus far is primarily concerned with the DHCP phase, although the other two categories would be interesting to study in the future. I set up a packet capture environment with a spare wireless access point, and observed the network activity of a number of devices as they initialized their network connection. For a worst-case scenario, let's look at the network activity captured while an Android tablet is connecting:
                                                                                                                                                                          This tablet, presumably in the interest of "optimization", is initially skipping the DHCP discovery phase and immediately requesting its previous IP address. The only problem is this is a different network, so the DHCP server ignores these requests. After about 4.5 seconds, the tablet stubbornly tries again to request its old IP address. After another 4.5 seconds, it resigns itself to starting from scratch, and performs the DHCP discovery needed to obtain an IP address on the new network.
                                                                                                                                                                          In all fairness, this delay wouldn't be so bad if the device was connecting to the same network as it was previously using. However, notice that the tablet waits a full 1.13 seconds after link establishment to even think about starting the DHCP process. Engineering snappiness usually means finding lots of small opportunities to save a few milliseconds here and there, and someone definitely dropped the ball here.
                                                                                                                                                                          In contrast, let's look at the packet dump from the machine with the lightning-fast network initialization, and see if we can uncover the magic that is happening under the hood:
                                                                                                                                                                          The key to understanding the magic is the first three unicast ARP requests. It looks like Mac OS remembers certain information about not only the last connected network, but the last several networks. In particular, it must at least persist the following tuple for each of these networks:
                                                                                                                                                                          > 1. The Ethernet address of the DHCP server
                                                                                                                                                                          > 2. The IP address of the DHCP server
                                                                                                                                                                          > 3. Its own IP address, as assigned by the DHCP server
                                                                                                                                                                          During network initialization, the Mac transmits carefully crafted unicast ARP requests with this stored information. For each network in its memory, it attempts to send a request to the specific Ethernet address of the DHCP server for that network, in which it asks about the server's IP address, and requests that the server reply to the IP address which the Mac was formerly using on that network. Unless network hosts have been radically shuffled around, at most only one of these ARP requests will result in a response—the request corresponding to the current network, if the current network happens to be one of the remembered networks.
                                                                                                                                                                          This network recognition technique allows the Mac to very rapidly discover if it is connected to a known network. If the network is recognized (and presumably if the Mac knows that the DHCP lease is still active), it immediately and presumptuously configures its IP interface with the address it knows is good for this network. (Well, it does perform a self-ARP for good measure, but doesn't seem to wait more than 13ms for a response.) The DHCP handshaking process begins in the background by sending a DHCP request for its assumed IP address, but the network interface is available for use during the handshaking process. If the network was not recognized, I assume the Mac would know to begin the DHCP discovery phase, instead of sending blind requests for a former IP address as the Galaxy Tab does.
                                                                                                                                                                          The Mac's rapid network initialization can be credited to more than just the network recognition scheme. Judging by the use of ARP (which can be problematic to deal with in user-space) and the unusually regular transmission intervals (a reliable 1.0ms delay between each packet sent), I'm guessing that the Mac's DHCP client system is entirely implemented as tight kernel-mode code. The Mac began the IP interface initialization process a mere 10ms after link establishment, which is far faster than any other device I tested. Android devices such as the Galaxy Tab rely on the user-mode dhclient system (part of the dhcpcd package) dhcpcd program, which no doubt brings a lot of additional overhead such as loading the program, context switching, and perhaps even running scripts.
                                                                                                                                                                          The next step for some daring kernel hacker is to implement a similarly aggressive DHCP client system in the Linux kernel, so that I can enjoy fast sign-on speeds on my Android tablet, Android phone, and Ubuntu netbook. There already exists a minimal DHCP client implementation in the Linux kernel, but it lacks certain features such as configuring the DNS nameservers. Perhaps it wouldn't be too much work to extend this code to support network recognition and interface with a user-mode daemon to handle such auxillary configuration information received via DHCP. If I ever get a few spare cycles, maybe I'll even take a stab at it.

                                                                                                                                                                          • You can also find other ways of optimizing the dhclient program and how it works in the dhclient tutorial on Calomel.org.
                                                                                                                                                                          • ***
                                                                                                                                                                            BSDCam Trip Report

                                                                                                                                                                            Over the decades, FreeBSD development and coordination has shifted from being purely on-line to involving more and more in-person coordination and cooperation. The FreeBSD Foundation sponsors a devsummit right before BSDCan, EuroBSDCon, and AsiaBSDCon, so that developers traveling to the con can leverage their airfare and hammer out some problems. Yes, the Internet is great for coordination, but nothing beats a group of developers spending ten minutes together to sketch on a whiteboard and figuring out exactly how to make something bulletproof.

                                                                                                                                                                            In addition to the coordination efforts, though, conference devsummits are hierarchical. There’s a rigid schedule, with topics decided in advance. Someone leads the session. Sessions can be highly informative, passionate arguments, or anything in between.
                                                                                                                                                                            BSDCam is… a little different. It’s an invaluable part of the FreeBSD ecosystem. However, it’s something that I wouldn’t normally attend.
                                                                                                                                                                            But right now, is not normal. I’m writing a new edition of Absolute FreeBSD. To my astonishment, people have come to rely on this book when planning their deployments and operations. While I find this satisfying, it also increases the pressure on me to get things correct. When I wrote my first FreeBSD book back in 2000, a dozen mailing lists provided authoritative information on FreeBSD development. One person could read every one of those lists. Today, that’s not possible—and the mailing lists are only one narrow aspect of the FreeBSD social system.
                                                                                                                                                                            Don’t get me wrong—it’s pretty easy to find out what people are doing and how the system works. But it’s not that easy to find out what people will be doing and how the system will work. If this book is going to be future-proof, I needed to leave my cozy nest and venture into the wilds of Cambridge, England. Sadly, the BSDCam chair agreed with my logic, so I boarded an aluminum deathtrap—sorry, a “commercial airliner”—and found myself hurtled from Detroit to Heathrow.
                                                                                                                                                                            And one Wednesday morning, I made it to the William Gates building of Cambridge University, consciousness nailed to my body by a thankfully infinite stream of proper British tea.
                                                                                                                                                                            BSDCam attendance is invitation only, and the facilities can only handle fifty folks or so. You need to be actively working on FreeBSD to wrangle an invite. Developers attend from all over the world. Yet, there’s no agenda. Robert Watson is the chair, but he doesn’t decide on the conference topics. He goes around the room and asks everyone to introduce themselves, say what they’re working on, and declare what they want to discuss during the conference. The topics of interest are tallied. The most popular topics get assigned time slots and one of the two big rooms. Folks interested in less popular topics are invited to claim one of the small breakout rooms.
                                                                                                                                                                            Then the real fun begins. I started by eavesdropping in the virtualization workshop. For two hours, people discussed FreeBSD’s virtualization needs, strengths, and weaknesses. What needs help? What should this interface look like? What compatibility is important, and what isn’t? By the end of the session, the couple dozen people had developed a reasonable consensus and, most importantly, some folks had added items to their to-do lists.
                                                                                                                                                                            Repeat for a dozen more topics. I got a good grip on what’s really happening with security mitigation techniques, FreeBSD’s cloud support, TCP/IP improvements, advances in teaching FreeBSD, and more. A BSDCan devsummit presentation on packaging the base system is informative, but eavesdropping on two dozen highly educated engineers arguing about how to nail down the final tidbits needed to make that a real thing is far more educational.
                                                                                                                                                                            To my surprise, I was able to provide useful feedback for some sessions. I speak at a lot of events outside of the FreeBSD world, and was able to share much of what I hear at Linux conferences. A tool that works well for an experienced developer doesn’t necessarily work well for everyone.
                                                                                                                                                                            Every year, I leave BSDCan tired. I left BSDCam entirely exhausted. These intense, focused discussions stretched my brain.
                                                                                                                                                                            But, I have a really good idea where key parts of FreeBSD development are actually headed. This should help future-proof the new Absolute FreeBSD, as much as any computer book can be future-proof.
                                                                                                                                                                            Plus, BSDCam throws the most glorious conference dinner I’ve ever seen.
                                                                                                                                                                            I want to thank Robert Watson for his kind invitation, and the FreeBSD Foundation for helping defray the cost of this trip

                                                                                                                                                                            Interview - The BSDNow Crew
                                                                                                                                                                            • As a kid, what did you dream of to become as an adult?
                                                                                                                                                                            • JT: An Astronaut

                                                                                                                                                                              BR: I wanted to be a private detective, because of all the crime novels that I read back
                                                                                                                                                                              then. I didn’t get far with it. However, I think the structured analysis skills (who did what, when, and such) help me in debugging and sysadmin work.
                                                                                                                                                                              AJ: Didn’t think about it much

                                                                                                                                                                              • How do you manage to stay organized day to day with so much things you're actively doing each day? (Day job, wife/girlfriend, conferences, hobbies, friends, etc.)
                                                                                                                                                                              • JT: Who said I was organized?

                                                                                                                                                                                BR: A lot of stuff in my calendar as reminders, open browser tabs as “to read later” list. A few things like task switching when getting stuck helps. Also, focus on a single goal for the day, even though there will be distractions. Slowly, but steadily chip away at the things you’re working on. Rather than to procrastinate and put things back to review later, get started early with easy things for a big task and then tackle the hard part. Often, things look totally chaotic and unmanageable, until you start working on them.
                                                                                                                                                                                AJ: I barely manage. Lots of Google Calendar reminders, and the entire wall of my office is covered in whiteboard sheet todo lists. I use pinboard.in to deal with finding and organizing bookmarks. Write things down, don’t trust your memory.

                                                                                                                                                                                • What hobbies outside of IT do you have?
                                                                                                                                                                                • JT: I love photography, but I do that Professional part time, so I’m not sure if that counts as a hobby anymore. I guess it’d have to be working in the garage on my cars.

                                                                                                                                                                                  BR: I do Tai Chi to relax once a week in a group, but can also do it alone, pretty much everywhere. Way too much Youtube watching and browsing the web. I did play some games before studying at the university and I’m still proud that I could control it to the bare minimum not to impact my studies. A few “lapses” from time to time, revisiting the old classics since the newer stuff won’t run on my machines anyway. Holiday time is pretty much spent for BSD conferences and events, this is where I can relax and talk with like-minded people from around the world, which is fascinating. Plus, it gets me to various places and countries I never would have dared to visit on my own.
                                                                                                                                                                                  AJ: I play a few video games, and I like to ski, although I don’t go very often as most of my vacation time is spent hanging out with my BSD friends at various conferences

                                                                                                                                                                                  • How do you relax?
                                                                                                                                                                                  • JT: What is this word ‘relax’ and what does it mean?

                                                                                                                                                                                    BR: My Tai Chi plays a big part in it I guess. I really calms you and the constant stream of thoughts for a while. It also gives you better clarity of what’s important in life. Watching movies, sleeping long.
                                                                                                                                                                                    AJ: Usually watching TV or Movies. Although I have taken to doing most of my TV watching on my exercise bike now, but it is still mentally relaxing

                                                                                                                                                                                    • If FreeBSD didn't exist, which BSD flavour would you use? Why?
                                                                                                                                                                                    • JT: I use TrueOS, but if FreeBSD didn’t exist, that project might not either… so… My other choice would be HardenedBSD, but since it’s also based on FreeBSD I’m in the same dillema.

                                                                                                                                                                                      BR: I once installed NetBSD to see what It can do. If FreeBSD wouldn’t exist, I would probably try my luck with it. OpenBSD is also appealing, but I’ve never installed it.
                                                                                                                                                                                      AJ: When I started using FreeBSD in 2000, the only other BSD I had heard of at the time was OpenBSD. If FreeBSD wasn’t around, I don’t think the world would look like it does, so it is hard to speculate.

                                                                                                                                                                                      • If any of the BSD's weren't around and you had to use Linux, which camp would belong to? (Redhat, SUSE, Debian, Ubuntu, Gentoo?)
                                                                                                                                                                                      • JT: I learned Linux in the mid 90s using Slackware, which I used consistently up until the mid 2000s, when I joined the PuppyLinux community and eventually became a developer (FYI, Puppy was/is/can be based on Slackware -- its complicated). So I’d go back to using either Slackware or PuppyLinux.

                                                                                                                                                                                        BR: I tried various Linux distributions until I landed at Debian. I used is pretty extensively as my desktop OS at home, building custom kernels and packages to install them until I discovered FreeBSD. I ran both side by side for a few months for learning until one day I figured out that I had not booted Debian in a while, so I switched completely.
                                                                                                                                                                                        AJ: The first Linux I played with was Slackware, and it is the most BSD like, but the bits of Linux I learned in school were Redhat and so I can somewhat wrap my head around it, although now that they are changing everything to systemd, all of that old knowledge is more harmful than useful.

                                                                                                                                                                                        • Are you still finding yourself in need to use Windows/Mac OS? Why?
                                                                                                                                                                                        • JT: I work part time as a professional Photographer, so I do use Windows for my photography work. While I can do everything I need to do in Linux, it comes down to being pragmatic about my time. What takes me several hours to accomplish in Linux I can accomplish in 20 minutes on Windows.

                                                                                                                                                                                          BR: I was a long time Windows-only user before my Unix days. But back when Vista was about to come out and I needed a new laptop, my choice was basically learning to cope with Vistas awful features or learn MacOS X. I did the latter, it increased my productivity since it’s really a good Unix desktop experience (at least, back then). I only have to use Windows at work from time to time as I manage our Windows Terminal server, which keeps the exposure low enough and I only connect to it to use a certain app not available for the Mac or the BSDs.
                                                                                                                                                                                          AJ: I still use Windows to play games, for a lot of video conferencing, and to produce BSD Now. Some of it could be done on BSD but not as easily. I have promised myself that I will switch to 100% BSD rather than upgrade to Windows 10, so we’ll see how that goes.

                                                                                                                                                                                          • Please describe your home networking setup. Router type, router OS, router hardware, network segmentation, wifi apparatus(es), other devices connected, and anything else that might be interesting about your home network.
                                                                                                                                                                                          • BR: Very simple and boring: Apple Airport Express base station and an AVM FritzBox for DNS, DHCP, and the link to my provider. A long network cable to my desktop machine. That I use less and less often. I just bought an RPI 3 for some home use in the future to replace it. Mostly my brother’s and my Macbook Pro’s are connected, our phones and the iPad of my mother.

                                                                                                                                                                                            AJ: I have a E3-1220 v3 (dual 3.1ghz + HT) with 8 GB of ram, and 4x Intel gigabit server NICs as my router, and it runs vanilla FreeBSD (usually some snapshot of -current). I have 4 different VLANs, Home, Office, DMZ, and Guest WiFi. WiFi is served via a tiny USB powered device I bought in Tokyo years ago, it serves 3 different SSIDs, one for each VLAN except the DMZ. There are ethernet jacks in every room wired for 10 gigabit, although the only machines with 10 gigabit are my main workstation, file server, and some machines in the server rack. There are 3 switches, one for the house (in the laundry room), one for the rack, and one for 10gig stuff. There is a rack in the basement spare bedroom, it has 7 servers in it, mostly storage for live replicas of customer data for my company.

                                                                                                                                                                                            • How do guys manage to get your work done on FreeBSD desktops? What do you do when you need to a Linux or Windows app that isn't ported, or working? I've made several attempts to switch to FreeBSD, but each attempt failed because of tools not being available (e.g. Zoom, Dropbox, TeamViewer, Crashplan) or broken (e.g. VirtualBox).
                                                                                                                                                                                            • BR: I use VIrtualBox for everything that is not natively available or Windows-only. Unfortunately, that means no modern games. I mostly do work in the shell when I’m on FreeBSD and when it has to be a graphical application, then I use Fluxbox as the DE. I want to get work done, not look at fancy eye-candy that get’s boring after a while. Deactivated the same stuff on my mac due to the same reason. I look for alternative software online, but my needs are relatively easy to satisfy as I’m not doing video editing/rendering and such.

                                                                                                                                                                                              AJ: I generally find that I don’t need these apps. I use Firefox, Thunderbird, OpenSSH, Quassel, KomodoEdit, and a few other apps, so my needs are not very demanding. It is annoying when packages are broken, but I usually work around this with boot environments, and being able to just roll back to a version that worked for a few days until the problem is solved. I do still have access to a windows machine for the odd time I need specific VPN software or access to Dell/HP etc out-of-band management tools.

                                                                                                                                                                                              • Which desktop environments are your favorite, and why? For example, I like i3, Xfce, and I'm drawn to Lumina's ethos, but so far always seem to end up back on Xfc because of its ease of use, flexibility, and dashing good looks.
                                                                                                                                                                                              • JT: As a Lumina Desktop developer, I think my preference is obvious. ;) I am also a long

                                                                                                                                                                                                timeOpenBox user, so I have a soft place in my heart for that as well.

                                                                                                                                                                                                BR: I use Fluxbox when I need to work with a lot of windows or an application demands X11. KDE and others are too memory heavy for me and I rarely use even 20% of the features they provide.

                                                                                                                                                                                                AJ: I was a long time KDE user, but I have adopted Lumina. I find it fast, and that it gets out of my way and lets me do what I want. It had some annoyances early on, but I’ve nagged the developers into making it work for me.

                                                                                                                                                                                                • Which command-line shells do you prefer, why, and how (if at all) have you customised the environment or prompt?
                                                                                                                                                                                                • BR: I use zsh, but without all the fancy stuff you can find online. It might make you more productive, yes. But again, I try to keep things simple. I’m slowly learning tmux and want to work more in it in the future. I sometimes look at other BSD people’s laptops and am amazed at what they do with window-management in tmux. My prompt looks like this:

                                                                                                                                                                                                  bcr@Voyager:~> 20:20 17-08-17
                                                                                                                                                                                                  Put this in your .zshrc to get the same result:
                                                                                                                                                                                                  PROMPT='%n@%m:%~>'
                                                                                                                                                                                                  RPROMPT='%T %D'

                                                                                                                                                                                                  AJ: I started using tcsh early on, because it was the shell on the first box I had access to, and because one of the first things I read in “BSD Hacks” was how to enable ‘typo correction”, which made my life a lot better especially on dial up in the early days. My shell prompt looks like this: allan@CA-TOR1-02:/usr/home/allan%

                                                                                                                                                                                                  • What is one thing (or more) missing in FreeBSD you would import from another project or community? Could be tech, process, etc.
                                                                                                                                                                                                  • JT: AUFS from Linux

                                                                                                                                                                                                    BR: Nohup from Illumos where you can detach an already running process and put it in the background. I often forget that and I’m not in tmux when that happens, so I can see myself use that feature a lot.

                                                                                                                                                                                                    AJ: Zones (more complete Jails) from IllumOS

                                                                                                                                                                                                    • how do you manage your time to learn about and work on FreeBSD? Does your work/employment enable what you do, or are your contributions mainly done in private time?
                                                                                                                                                                                                    • JT: These days I’m mostly learning things I need for work, so it just falls into something I’m doing while working on work projects.

                                                                                                                                                                                                      BR: We have a lot of time during the semester holidays to learn on our own, it’s part of the idea of being in a university to keep yourself updated, at least for me. Especially in the fast moving world of IT. I also read a lot in my free time. My interests can shift sometimes, but then I devour everything I can find on the topic. Can be a bit excessive, but has gotten me where I am now and I still need a lot to learn (and want to). Since I work with FreeBSD at work (my owndoing), I can try out many things there.

                                                                                                                                                                                                      AJ: My work means a spend a lot of time working with FreeBSD, but not that much time working ON it. My contributions are mostly done outside of work, but as I own the company I do get more flexibility to take time off for conferences and other FreeBSD related stuff.

                                                                                                                                                                                                      • we know we can bribe Michael W Lucas with gelato (good gelato that is), but what can we use to bribe you guys? Like when I want to have Allan to work on fixing a bug which prevents me from running ZFS on this fancy rock64 board?
                                                                                                                                                                                                      • BR: Desserts of various kinds.

                                                                                                                                                                                                        AJ: I am probably not the right person to look at your rock64 board. Most people in the project have taken to bribing me with chocolate. In general, my todo list is so long, the best way is a trade, you take this task and I’ll take that task.

                                                                                                                                                                                                        • Is your daily mobile device iOS, Android, Windows Mobile, or other? Why?
                                                                                                                                                                                                        • JT: These days I’m using Android on my Blackberry Priv, but until recently I was still a heavy user of Sailfish OS. I would use SailfishOS everyday, if I could find a phone with a keyboard that I could run it on.

                                                                                                                                                                                                          BR: iOS on the iPhone 7 currently. Never used an Android phone, saw it on other people’s devices and what they can do with it (much more). But the infrequent security updates (if any at all) keep me away from it.

                                                                                                                                                                                                          AJ: I have a Google Nexus 6 (Android 7.1). I wanted the ‘pure’ Android experience, and I had been happy with my previous Nexus S. I don’t run a custom OS/ROM or anything because I use the phone to verify that video streams work on an ‘average users device’. I am displeased that support for my device will end soon. I am not sure what device I will get next, but it definitely won’t be an iPhone.

                                                                                                                                                                                                          News Roundup
                                                                                                                                                                                                          Beta Update - Request for (more) Testing
                                                                                                                                                                                                          • https://beta.undeadly.org/ has received an update. The most significant changes include:
                                                                                                                                                                                                          • The site has been given a less antiquated "look". (As the topic icons have been eliminated, we are no longer seeking help with those graphics.)

                                                                                                                                                                                                            The site now uses a moderate amount of semantic HTML5.
                                                                                                                                                                                                            Several bugs in the HTML fragment validator (used for submissions and comments) have been fixed.
                                                                                                                                                                                                            To avoid generating invalid HTML, submission content which fails validation is no longer displayed in submission/comment previews.
                                                                                                                                                                                                            Plain text submissions are converted to HTML in a more useful fashion. (Instead of just converting each EOL to
                                                                                                                                                                                                            , the converter now generates proper paragraphs and interprets two or more consecutive EOLs as indicating a paragraph break.)

                                                                                                                                                                                                            • The redevelopment remains a work-in-progress. Many thanks to those who have contributed!
                                                                                                                                                                                                            • As before, constructive feedback would be appreciated. Of particular interest are reports of bugs in behaviour (for example, in the HTML validator or in authentication) that would preclude the adoption of the current code for the main site.

                                                                                                                                                                                                              High-process-count support added to master

                                                                                                                                                                                                              We've fixed a number of bottlenecks that can develop when the number of user processes runs into the tens of thousands or higher. One thing led to another and I said to myself, "gee, we have a 6-digit PID, might as well make it work to a million!". With the commits made today, master can support at least 900,000 processes with just a kern.maxproc setting in

                                                                                                                                                                                                              /boot/loader.conf, assuming the machine has the memory to handle it.
                                                                                                                                                                                                              And, in fact, as today's machines start to ratchet up there in both memory capacity and core count, with fast storage (NVMe) and fast networking (10GigE and higher), even in consumer boxes, this is actually something that one might want to do. With AMD's threadripper and EPYC chips now out, the Intel<->AMD cpu wars are back on! Boasting up to 32 cores (64 threads) per socket and two sockets on EPYC, terabytes of ram, and motherboards with dual 10GigE built-in, the reality is that these numbers are already achievable in a useful manner.
                                                                                                                                                                                                              In anycase, I've tested these changes on a dual-socket xeon. I can in-fact start 900,000 processes. They don't get a whole lot of cpu and running 'ps' would be painful, but it works and the system is still responsive from the shell with all of that going on.
                                                                                                                                                                                                              xeon126# uptime
                                                                                                                                                                                                              1:42PM up 9 mins, 3 users, load averages: 890407.00, 549381.40, 254199.55
                                                                                                                                                                                                              In fact, judging from the memory use, these minimal test processes only eat around 60KB each. 900,000 of them ate only 55GB on a 128GB machine. So even a million processes is not out of the question, depending on the cpu requirements for those processes. Today's modern machines can be stuffed with enormous amounts of memory.
                                                                                                                                                                                                              Of course, our PIDs are currently limited to 6 digits, so a million is kinda the upper limit in terms of discrete user processes (verses pthreads which are less restricted). I'd rather not go to 7 digits (yet).

                                                                                                                                                                                                              CFT: Driver for generic MS Windows 7/8/10 - compatible USB HID multi-touch touchscreens
                                                                                                                                                                                                              • Following patch [1] adds support for generic MS Windows 7/8/10 - compatible USB HID multi-touch touchscreens via evdev protocol. It is intended to be a native replacement of hid-multitouch.c driver found in Linux distributions and multimedia/webcamd port.
                                                                                                                                                                                                              • Patch is made for 12-CURRENT and most probably can be applied to recent 11-STABLE and 11.1-RELEASE (not tested)
                                                                                                                                                                                                              • How to test"
                                                                                                                                                                                                              • 1. Apply patch [1]
                                                                                                                                                                                                                2. To compile this driver into the kernel, place the following lines
                                                                                                                                                                                                                into your kernel configuration file:
                                                                                                                                                                                                                device wmt
                                                                                                                                                                                                                device usb
                                                                                                                                                                                                                device evdev
                                                                                                                                                                                                                Alternatively, to load the driver as a module at boot time, place the
                                                                                                                                                                                                                following line in loader.conf(5):
                                                                                                                                                                                                                wmt_load="YES"
                                                                                                                                                                                                                3. Install x11-drivers/xf86-input-evdev or
                                                                                                                                                                                                                x11-drivers/xf86-input-libinput port
                                                                                                                                                                                                                4. Tell XOrg to use evdev or libinput driver for the device:
                                                                                                                                                                                                                Section "ServerLayout"
                                                                                                                                                                                                                InputDevice "TouchScreen0" "SendCoreEvents"
                                                                                                                                                                                                                EndSection
                                                                                                                                                                                                                Section "InputDevice"
                                                                                                                                                                                                                Identifier "TouchScreen0"
                                                                                                                                                                                                                Driver "evdev"
                                                                                                                                                                                                                # Driver "libinput"
                                                                                                                                                                                                                Option "Device" "/dev/input/eventXXX"
                                                                                                                                                                                                                EndSection
                                                                                                                                                                                                                • Exact value of "/dev/input/eventXXX" can be obtained with evemu-record utility from devel/evemu.
                                                                                                                                                                                                                • Note1: Currently, driver does not support pens or touchpads.
                                                                                                                                                                                                                • Note2: wmt.ko should be kld-loaded before uhid driver to take precedence over it! Otherwise uhid can be kld-unloaded after loading of wmt.
                                                                                                                                                                                                                • wmt review: https://reviews.freebsd.org/D12017
                                                                                                                                                                                                                • Raw diff: https://reviews.freebsd.org/D12017.diff
                                                                                                                                                                                                                • ***
                                                                                                                                                                                                                  Beastie Bits
                                                                                                                                                                                                                  • BSDMag Programing Languages Infographic
                                                                                                                                                                                                                  • t2k17 Hackathon Report: Bob Beck on buffer cache tweaks, libressl and pledge progress
                                                                                                                                                                                                                  • New FreeBSD Journal
                                                                                                                                                                                                                  • NetBSD machines at Open Source Conference 2017 Kyoto
                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                    Feedback/Questions
                                                                                                                                                                                                                    • Dan - HDD question
                                                                                                                                                                                                                    • Benjamin - scrub of death
                                                                                                                                                                                                                    • Jason - Router Opinion
                                                                                                                                                                                                                    • Sohrab - Thanks
                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                      1 hr 58 min
                                                                                                                                                                                                                    • 209: Signals: gotta catch ‘em all

                                                                                                                                                                                                                      We read a trip report about FreeBSD in China, look at how Unix deals with Signals, a stats collector in DragonFlyBSD & much more!

                                                                                                                                                                                                                      This episode was brought to you by

                                                                                                                                                                                                                      Headlines
                                                                                                                                                                                                                      Trip Report: FreeBSD in China at COPU and LinuxCon
                                                                                                                                                                                                                      • This trip report is from Deb Goodkin, the Executive Director of the FreeBSD Foundation. She travelled to China in May 2017 to promote FreeBSD, meet with companies, and participate in discussions around Open Source.
                                                                                                                                                                                                                      • > In May of 2017, we were invited to give a talk about FreeBSD at COPU’s (China Open Source Promotional Unit) Open Source China, Open Source World Summit, which took place June 21-22, in Beijing. This was a tremendous opportunity to talk about the advantages of FreeBSD to the open source leaders and organizations interested in open source. I was honored to represent the Project and Foundation and give the presentation “FreeBSD Advantages and Applications”.
                                                                                                                                                                                                                      • > Since I was already going to be in Beijing, and LinuxCon China was being held right before the COPU event, Microsoft invited me to be part of a women-in-tech panel they were sponsoring. There were six of us on the panel including two from Microsoft, one from the Linux Foundation, one from Accenture of China, and one from Women Who Code. Two of us spoke in English, with everyone else speaking Chinese. It was disappointing that we didn’t have translators, because I would have loved hearing everyone’s answers. We had excellent questions from the audience at the end. I also had a chance to talk with a journalist from Beijing, where I emphasized how contributing to an open source project, like FreeBSD, is a wonderful way to get experience to boost your resume for a job.
                                                                                                                                                                                                                      • > The first day of LinuxCon also happened to be FreeBSD Day. I had my posters with me and was thrilled to have the Honorary Chairman of COPU (also known as the “Father of Open Source in China”) hold one up for a photo op. Unfortunately, I haven’t been able to get a copy of that photo for proof (I’m still working on it!). We spent a long time discussing the strengths of FreeBSD. He believes there are many applications in China that could benefit from FreeBSD, especially for embedded devices, university research, and open source education. We had more time throughout the week to discuss FreeBSD in more detail.
                                                                                                                                                                                                                      • > Since I was at LinuxCon, I had a chance to meet with people from the Linux Foundation, other open source projects, and some of our donors. With LinuxCon changing its name to Open Source Summit, I discussed how important it is to include minority voices like ours to contribute to improving the open source ecosystem. The people I talked to within the Linux Foundation agreed and suggested that we get someone from the Project to give a talk at the Open Source Summit in Prague this October. Jim Zemlin, the Linux Foundation Executive Director, suggested having a BSD track at the summits. We did miss the call for proposals for that conference, but we need to get people to consider submitting proposals for the Open Source Summits in 2018.
                                                                                                                                                                                                                      • > I talked to a CTO from a company that donates to us and he brought up his belief that FreeBSD is much easier to get started on as a contributor. He talked about the steep path in Linux to getting contributions accepted due to having over 10,000 developers and the hierarchy of decision makers, from Linus to his main lieutenants to the layers beneath him. It can take 6 months to get your changes in!
                                                                                                                                                                                                                      • > On Tuesday, Kylie and I met with a representative from Huawei, who we’ve been meeting over the phone with over the past few months. Huawei has a FreeBSD contributor and is looking to add more. We were thrilled to hear they decided to donate this year. We look forward to helping them get up to speed with FreeBSD and collaborate with the Project.
                                                                                                                                                                                                                      • > Wednesday marked the beginning of COPU and the reason I flew all the way to Beijing! We started the summit with having a group photo of all the speakers:The honorary chairman, Professor Lu in the front middle.
                                                                                                                                                                                                                      • > My presentation was called “FreeBSD Advantages and Applications”. A lot of the material came from Foundation Board President, George-Neville-Neil’s presentation, “FreeBSD is not a Linux Distribution”, which is a wonderful introduction to FreeBSD and includes the history of FreeBSD, who uses it and why, and which features stand out. My presentation went well, with Professor Lu and others engaged through the translators. Afterwards, I was invited to a VIP dinner, which I was thrilled about.
                                                                                                                                                                                                                      • > The only hitch was that Kylie and I were running a FreeBSD meetup that evening, and both were important! Beijing during rush hour is crazy, even trying to go only a couple of miles is challenging. We made plans that I would go to the meetup and give the same presentation, and then head back to the dinner. Amazingly, it worked out.
                                                                                                                                                                                                                      • Check out the rest of her trip report and stay tuned for more news from the region as this is one of the focus areas of the Foundation.
                                                                                                                                                                                                                      • ***
                                                                                                                                                                                                                        Unix: Dealing with signals

                                                                                                                                                                                                                        Signals on Unix systems are critical to the way processes live and die. This article looks at how they're generated, how they work, and how processes receive or block them

                                                                                                                                                                                                                        On Unix systems, there are several ways to send signals to processes—with a kill command, with a keyboard sequence (like control-C), or through a program
                                                                                                                                                                                                                        Signals are also generated by hardware exceptions such as segmentation faults and illegal instructions, timers and child process termination.
                                                                                                                                                                                                                        But how do you know what signals a process will react to? After all, what a process is programmed to do and able to ignore is another issue.
                                                                                                                                                                                                                        Fortunately, the /proc file system makes information about how processes handle signals (and which they block or ignore) accessible with commands like the one shown below. In this command, we’re looking at information related to the login shell for the current user, the "$$" representing the current process.

                                                                                                                                                                                                                        • On FreeBSD, you can use procstat -i PID to get that and even more information, and easier to digest form
                                                                                                                                                                                                                        • P if signal is pending in the global process queue
                                                                                                                                                                                                                          I if signal delivery disposition is SIGIGN
                                                                                                                                                                                                                          C if signal delivery is to catch it

                                                                                                                                                                                                                          Catching a signal requires that a signal handling function exists in the process to handle a given signal. The SIGKILL (9) and SIGSTOP (#) signals cannot be ignored or caught. For example, if you wanted to tell the kernel that ctrl-C's are to be ignored, you would include something like this in your source code:

                                                                                                                                                                                                                          signal(SIGINT, SIG_IGN);
                                                                                                                                                                                                                          To ensure that the default action for a signal is taken, you would do something like this instead:
                                                                                                                                                                                                                          signal(SIGSEGV, SIG_DFL);

                                                                                                                                                                                                                          • The article then shows some ways to send signals from the command line, for example to send SIGHUP to a process with pid 1234:
                                                                                                                                                                                                                          • kill -HUP 1234
                                                                                                                                                                                                                          • You can get a list of the different signals by running
                                                                                                                                                                                                                          • kill -l
                                                                                                                                                                                                                            On Unix systems, signals are used to send all kinds of information to running processes, and they come from user commands, other processes, and the kernel itself. Through /proc, information about how processes are handling signals is now easily accessible and, with just a little manipulation of the data, easy to understand.
                                                                                                                                                                                                                            ***
                                                                                                                                                                                                                            links owned by NGZ erroneously marked as on loan
                                                                                                                                                                                                                            • NGZ (Non-Global Zone), is IllumOS speak for their equivalent to a jail
                                                                                                                                                                                                                            • > As reported by user brianewell in smartos-live#737, NGZ ip tunnels stopped persisting across zone reboot. This behavior appeared in the 20170202 PI and was not present in previous releases. After much spelunking I determined that this was caused by a regression introduced in commit 33df115 (part of the OS-5363 work). The regression was a one-line change to link_activate() which marks NGZ links as on loan when they are in fact not loaned because the NGZ created and owns the link.
                                                                                                                                                                                                                            • “On loan” means the interface belongs to the host (GZ, Global Zone), and has been loaned to the NGZ (Jail)
                                                                                                                                                                                                                            • This regression was easy to introduce because of the subtle nature of this code and lack of comments. I'm going to remove the regressive line, add clarifying comments, and also add some asserts.

                                                                                                                                                                                                                              The following is a detailed analysis of the issue, how I debugged it, and why my one-line change caused the regression:
                                                                                                                                                                                                                              To start I verified that PI 20170119 work as expected:
                                                                                                                                                                                                                              booted 20170119
                                                                                                                                                                                                                              created iptun (named v4_sys76) inside of a native NGZ (names sos-zone)
                                                                                                                                                                                                                              performed a reboot of sos-zone
                                                                                                                                                                                                                              zlogin to sos-zone and verify iptun still exists after reboot
                                                                                                                                                                                                                              Then I booted the GZ into PI 20170202 and verified the iptun did not show up
                                                                                                                                                                                                                              booted 20170202
                                                                                                                                                                                                                              started sos-zone
                                                                                                                                                                                                                              zlogin and verified the iptun was missing
                                                                                                                                                                                                                              At this point I thought I would recreate the iptun and see if I could monitor the zone halt/boot process for the culprit, but instead I received an error from dladm: "object already exists".
                                                                                                                                                                                                                              I didn't expect this. So I used mdb to inspect the dlmgmtd state. Sure enough the iptun exists in dlmgmtd.
                                                                                                                                                                                                                              Okay, so if the link already exists, why doesn't it show up (in either the GZ or the NGZ)?
                                                                                                                                                                                                                              If a link is not marked as active then it won't show up when you query dladm. When booting the zone on 20170119 the ll_flags for the iptun contained the value 0x3. So the problem is the link is not marked as active on the 20170202 PI.
                                                                                                                                                                                                                              The link_activate() function is responsible for marking a link as active. I used dtrace to verify this function was called on the 20170202 PI and that the dlmgmt_link_t had the correct ll_flags value.
                                                                                                                                                                                                                              So the iptun link structure has the correct ll_flags when link_activate() returns but when I inspect the same structure with mdb afterwards the value has changed.
                                                                                                                                                                                                                              Sometime after link_activate() completes some other process changed the ll_flags value. My next question was: where is link_activate() called and what comes after it that might affect the ll_flags? I did another trace and got this stack.
                                                                                                                                                                                                                              The dlmgmt_upid() function calls dlmgmt_write_db_entry() after link_activate() and that can change the flags. But dtrace proved the ll_flags value was still 0x3 after returning from this function.
                                                                                                                                                                                                                              With no obvious questions left I then asked cscope to show me all places where ll_flags is modified. As I walked through the list I used dtrace to eliminate candidates one at a time -- until I reached dlmgmt_destroy_common(). I would not have expected this function to show up during zone boot but sure enough it was being called somehow, and by someone. Who?
                                                                                                                                                                                                                              Since there is no easy way to track door calls it was at this point I decided to go nuclear and use the dtrace stop action to stop dlmgmtd when it hits dlmgmt_destroy_common(). Then I used mdb -k to inspect the door info for the dlmgmtd threads and look for my culprit.
                                                                                                                                                                                                                              The culprit is do_up_iptun() caused by the dladm up-iptun call. Using ptree I then realized this was happening as part of the zone boot under the network/iptun svc startup. At this point it was a matter of doing a zlogin to sos-zone and running truss on dladm up-iptun to find the real reason why dladm_destroy_datalink_id() is called.
                                                                                                                                                                                                                              So the link is marked as inactive because dladm_getsnap_conf() fails with DLADM_STATUS_DENIED which is mapped to EACCESS. Looking at the dladm_getsnap_conf() code I see the following

                                                                                                                                                                                                                              • “The caller is in a non-global zone and the persistent configuration belongs to the global zone.”
                                                                                                                                                                                                                              • What this is saying is that if a link is marked "on loan" (meaning it's technically owned/created by the GZ but assigned/loaned to the NGZ) and the zone calling dladm_getsnap_conf() is an NGZ then return EACCESS because the configuration of the link is up to the GZ, not the NGZ. This code is correct and should be enforced, but why is it tripping in PI 20170202 and not 20170119? It comes back to my earlier observation that in the 20170202 PI we marked the iptun as "on loan" but not in the older one. Why?

                                                                                                                                                                                                                                Well as it turns out while fixing OS-5363 I fixed what I thought was a bug in link_activate()
                                                                                                                                                                                                                                When I first read this code it was my understanding that anytime we added a link to a zone's datalink list, by calling zone_add_datalink(), that link was then considered "on loan". My understanding was incorrect. The link_activate() code has a subtleness that eluded me. There are two cases in link_activate():

                                                                                                                                                                                                                                1. The link is under an NGZ's datalink list but it's ll_linkid doesn't reflect that (e.g., the link is found under zoneid 3 but ll_linkid is 0). In this case the link is owned by the GZ but is being loaned to an NGZ and the link state should be updated accordingly. We get in this situation when dlmgmtd is restated for some reason (it must resync it's in-memory state with the state of the system).
                                                                                                                                                                                                                                2. The link is NOT under any NGZ's (zone_check_datalink() is only concerned with NGZs) datalink list but its ll_zoneid holds the value of an NGZ. This indicates that the link is owned by an NGZ but for whatever reason is not currently under the NGZ's datalink list (e.g., because we are booting the zone and we now need to assign the link to its list).
                                                                                                                                                                                                                                3. So the fix is to revert that one line change as well as add some clarifying comments and also some asserts to prevent further confusion in the future.
                                                                                                                                                                                                                                4. A nice breakdown by Ryan Zezeski of how he accidently introduced a regression, and how he tracked it down using dtrace and mdb
                                                                                                                                                                                                                                5. ***
                                                                                                                                                                                                                                  New experimental statistics collector in master

                                                                                                                                                                                                                                  Master now has an in-kernel statistics collector which is enabled by default, and a (still primitive) user land program to access it. This recorder samples the state of the machine once every 10 seconds and records it in a large FIFO, all in-kernel. The FIFO typically contains 8192 entries, or around the last 23 hours worth of data.

                                                                                                                                                                                                                                  Statistics recorded include current load, user/sys/idle cpu use, swap use, VM fault rate, VM memory statistics, and counters for syscalls, path lookups, and various interrupt types. A few more useful counters will probably be added... I'd like to tie cpu temperature, fork rate, and exec rate in at some point, as well as network and disk traffic.
                                                                                                                                                                                                                                  The statistics gathering takes essentially no real overhead and is always on, so any user at the spur of the moment with no prior intent can query the last 23 hours worth of data.
                                                                                                                                                                                                                                  There is a user frontend to the data called 'kcollect' (its tied into the buildworld now). Currently still primitive. Ultimately my intention is to integrate it with a dbm database for long-term statistical data retention (if desired) using an occasional (like once-an-hour) cron-job to soak up anything new, with plenty of wiggle room due to the amount of time the kernel keeps itself. This is better and less invasive than having a userland statistics gathering script running every few minutes from cron and has the advantage of giving you a lot of data on the spur of the moment without having to ask for it before-hand.
                                                                                                                                                                                                                                  If you have gnuplot installed (pkg install gnuplot), kcollect can generate some useful graphs based on the in-kernel data. Well, it will be boring if the machine isn't doing anything :-). There are options to use gnuplot to generate a plot window in X or a .jpg or .png file, and other options to set the width and height and such. At the moment the gnuplot output uses a subset of statically defined fields to plot but ultimately the field list it uses will be specifiable.

                                                                                                                                                                                                                                  • Sample image generated during a synth run
                                                                                                                                                                                                                                  • News Roundup
                                                                                                                                                                                                                                    openbsd changes of note 626
                                                                                                                                                                                                                                    • Hackerthon is imminent.
                                                                                                                                                                                                                                    • There are two signals one can receive after accessing invalid memory, SIGBUS and SIGSEGV. Nobody seems to know what the difference is or should be, although some theories have been unearthed. Make some attempt to be slightly more consistent and predictable in OpenBSD.
                                                                                                                                                                                                                                    • Introduces jiffies in an effort to appease our penguin oppressors.
                                                                                                                                                                                                                                    • Clarify that IP.OF.UPSTREAM.RESOLVER is not actually the hostname of a server you can use.
                                                                                                                                                                                                                                    • Switch acpibat to use _BIX before _BIF, which means you might see discharge cycle counts, too.
                                                                                                                                                                                                                                    • Assorted clang compatibility. clang uses -Oz to mean optimize for size and -Os for something else, so make gcc accept -Oz so all makefiles can be the same. Adjust some hardlinks. Make sure we build gcc with gcc.
                                                                                                                                                                                                                                    • The SSL_check_private_key function is a lie.
                                                                                                                                                                                                                                    • Switch the amd64 and i386 compiler to clang and see what happens.
                                                                                                                                                                                                                                    • We are moving towards using wscons (wstpad) as the driver for touchpads.
                                                                                                                                                                                                                                    • Dancing with the stars, er, NET_LOCK().
                                                                                                                                                                                                                                    • clang emits lots of warnings. Fix some of them. Turn off a bunch of clang builtins because we have a strong preference that code use our libc versions. Some other changes because clang is not gcc.
                                                                                                                                                                                                                                    • Among other curiosities, static variables in the special .openbsd.randomdata are sometimes assumed to be all zero, leading the clang optimizer to eliminate reads of such variables.
                                                                                                                                                                                                                                    • Some more pledge rules for sed. If the script doesn’t require opening new files, don’t let it.
                                                                                                                                                                                                                                    • Backport a bajillion fixes to stable. Release errata.
                                                                                                                                                                                                                                    • RFC 1885 was obsoleted nearly 20 years ago by RFC 2463 which was obsoleted over 10 years ago by RFC 4443. We are probably not going back.
                                                                                                                                                                                                                                    • Update libexpat to 2.2.3.
                                                                                                                                                                                                                                    • vmm: support more than 3855MB guest memory.
                                                                                                                                                                                                                                    • Merge libdrm 2.4.82.
                                                                                                                                                                                                                                    • Disable SSE optimizations on i386/amd64 for SlowBcopy. It is supposed to be slow. Prevents crashes when talking to memory mapped video memory in a hypervisor.
                                                                                                                                                                                                                                    • The $25 “FREEDOM Laptop!”

                                                                                                                                                                                                                                      Time to get back to the original intent of this blog – talking about my paranoid obsession with information security! So break out your tinfoil hats my friends because this will be a fun ride. I’m looking for the most open source / freedom respecting portable computing experience I can possibly find and I’m going to document my work in real-time so you will get to experience the ups (and possibly the downs) of that path through the universe. With that said, let’s get rolling.

                                                                                                                                                                                                                                      When I built my OpenBSD router using the APU2 board, I discovered that there are some amd64 systems that use open source BIOS. This one used Coreboot and after some investigation I discovered that there was an even more paranoid open source BIOS called Libreboot out there. That started to feel like it might scratch my itch.

                                                                                                                                                                                                                                      Well, after playing around with some lower-powered systems like my APU2 board, my Thinkpad x230 and my SPARC64 boxes, I thought, if it runs amd64 code and I can run an open source operating system on it, the thing should be powerful enough for me to do most (if not all) of what I need it to do. At this point, I started looking for a viable machine. From a performance perspective, it looked like the Thinkpad x200, T400, T500 and W500 were all viable candidates. After paying attention on eBay for a while, I saw something that was either going to be a sweet deal, or a throwaway piece of garbage!
                                                                                                                                                                                                                                      I found a listing for a Thinkpad T500 that said it didn’t come with a power adapter and was 100% untested. From looking at the photos, it seemed like there was nothing that had been molested about it. Obviously, nobody was jumping on something this risky so I thought, “what the heck” and dropped a bit at the opening price of $24.99. Well, guess what. I won the auction. Now to see what I got.
                                                                                                                                                                                                                                      When the laptop showed up, I discovered it was minus its hard drive (but the outside plastic cover was still in place). I plugged in my x230’s power adapter and hit the button. I got lights and was dropped to the BIOS screen. To my eternal joy, I discovered that the machine I had purchased for $25 was 100% functional and included the T9400 2.54 GHz Core 2 Duo CPU and the 1680×1050 display panel. W00t!
                                                                                                                                                                                                                                      First things first, I need to get this machine a hard drive and get the RAM upgraded from the 2GB that it showed up with to 8GB. Good news is that these two purchases only totaled $50 for the pair. An aftermarket 9-cell replacement battery was another $20. Throw in a supported WiFi card that doesn’t require a non-free blob from Libreboot at $5.99 off of eBay and $5 for a hard drive caddy and I’m looking at about $65 in additional parts bringing the total cost of the laptop, fully loaded up at just over $100. Not bad at all…
                                                                                                                                                                                                                                      Once all of the parts arrived and were installed, now for the fun part. Disassembling the entire thing down to the motherboard so we can re-flash the BIOS with Libreboot. The guide looks particularly challenging for this but hey, I have a nice set of screwdrivers from iFixit and a remarkable lack of fear when it comes to disassembling things. Should be fun!
                                                                                                                                                                                                                                      Well, fun didn’t even come close. I wish I had shot some pictures along the way because at one point I had a heap of parts in one corner of my “workbench” (the dining room table) and just the bare motherboard, minus the CPU sitting in front of me. With the help of a clip and a bunch of whoops wires (patch cables), I connected my Beaglebone Black to the BIOS chip on the bare motherboard and attempted to read the chip. #fail
                                                                                                                                                                                                                                      I figured out after doing some more digging that you need to use the connector on the left side of the BBB if you hold it with the power connector facing away from you. In addition, you should probably read the entire process through instead of stopping at the exciting pinout connector diagram because I missed the bit about the 3.3v power supply need to have ground connected to pin 2 of the BIOS chip.
                                                                                                                                                                                                                                      Speaking of that infamous 3.3v power supply, I managed to bend a paperclip into a U shape and jam it into the connector of an old ATX power supply I had in a closet and source power from that. I felt like MacGyver for that one!
                                                                                                                                                                                                                                      I was able to successfully read the original Thinkpad BIOS and then flash the Libreboot + Grub2 VESA framebuffer image onto the laptop! I gulped loudly and started the reassembly process. Other than having some cable routing difficulties because the replacement WiFi card didn’t have a 5Ghz antenna, it all went back together. Now for the moment of truth! I hit the power button and everything worked!!!
                                                                                                                                                                                                                                      At this point I happily scurried to download the latest snapshot of OpenBSD – current and install it. Well, things got a little weird here. Looks like I have to use GRUB to boot this machine now and GRUB won’t boot an OpenBSD machine with Full Disk Encryption. That was a bit of a bummer for me. I tilted against that windmill for several days and then finally admitted defeat. So now what to do? Install Arch?
                                                                                                                                                                                                                                      Well, here’s where I think the crazy caught up to me. I decided to be an utter sell out and install Ubuntu Gnome Edition 17.04 (since that will be the default DE going forward) with full disk encryption. I figured I could have fun playing around in a foreign land and try to harden the heck out of that operating system. I called Ubuntu “grandma’s Linux” because a friend of mine installed it on his mom’s laptop for her but I figured what the heck – let’s see how the other half live!
                                                                                                                                                                                                                                      At this point, while I didn’t have what I originally set out to do – build a laptop with Libreboot and OpenBSD, I did have a nice compromise that is as well hardened as I can possibly make it and very functional in terms of being able to do what I need to do on a day to day basis. Do I wish it was more portable? Of course. This thing is like a six or seven pounder. However, I feel much more secure in knowing that the vast majority of the code running on this machine is open source and has all the eyes of the community on it, versus something that comes from a vendor that we cannot inspect. My hope is that someone with the talent (unfortunately I lack those skills) takes an interest in getting FDE working with Libreboot on OpenBSD and I will most happily nuke and repave this “ancient of days” machine to run that!

                                                                                                                                                                                                                                      FreeBSD Programmers Report Ryzen SMT Bug That Hangs Or Resets Machines

                                                                                                                                                                                                                                      It's starting to look like there's an inherent bug with AMD's Zen-based chips that is causing issues on Unix-based operating systems, with both Linux and FreeBSD confirmed. The bug doesn't just affect Ryzen desktop chips, but also AMD's enterprise EPYC chips. It seems safe to assume that Threadripper will bundle it in, as well.

                                                                                                                                                                                                                                      It's not entirely clear what is causing the issue, but it's related to the CPU being maxed out in operations, thus causing data to get shifted around in memory, ultimately resulting in unstable software. If the bug is exercised a certain way, it can even cause machines to reset.
                                                                                                                                                                                                                                      The revelation about the issue on FreeBSD was posted to the official repository, where the issue is said to happen when threads can lock up, and then cause the system to become unstable. Getting rid of the issue seems as simple as disabling SMT, but that would then negate the benefits provided by having so many threads at-the-ready.
                                                                                                                                                                                                                                      On the Linux side of the Unix fence, Phoronix reports on similar issues, where stressing Zen chips with intensive benchmarks can cause one segmentation fault after another. The issue is so profound, that Phoronix Test Suite developer Michael Larabel introduced a special test that can be run to act as a bit of a proof-of-concept. To test another way, PTS can be run with this command:
                                                                                                                                                                                                                                      PTS_CONCURRENT_TEST_RUNS=4 TOTAL_LOOP_TIME=60 phoronix-test-suite stress-run build-linux-kernel build-php build-apache build-imagemagick
                                                                                                                                                                                                                                      Running this command will compile four different software projects at once, over and over, for an hour. Before long, segfaults should begin to appear (as seen in the shot above).
                                                                                                                                                                                                                                      It's not entirely clear if both sets of issues here are related, but seeing as both involve stressing the CPU to its limit, it seems likely. Whether or not this could be patched on a kernel or EFI level is something yet to be seen.

                                                                                                                                                                                                                                      TrueOS - UNSTABLE update: 8/7/17
                                                                                                                                                                                                                                      • A new UNSTABLE update for TrueOS is available! Released regularly, UNSTABLE updates are the full “rolling release” of TrueOS. UNSTABLE includes experimental features, bugfixes, and other CURRENT FreeBSD work. It is meant to be used by those users interested in using the latest TrueOS and FreeBSD developments to help test and improve these projects.

                                                                                                                                                                                                                                      • WARNING: UNSTABLE updates are released primarily for TrueOS and FreeBSD testing/experimentation purposes. Update and run UNSTABLE “at your own risk”.

                                                                                                                                                                                                                                        Note: There was a CDN issue over the weekend that caused issues for early updaters. Everything appears to be resolved and the update is fully available again. If you encountered instability or package issues from updating on 8/6 or 8/5, roll back to a previous boot environment and run the update again.

                                                                                                                                                                                                                                      • Changes:

                                                                                                                                                                                                                                        • UNSTABLE .iso and .img files beginning with TrueOS-2017-08-3-x64 will be available to download from http://download.trueos.org/unstable/amd64/. Due to CDN issues, these are not quite available, look for them later today or tomorrow (8/8/17). This update resyncs all ports with FreeBSD as of 8.1.2017. This includes: New/updated FreeBSD Kernel and World & New DRM (Direct Rendering Manager) next.
                                                                                                                                                                                                                                        • Experimental patch for libhyve-remote: (From htps://github.com/trueos/freebsd/commit/a67a73e49538448629ea27, thanks araujobsd)
                                                                                                                                                                                                                                        • The libhyve-remote aims to abstract functionalities from other third party libraries like libvncserver, freerdp, and spice to be used in hypervisor implementation. With a basic data structure it is easy to implement any remote desktop protocol without digging into the protocol specification or third part libraries – check some of our examples.We don’t statically link any third party library, instead we use a dynamic linker and load only the functionality necessary to launch the service.Our target is to abstract functionalities from libvncserver, freerdp and spice. Right now, libhyve-remote only supports libvncserver. It is possible to launch a VNC server with different screen resolution as well as with authentication.With this patch we implement support for bhyve to use libhyve-remote that basically abstract some functionalities from libvncserver. We can: Enable wait state, Enable authentication, Enable different resolutions< Have a better compression. Also, we add a new -s flag for vncserver, if the libhyve-remote library is not present in the system, we fallback to bhyve RFB implementation. For example:

                                                                                                                                                                                                                                          -s 2,fbuf,tcp=0.0.0.0:5937,w=800,h=600,password=1234567,vncserver,wait

                                                                                                                                                                                                                                          • New SysAdm Client pages under the System Management category:
                                                                                                                                                                                                                                            • System Control: This is an interface to browse all the sysctl’s on the system.
                                                                                                                                                                                                                                            • Devices: This lists all known information about devices on the designated system.
                                                                                                                                                                                                                                            • Lumina Theming: Lumina is testing new theming functionality! By default (in UNSTABLE), a heavily customized version of the Qt5ct engine is included and enabled. This is intended to allow users to quickly adjust themes/icon packs without needing to log out and back in. This also fixes a bug in Insight with different icons loading for the side and primary windows. Look for more information about this new functionality to be discussed on the Lumina Website.
                                                                                                                                                                                                                                            • Update to Iridium Web Browser: Iridium is a Chromium based browser built with user privacy and security as the primary concern, but still maintaining the speed and usability of Chromium. It is now up to date – give it a try and let us know what you think (search for iridium-browser in AppCafe).
                                                                                                                                                                                                                                            • Beastie Bits
                                                                                                                                                                                                                                              • GhostBSD 11.1 Alpha1 is ready
                                                                                                                                                                                                                                              • A Special CharmBUG announcement
                                                                                                                                                                                                                                              • Byhve Obfuscation Part 1 of Many
                                                                                                                                                                                                                                              • New BSDMag is out
                                                                                                                                                                                                                                              • git: kernel - Lower VM_MAX_USER_ADDRESS to finalize work-around for Ryzen bug
                                                                                                                                                                                                                                              • Ken Thompson corrects one of his biggest regrets
                                                                                                                                                                                                                                              • ***
                                                                                                                                                                                                                                                Feedback/Questions
                                                                                                                                                                                                                                                • Hans - zxfer
                                                                                                                                                                                                                                                • Harza - Google Summer of Code
                                                                                                                                                                                                                                                • tadslot - Microphones, Proprietary software, and feedback
                                                                                                                                                                                                                                                • Florian - ZFS/Jail
                                                                                                                                                                                                                                                  • Modifying a ZFS root system to a beadm layout
                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                    1 hr 33 min
                                                                                                                                                                                                                                                  • 208: Faces of Open Source

                                                                                                                                                                                                                                                    DragonflyBSD 4.8.1 has been released, we explore how the X11 clipboard works, and look at OpenBSD gaming resources.

                                                                                                                                                                                                                                                    This episode was brought to you by

                                                                                                                                                                                                                                                    Headlines
                                                                                                                                                                                                                                                    LLVM, Clang and compiler-rt support enhancements

                                                                                                                                                                                                                                                    In the last month I started with upstream of the code for sanitizers: the common layer and ubsan. I worked also on the elimination of unexpected failures in LLVM and Clang. I've managed to achieve, with a pile of local patches, the number of 0 unexpected bugs within LLVM (check-llvm) and 3 unexpected bugs within Clang (check-clang) (however these ones were caused by hardcoded environment -lstdc++ vs -lc++). The number of failures in sanitizers (check-sanitizer) is also low, it's close to zero.

                                                                                                                                                                                                                                                    • LLVM
                                                                                                                                                                                                                                                    • In order to achieve the goals of testability concerning the LLVM projects, I had to prepare a new pkgsrc-wip package called llvm-all-in-one that contains 12 active LLVM projects within one tree. The set of these projects is composed of: llvm, clang, compiler-rt, libcxx, libcxxabi, libunwind, test-suite, openmp, llgo, lld, lldb, clang-tools-extra. These were required to build and execute test-suites in the LLVM's projects. Ideally the tests should work in standalone packages - built out-of-LLVM-sources - and with GCC/Clang, however the real life is less bright and this forced me to use Clang as the system compiler an all-in-one package in order to develop the work environment with the ability to build and execute unit tests.

                                                                                                                                                                                                                                                      There were four threads within LLVM:

                                                                                                                                                                                                                                                      • Broken std::call_once with libstdc++. This is an old and well-known bug, which was usually worked around with a homegrown implementation llvm::call_once. I've discovered that the llvm::call_once workaround isn't sufficient for the whole LLVM functionality, as std::call_once can be called internally inside the libstdc++ libraries - like within the C++11 futures interface. This bug has been solved by Joerg Sonnenberger in the ELF dynamic linker.
                                                                                                                                                                                                                                                      • Unportable shell construct hardcoded in tests ">&". This has been fixed upstream.
                                                                                                                                                                                                                                                      • LLVM JIT. The LLVM Memory generic allocator (or page mapper) was designed to freely map pages with any combination of the protection bits: R,W,X. This approach breaks on NetBSD with PaX MPROTECT and requires redesign of the interfaces. This is the continuation of the past month AllocateRWX and ReleaseRWX compatibility with NetBSD improvements. I've prepared few variations of local patches addressing these issues and it's still open for discussion with upstream. My personal preference is to remove the current API entirely and introduce a newer one with narrowed down functionality to swap between readable (R--), writable (RW-) and executable (R-X) memory pages. This would effectively enforce WX.
                                                                                                                                                                                                                                                      • Sanitizers support. Right now, I keep the patches locally in order to upstream the common sanitizer code in compiler-rt.
                                                                                                                                                                                                                                                      • The LLVM JIT API is the last cause of unexpected failures in check-llvm. This breaks MCJIT, ORCJIT and ExecutionEngine libraries and causes around 200 unexpected failures within tests.

                                                                                                                                                                                                                                                        • Clang
                                                                                                                                                                                                                                                        • I've upstreamed a patch that enables ubsan and asan on Clang's frontend for NetBSD/amd64. This support isn't complete, and requires sanitizers' support code upstreamed to compiler-rt.

                                                                                                                                                                                                                                                          • compiler-rt
                                                                                                                                                                                                                                                            • The current compiler-rt tasks can be divided into:
                                                                                                                                                                                                                                                            • upstream sanitizer common code shared with POSIX platforms
                                                                                                                                                                                                                                                            • upstream sanitizer common code shared with Linux and FreeBSD
                                                                                                                                                                                                                                                            • upstream sanitizer common code shared with FreeBSD
                                                                                                                                                                                                                                                            • upstream sanitizer common code specific to NetBSD
                                                                                                                                                                                                                                                            • build, execute and pass tests for sanitizer common code in check-santizer
                                                                                                                                                                                                                                                            • This means that ubsan, asan and the rest of the specific sanitizers wait in queue.

                                                                                                                                                                                                                                                              All the mentioned tasks are being worked on simultaneously, with a soft goal to finish them one after another from the first to the last one.
                                                                                                                                                                                                                                                              The last point with check-sanitizer unveiled so far two generic bugs on NetBSD:

                                                                                                                                                                                                                                                              • Return errno EFAULT instead of EACCES on memory fault with read(2)/write(2)-like syscalls.
                                                                                                                                                                                                                                                              • Honor PTHREAD_DESTRUCTOR_ITERATIONS in libpthread.
                                                                                                                                                                                                                                                              • These bugs are not strictly real bugs, but they were introducing needless differences with other modern POSIX systems. The fixes were introduced by Christos Zoulas and backported to NetBSD-8.

                                                                                                                                                                                                                                                                • Plan for the next milestone
                                                                                                                                                                                                                                                                • I have decided not to open new issues in with the coming month and focus on upstreaming the remaining LLVM code. The roadmap for the next month is to continue working on the goals of the previous months. std::call_once is an example that every delayed bug keeps biting again and again in future.

                                                                                                                                                                                                                                                                  LLVM 5.0.0 is planned to be released this month (August) and there is a joint motivation with the upstream maintainer to push compatibility fixes for LLVM JIT. There is an option to submit a workaround now and introduce refactoring for the trunk and next version (6.0.0).

                                                                                                                                                                                                                                                                  • This work was sponsored by The NetBSD Foundation.
                                                                                                                                                                                                                                                                  • The NetBSD Foundation is a non-profit organization and welcomes any donations to help us continue funding projects and services to the open-source community. Please consider visiting the following URL, and chip in what you can: http://netbsd.org/donations/#how-to-donate
                                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                                    DragonFly BSD 4.8.1 released

                                                                                                                                                                                                                                                                    +Updates by dev:

                                                                                                                                                                                                                                                                    • Antonio Huete Jimenez (1):
                                                                                                                                                                                                                                                                      • libc/gmon: Replace sbrk() with mmap()
                                                                                                                                                                                                                                                                      • Francois Tigeot (3):
                                                                                                                                                                                                                                                                        • drm: bring in Linux compability changes from master
                                                                                                                                                                                                                                                                        • drm/linux: make flush_work() more robust
                                                                                                                                                                                                                                                                        • drm/i915: Update to Linux 4.7.10
                                                                                                                                                                                                                                                                        • Imre Vadász (4):
                                                                                                                                                                                                                                                                          • drm - Fix hrtimer, don't reset timer->function to NULL in timeout handler.
                                                                                                                                                                                                                                                                          • sound - Delete devfs clone handler for /dev/dsp and /dev/mixer on unload.
                                                                                                                                                                                                                                                                          • if_vtnet - Allocate struct vtnet_tx_header entries from a queue.
                                                                                                                                                                                                                                                                          • Make sure that cam(4)'s dashutdown handler runs before DEVICE_SHUTDOWN().
                                                                                                                                                                                                                                                                          • Matthew Dillon (24):
                                                                                                                                                                                                                                                                            • kernel - MFC b48dd28447fc (sigtramp workaround)
                                                                                                                                                                                                                                                                            • kernel - Fix deadlock in sound system
                                                                                                                                                                                                                                                                            • kernel - Fix broken wakeup in crypto code
                                                                                                                                                                                                                                                                            • kernel - Add KERN_PROC_SIGTRAMP
                                                                                                                                                                                                                                                                            • gcc - Adjust the unwind code to use the new sigtramp probe sysctl
                                                                                                                                                                                                                                                                            • kernel - Implement NX
                                                                                                                                                                                                                                                                            • kernel - Implement NX (2)
                                                                                                                                                                                                                                                                            • kernel - Implement machdep.pmap_nx_enable TUNABLE
                                                                                                                                                                                                                                                                            • kernel - Implement NX (3) - cleanup
                                                                                                                                                                                                                                                                            • kernel - Temporarily set the default machdep.pmap_nx_enable to 0
                                                                                                                                                                                                                                                                            • param - Change __DragonFly_version to 400801
                                                                                                                                                                                                                                                                            • kernel - Fix i915 deadlock
                                                                                                                                                                                                                                                                            • pthreads - Change PTHREAD_STACK_MIN
                                                                                                                                                                                                                                                                            • libc - Fix bug in rcmdsh()
                                                                                                                                                                                                                                                                            • ppp - Fix minor overflow in protocol search
                                                                                                                                                                                                                                                                            • libtelnet - Fix improper statement construction (not a bug in the binary)
                                                                                                                                                                                                                                                                            • libdevstat - Limit sscanf field, fix redundant condition
                                                                                                                                                                                                                                                                            • openssh - Fix a broken assignment
                                                                                                                                                                                                                                                                            • window - Fix Graphics capability enable test
                                                                                                                                                                                                                                                                            • kernel - Fix event preset
                                                                                                                                                                                                                                                                            • mfiutil - Fix static buffer overflow
                                                                                                                                                                                                                                                                            • mixer - Fix sscanf() overflow
                                                                                                                                                                                                                                                                            • gcore - fix overflow in sscanf
                                                                                                                                                                                                                                                                            • kernel - Fix improper parens
                                                                                                                                                                                                                                                                            • Sascha Wildner (17):
                                                                                                                                                                                                                                                                              • libkvm: Fix char pointer dereference.
                                                                                                                                                                                                                                                                              • Fix some cases where an index was used before its limits check.
                                                                                                                                                                                                                                                                              • Really ensure that our world/kernel are built under POSIX locale ("C").
                                                                                                                                                                                                                                                                              • zoneinfo: Create a /usr/share/zoneinfo/UTC link.
                                                                                                                                                                                                                                                                              • kernel/cam: Add CAM_SCSI_IT_NEXUS_LOST (in preparation for virtio_scsi(4)).
                                                                                                                                                                                                                                                                              • kernel: Add FreeBSD's virtio_scsi(4) driver.
                                                                                                                                                                                                                                                                              • ccdconfig(8): Add missing free().
                                                                                                                                                                                                                                                                              • libpuffs: Fix two asserts.
                                                                                                                                                                                                                                                                              • kernel/acpi: Untangle the wakecode generation during buildkernel.
                                                                                                                                                                                                                                                                              • kernel/acpica: Better check AcpiOsPredefinedOverride()'s InitVal argument
                                                                                                                                                                                                                                                                              • kernel/acpica: ACPI_THREAD_ID is unsigned.
                                                                                                                                                                                                                                                                              • kernel/acpica: Return curthread as thread id from AcpiOsGetThreadId().
                                                                                                                                                                                                                                                                              • kernel/acpica: Remove no longer needed #include.
                                                                                                                                                                                                                                                                              • kernel/acpi: Call AcpiInitializeSubsystem() before AcpiInitializeTables().
                                                                                                                                                                                                                                                                              • kernel/urtwn: Add missing braces.
                                                                                                                                                                                                                                                                              • kernel/ieee80211: Add missing braces.
                                                                                                                                                                                                                                                                              • libthread_xu: Fix checking of pthread_barrier_init()'s count argument.
                                                                                                                                                                                                                                                                              • Sepherosa Ziehau (7):
                                                                                                                                                                                                                                                                                • sound/hda: Sync device ID table with FreeBSD
                                                                                                                                                                                                                                                                                • inet6: Restore mbuf hash after defragmentation.
                                                                                                                                                                                                                                                                                • pf: Normalized, i.e. defragged, packets requiring rehash.
                                                                                                                                                                                                                                                                                • em: Enable MSI by default on devices has PCI advanced features capability.
                                                                                                                                                                                                                                                                                • sched: Change CPU_SETSIZE to signed int, same as FreeBSD/Linux.
                                                                                                                                                                                                                                                                                • usched: Allow process to change self cpu affinity
                                                                                                                                                                                                                                                                                • ix: Fixup TX/RX ring settings for X550, which supports 64/64 TX/RX rings.
                                                                                                                                                                                                                                                                                • zrj (1):
                                                                                                                                                                                                                                                                                  • Revert "Always use unix line endings"
                                                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                                                    Porting Unix to the 386: A Practical Approach

                                                                                                                                                                                                                                                                                    The University of California's Berkeley Software Distribution (BSD) has been the catalyst for much of the innovative work done with the UNIX operating system in both the research and commercial sectors. Encompassing over 150 Mbytes (and growing) of cutting-edge operating systems, networking, and applications software, BSD is a fully functional and nonproprietary complete operating systems software distribution (see Figure 1). In fact, every version of UNIX available from every vendor contains at least some Berkeley UNIX code, particularly in the areas of filesystems and networking technologies. However, unless one could pay the high cost of site licenses and equipment, access to this software was simply not within the means of most individual programmers and smaller research groups.

                                                                                                                                                                                                                                                                                    The 386BSD project was established in the summer of 1989 for the specific purpose of porting BSD to the Intel 80386 microprocessor platform so that the tools this software offers can be made available to any programmer or research group with a 386 PC. In coordination with the Computer Systems Research Group (CSRG) at the University of California at Berkeley, we successively ported a basic research system to a common AT class machine (see, Figure 2), with the result that approximately 65 percent of all 32-bit systems could immediately make use of this new definition of UNIX. We have been refining and improving this base port ever since.
                                                                                                                                                                                                                                                                                    By providing the base 386BSD port to CSRG, our hope is to foster new interest in Berkeley UNIX technology and to speed its acceptance and use worldwide. We hope to see those interested in this technology build on it in both commercial and noncommercial ventures.
                                                                                                                                                                                                                                                                                    In this and following articles, we will examine the key aspects of software, strategy, and experience that encompassed a project of this magnitude. We intend to explore the process of the 386BSD port, while learning to effectively exploit features of the 386 architecture for use with an advanced operating system. We also intend to outline some of the tradeoffs in implementation goals which must be periodically reexamined. Finally, we will highlight extensions which remain for future work, perhaps to be done by some of you reading this article today. Note that we are assuming familiarity with UNIX, its concepts and structures, and the basic functions of the 386, so we will not present exhaustive coverage of these areas.
                                                                                                                                                                                                                                                                                    In this installment, we discuss the beginning of our project and the initial framework that guided our efforts, in particular, the development of the 386BSD specification. Future articles will address specific topics of interest and actual nonproprietary code fragments used in 386BSD. Among the future areas to be covered are:

                                                                                                                                                                                                                                                                                    • 386BSD process context switching
                                                                                                                                                                                                                                                                                    • Executing the first 386BSD process on the PC
                                                                                                                                                                                                                                                                                    • 386BSD kernel interrupt and exception handling
                                                                                                                                                                                                                                                                                    • 386BSD INTERNET networking
                                                                                                                                                                                                                                                                                    • ISA device drivers and system support
                                                                                                                                                                                                                                                                                    • 386BSD bootstrap process
                                                                                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                                                                                      X11: How does “the” clipboard work
                                                                                                                                                                                                                                                                                      • > If you have used another operating system before you switched to something that runs X11, you will have noticed that there is more than one clipboard:
                                                                                                                                                                                                                                                                                      • > Sometimes, you can use the mouse to select some text, switch to another window, and then hit the middle mouse button to paste text.
                                                                                                                                                                                                                                                                                        > Sometimes, you can select text, then hit some hotkey, e.g. Ctrl+C, switch to another window, hit another hotkey, e.g. Ctrl+V, and paste said text.
                                                                                                                                                                                                                                                                                        > Sometimes, you can do both.
                                                                                                                                                                                                                                                                                      • > Selections as a form of IPC
                                                                                                                                                                                                                                                                                      • First things first, in X11 land, “clipboards” are called “selections”.

                                                                                                                                                                                                                                                                                        Yes, there is more than one selection and they all work independently. In fact, you can use as many selections as you wish. In theory, that is. When using selections, you make different clients communicate with each other. This means that those clients have to agree on which selections to use. You can’t just invent your own selection and then expect Firefox to be compatible with it.

                                                                                                                                                                                                                                                                                      • How are selections identified?

                                                                                                                                                                                                                                                                                      • There are three “standard” selection names:

                                                                                                                                                                                                                                                                                        PRIMARY: The “middle mouse clipboard”
                                                                                                                                                                                                                                                                                        SECONDARY: Virtually unused these days
                                                                                                                                                                                                                                                                                        CLIPBOARD: The “Ctrl+C clipboard”

                                                                                                                                                                                                                                                                                      • Program 1: Query selection owners

                                                                                                                                                                                                                                                                                      • Content type and conversion

                                                                                                                                                                                                                                                                                      • Program 2: Get clipboard as UTF-8

                                                                                                                                                                                                                                                                                      • Program 3: Owning a selection

                                                                                                                                                                                                                                                                                      • Program 4: Content type TARGETS

                                                                                                                                                                                                                                                                                      • Handling binary data using xclip

                                                                                                                                                                                                                                                                                      • Large amounts of data

                                                                                                                                                                                                                                                                                      • Clipboard managers

                                                                                                                                                                                                                                                                                      • Summary

                                                                                                                                                                                                                                                                                        News Roundup
                                                                                                                                                                                                                                                                                        TrueOS Documentation: A great way to give back!

                                                                                                                                                                                                                                                                                        The TrueOS project is always looking for community contribution. Documentation changes are a great way for users to not only make a solid contribution to the project, but learn more about it too! Over the last few months, many users have asked for both simple and detailed instructions on making documentation changes. These are now added to the TrueOS handbook in the Contributing to TrueOS section.

                                                                                                                                                                                                                                                                                        If interested in making a small alteration to the TrueOS handbook, here are some instructions for submitting a patch through the GitHub website. These instructions are also applicable to the Lumina and SysAdm handbooks. Lumina documentation is in the the lumina-docs repository, and SysAdm guides are in sysadm-docs.

                                                                                                                                                                                                                                                                                        • Make a Doc change!
                                                                                                                                                                                                                                                                                        • A GitHub account is required to submit patches to the TrueOS docs. Open a web browser and sign in to GitHub or make a new account. When making a new account, be sure to use an often checked email address, as all communication regarding patches and pull requests are sent to this address. Navigate to the trueos-docs GitHub repository. Click on the trueos-handbook directory to view all the documentation files. Open the .rst file corresponding to the chapter needing an update. The chapter names are reflected in the title of the .rst files. For example, open install.rst to fix an error spotted in handbook chapter 3: “Install”. This first image shows the trueos-docs repository and the contents of the trueos-handbook directory

                                                                                                                                                                                                                                                                                          Open the desired chapter file by clicking its entry in the list. The trueos.rst file is an index file and should be ignored. Begin editing the file by clicking the Pencil icon in the upper right corner above the file’s text. The file moves to edit mode, where it is now possible to make changes, as the next image shows.

                                                                                                                                                                                                                                                                                          • Editing install.rst with GitHub
                                                                                                                                                                                                                                                                                          • When making a simple change, it is recommended to avoid adjusting the specific formatting elements and instead work within or around them. Once satisfied, scroll to the bottom of the page and write a detailed commit summary of the new changes. Click Propose file change (green button), then Create pull request to submit the changes to the project. GitHub then does an automated merge check. Click Create pull request again to submit the change to the repository. In the final step, a developer or project committer reviews the changes, merging them into the project or asking for more changes as necessary.

                                                                                                                                                                                                                                                                                            • Learn more about TrueOS documentation
                                                                                                                                                                                                                                                                                            • To learn more about the underlying structure of TrueOS documentation like the Sphinx Documentation Generator and reStructuredText markup, browse the Advanced Documentation Changes section of the TrueOS handbook. This section also contains instructions for forking the repository and configuring a local clone, build testing, updating the translation files, and other useful information. The Sphinx website is also a valuable resource.

                                                                                                                                                                                                                                                                                              libHijack Revival

                                                                                                                                                                                                                                                                                              Over a decade ago, while standing naked and vulnerable in the comfort of my steaming hot shower, I gathered my thoughts as humans typically attempt to do in the wee hours of the morning. Thoughts of a post-exploitation exercise raced in my mind, the same thoughts that made sleeping the night before difficult. If only I could inject into Apache some code that would allow me to hook into its parsing engine without requiring persistance. Putting a file-backed entry into /proc/pid/maps would tip off the security team to a compromise.

                                                                                                                                                                                                                                                                                              The end-goal was to be able to send Apache a special string and have Apache perform a unique action based on the special string.
                                                                                                                                                                                                                                                                                              FelineMenace's Binary Protection Schemes whitepaper provided inspiration. Silvio Cesare paved the way into PLT/GOT redirection attacks. Various Phrack articles selflessly contributed to the direction I was to head.
                                                                                                                                                                                                                                                                                              Alas, in the aforementioned shower, an epiphany struck me. I jumped as an awkward stereotypical geek does: like an elaborate Elaine Benes dance rehearsal in the air. If I used PTrace, ELF, and the PLT/GOT to my advantage, I could cause the victim application to allocate anonymous memory mappings arbitrarily. In the newly-created memory mapping, I could inject arbitrary code. Since a typical operating system treats debuggers as God-like applications, the memory mapping could be mapped without write access, but as read and execute only. Thus enabling the stealth that I sought.
                                                                                                                                                                                                                                                                                              The project took a few years to develop in my spare time. I ended up creating several iterations, taking a rough draft/Proof-of-Concept style code and rewriting it to be more efficient and effective.
                                                                                                                                                                                                                                                                                              I had toyed with FreeBSD off-and-on for over a decade by this point, but by-and-large I was still mostly using Linux. FreeBSD gained DTrace and ZFS support, winning me over from the Linux camp. I ported libhijack to FreeBSD, giving it support for both Linux and FreeBSD simultaneously.
                                                                                                                                                                                                                                                                                              In 2013, I started work on helping Oliver Pinter with his ASLR implementation, which was originally destined to be upstreamed to FreeBSD. It took a lot of work, and my interest in libhijack faded. As a natural consequence, I handed libhijack over to SoldierX, asking the community to take it and enhance it.
                                                                                                                                                                                                                                                                                              Over four years went by without a single commit. The project was essentially abandoned. My little baby was dead.
                                                                                                                                                                                                                                                                                              This past week, I wondered if libhijack could even compile on FreeBSD anymore. Given that four years have passed by and major changes have happened in those four years, I thought libhijack would need a major overhaul just to compile, let alone function. Imagine my surprise when libhijack needed only a few fixups to account for changes in FreeBSD's RTLD.
                                                                                                                                                                                                                                                                                              Today, I'm announcing the revival of libhijack. No longer is it dead, but very much alive. In order to develop the project faster, I've decided to remove support for Linux, focusing instead on FreeBSD. I've removed hundreds of lines of code over the past few days. Supporting both FreeBSD and Linux meant some code had to be ugly. Now the beautification process has begun.
                                                                                                                                                                                                                                                                                              I'm announcing the availability of libhijack 0.7.0 today. The ABI and API should be considered unstable as they may change without notice.
                                                                                                                                                                                                                                                                                              Note that HardenedBSD fully mitigates libhijack from working with two security features: setting security.bsd.unprivileged_proc_debug to 0 by default and the implementation of PaX NOEXEC.
                                                                                                                                                                                                                                                                                              The security.bsd.unprivileged_proc_debug sysctl node prevents PTrace access for applications the debugger itself did not fork+execve for unprivileged (non-root) users. Privileged users (the root account) can use PTrace to its fullest extent.
                                                                                                                                                                                                                                                                                              HardenedBSD's implementation of PaX NOEXEC prevents the creation of memory mappings that are both writable and executable. It also prevents using mprotect to toggle between writable and executable. In libhijack's case, FreeBSD grants libhijack the ability to write to memory mappings that are not marked writable. Debuggers do this to set breakpoints. HardenedBSD behaves differently due to PaX NOEXEC.
                                                                                                                                                                                                                                                                                              Each memory mapping has a notion of a maximum protection level. When a memory mapping is created, if the write bit is set, then HardenedBSD drops the execute bit from the maximum protection level. When the execute bit is set at memory mapping creation time, then the write bit is dropped from the maximum protection level. If both the write and execute bits are set, then the execute bit is silently dropped from both the mapping creation request and the maximum protection level.
                                                                                                                                                                                                                                                                                              The maximum protection level is always obeyed, even for debuggers. Thus we see that PaX NOEXEC is 100% effective in preventing libhijack from injecting code into a process. Here is a screenshot showing PaX NOEXEC preventing libhijack from injecting shellcode into a newly-created memory mapping.

                                                                                                                                                                                                                                                                                              • What's next for libhijack? Here's what we have planned, in no particular order:
                                                                                                                                                                                                                                                                                                • Python bindings
                                                                                                                                                                                                                                                                                                • Port to arm64
                                                                                                                                                                                                                                                                                                • This requires logic for handling machine-dependent code. High priority.
                                                                                                                                                                                                                                                                                                • Finish anonymous shared object injection.
                                                                                                                                                                                                                                                                                                • This requires implementing a custom RTLD from within libhijack.
                                                                                                                                                                                                                                                                                                • More cleanups. Adhere to style(9).
                                                                                                                                                                                                                                                                                                • libhijack can be found on GitHub @ https://github.com/SoldierX/libhijack
                                                                                                                                                                                                                                                                                                • ***
                                                                                                                                                                                                                                                                                                  Contributing to FreeBSD

                                                                                                                                                                                                                                                                                                  I’ve talked to a whole bunch of folks who say things like “I’m a junior programmer. I’m looking for a way to help. I have no specific expertise, but I’m willing to learn.” Today, I present such junior programmers with an opportunity. An opportunity for you to learn skills that will be incredibly valuable to your career, and will simultaneously expand your career opportunities.

                                                                                                                                                                                                                                                                                                  For decades, FreeBSD has relied on its users for testing. They expect users to install pre-release versions of the OS and exercise them to identify regressions. That’s necessary, but it’s nowhere near enough.
                                                                                                                                                                                                                                                                                                  The FreeBSD Testing Project is building an automated test suite for the entire operating system. They have a whole mess of work to do. There’s only four people on the team, so each additional person that contributes can have a serious impact. They have tutorials on how to write tests, and sample tests.
                                                                                                                                                                                                                                                                                                  There’s a whole bunch of tests left to be written. You have an almost open field. They need tests for everything from ls(1) to bhyve. (Yes, ls(1) broke at one point in the last few years.) Everything needs testing. Learning to write, submit, and commit small tests is valuable experience for developing the big tests.
                                                                                                                                                                                                                                                                                                  What’s more, learning to write tests for a system means learning the system. Developing tests will transform you into a FreeBSD expert. Once you’ve demonstrated your competence, worth, and ability to work within the project, other FreeBSD teams will solicit your help and advice. The Project will suck you in.
                                                                                                                                                                                                                                                                                                  Testing is perhaps the most valuable contribution anyone can make to an open source project. And this door into the FreeBSD Project is standing wide, wide open.

                                                                                                                                                                                                                                                                                                  OpenBSD Gaming Resource
                                                                                                                                                                                                                                                                                                  • > What isn't there to love about playing video games on your favorite operating system? OpenBSD and video games feels like a natural combination to me. My resource has software lists, links to free games not in ports, lists of nonfree games, and recommendations.
                                                                                                                                                                                                                                                                                                  • The Table of Contents has these high-level items for you:
                                                                                                                                                                                                                                                                                                  • > General Resources
                                                                                                                                                                                                                                                                                                  • > OpenBSD Exclusive
                                                                                                                                                                                                                                                                                                  • > Ports
                                                                                                                                                                                                                                                                                                  • > Network Clients
                                                                                                                                                                                                                                                                                                  • > Browser Games
                                                                                                                                                                                                                                                                                                  • > Game Engines
                                                                                                                                                                                                                                                                                                  • > Multiple Game Engines
                                                                                                                                                                                                                                                                                                  • > Multiple System Emulation
                                                                                                                                                                                                                                                                                                  • > Computer Emulation
                                                                                                                                                                                                                                                                                                  • > Game Console Emulation
                                                                                                                                                                                                                                                                                                  • > Live Media Emulation
                                                                                                                                                                                                                                                                                                  • > Operating System Emulation
                                                                                                                                                                                                                                                                                                  • > Games in Other Software
                                                                                                                                                                                                                                                                                                  • Have fun with these games!
                                                                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                                                                    Beastie Bits
                                                                                                                                                                                                                                                                                                    • Dragonfly introduces kcollect(8)
                                                                                                                                                                                                                                                                                                    • The Faces of Open Source
                                                                                                                                                                                                                                                                                                    • Edgemesh CEO, Jake Loveless and Joyent CTO, Bryan Cantrill join together for a fireside chat to discuss distributed caching at scale, Docker, Node.js, Mystery Science Theater 3000, and more!
                                                                                                                                                                                                                                                                                                    • UFS: Place the information needed to find alternate superblocks to the end of the area reserved for the boot block
                                                                                                                                                                                                                                                                                                    • Let ‘localhost’ be localhost
                                                                                                                                                                                                                                                                                                    • Hurry up and register for vBSDCon September 7-9 and EuroBSDCon September 21-24
                                                                                                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                                                                                                      Feedback/Questions
                                                                                                                                                                                                                                                                                                      • Morgan - btrfs deprecated
                                                                                                                                                                                                                                                                                                      • Ben - UEFI, GELI, BEADM, and more
                                                                                                                                                                                                                                                                                                      • Brad - Hostname Clarification
                                                                                                                                                                                                                                                                                                      • M Rod - BSD Laptop
                                                                                                                                                                                                                                                                                                      • Jeremy - Contributing to BSDs
                                                                                                                                                                                                                                                                                                      • ***
                                                                                                                                                                                                                                                                                                        1 hr 25 min
                                                                                                                                                                                                                                                                                                      • 207: Bridge over the river Cam

                                                                                                                                                                                                                                                                                                        We recap our devsummit experiences at BSDCambridge, share why memcmp is more complicated than expected, explore Docker on FreeBSD, and we look at a retro terminal.

                                                                                                                                                                                                                                                                                                        This episode was brought to you by

                                                                                                                                                                                                                                                                                                        Headlines
                                                                                                                                                                                                                                                                                                        BSDCam recap

                                                                                                                                                                                                                                                                                                        The 2017 Cambridge DevSummit took place from 2-4 August 2017. The event took place over three days including a formal dinner at St John's College, and was attended by 55 registered developers and guests.

                                                                                                                                                                                                                                                                                                        • Prior to the start of the conference, we had a doc hacking lounge, the computer lab provided a room where we could meet and try to spend some time on documentation. Sevan walked two interested people through the process of creating a documentation patch and submitting it for the first time. In the process, found ways to improve the documentation on how to write documentation.
                                                                                                                                                                                                                                                                                                        • The event is run "un-conference style" in that we brainstorm the actual session schedule on the first morning, with a focus on interactive topics that reflect the interests and exploit the knowledge of the attendees.

                                                                                                                                                                                                                                                                                                          • The idea is to maximize the amount of discussion and decisions that can be made while we are all in the same room
                                                                                                                                                                                                                                                                                                          • The first morning, we all gather in the slightly too small, and even more slightly under air conditioned FW11 classroom. We go around the room introducing ourselves, and listing a few topics we would be interested in discussing. Eventually the whiteboard is full of topics, with various numbers of ticks beside them to indicate the number of interested people
                                                                                                                                                                                                                                                                                                          • There are breakout rooms of all sizes, so even topics with only a small group of interested folks can get a lot accomplished
                                                                                                                                                                                                                                                                                                          • The most difficult is trying to schedule the sessions, as there is much overlap and people usually want to be in concurrent sessions, or someone's schedule means they won’t be available that day, etc.
                                                                                                                                                                                                                                                                                                          • This years working groups:
                                                                                                                                                                                                                                                                                                            • Toolchain (Compilers, Linkers, External Toolchain, Static analysis and sanitizers)
                                                                                                                                                                                                                                                                                                            • Virtualization (bhyve, xen, jails, docker)
                                                                                                                                                                                                                                                                                                            • Transport (TCP) and Network Performance
                                                                                                                                                                                                                                                                                                            • Security and mitigations (WX, noexec stack, CFI, ASLR, KASLR, Safe Stack, etc)
                                                                                                                                                                                                                                                                                                            • Testing (Status, What to test, How to test, QA for releases)
                                                                                                                                                                                                                                                                                                            • Capsicum (Automation with LLVM etc, Casper, Namespacing, “Services”, capsh)
                                                                                                                                                                                                                                                                                                            • Desktop / WiFi (drm-next, drivers, resume, power, installer, desktop, OOB Experience)
                                                                                                                                                                                                                                                                                                            • Tracing (Blackbox, DTrace, KTR, ptrace, truss, hardware tracing)
                                                                                                                                                                                                                                                                                                            • Packaging and Packaged Base (Sets, Kernels, Ports & flavours, sub-packages, privlib)
                                                                                                                                                                                                                                                                                                            • Architectural Security Features (CPU Features: SGX, PXN/PAN, Pointer Authentication, AMD Memory Encryption, Libcrunch, RISC-V, CheriABI)
                                                                                                                                                                                                                                                                                                            • Architectures and Embedded systems (RISC-V, ARM, ARM64, MIPS(64), SPARC64)
                                                                                                                                                                                                                                                                                                            • Teaching (Audiences, Objectives, Targets, Material, future directions)
                                                                                                                                                                                                                                                                                                            • Provisioning and Management Tools (CfgMgmt tools, Image building, VM/bhyve orchestration, Preconfigured VMs for testing, Wishlist)
                                                                                                                                                                                                                                                                                                            • Storage (ZFS status update, ZFS encryption infrastructure, ZFS Zero Copy / Sendfile, Acceleration of checksums and raidz parity calculations, sesutil, mpsutil)
                                                                                                                                                                                                                                                                                                            • And that wasn’t everything. We then had a series of short talklets:
                                                                                                                                                                                                                                                                                                              • Enhancing and replacing mmap()
                                                                                                                                                                                                                                                                                                              • SDIO support
                                                                                                                                                                                                                                                                                                              • eBPF support for FreeBSD
                                                                                                                                                                                                                                                                                                              • Tracing + Virtualization
                                                                                                                                                                                                                                                                                                              • Practical DMA Attack Protection
                                                                                                                                                                                                                                                                                                              • On Thursday night there was a special dinner at St John's College
                                                                                                                                                                                                                                                                                                              • Overall it was a great DevSummit, and I even managed to get some of the work assigned to me finished. Shortly I will commit an update to the boot loader menu that will automatically populate the kernel selection menu with the automatically detected list of installed kernels. The list is also properly refreshed when you switch boot environments.
                                                                                                                                                                                                                                                                                                              • ***
                                                                                                                                                                                                                                                                                                                Hosts/BSD – for when you need to run your BSD inside a penguin
                                                                                                                                                                                                                                                                                                                • This wiki provides details on how to run each of the various BSDs under QEMU
                                                                                                                                                                                                                                                                                                                • The target audience is Linux developers looking to test their apps etc under BSD
                                                                                                                                                                                                                                                                                                                • The wiki is in need of some love, there are some option questions, and it lacks some polish
                                                                                                                                                                                                                                                                                                                • There are instructions on building qemu from source, but it should likely mention the qemu-devel port
                                                                                                                                                                                                                                                                                                                • There should probably also be instructions on using other architectures, like ARM/MIPS etc
                                                                                                                                                                                                                                                                                                                • If you have used QEMU, or would like to spend the time to learn how, please help update this wiki
                                                                                                                                                                                                                                                                                                                • ***
                                                                                                                                                                                                                                                                                                                  memcmp -- more complicated than you might expect

                                                                                                                                                                                                                                                                                                                  “A suspicious pattern in open-source software”

                                                                                                                                                                                                                                                                                                                  One bug recently found by John using tis-interpreter on a widely used open-source library involved the comparison of strings with memcmp. The unexpected condition was that memcmp was, in one case, called with a pointer to a buffer shorter than the length passed as third argument, breaking one of the two symmetrical pre-conditions in the function’s ACSL contract
                                                                                                                                                                                                                                                                                                                  A reason that may have made this use of memcmp look okay to the developer is that the buffers being passed to it always differed before the end of the buffers were reached.
                                                                                                                                                                                                                                                                                                                  a memcmp implementation based on stopping as soon as a difference is found, would not have caused any out-of-bounds read access
                                                                                                                                                                                                                                                                                                                  The first question raised was whether the pattern memcmp("a", "bc", 3) was problematic according to the letter of the C standard. If it was, the second question was whether the busy maintainer of one of the Open Source packages that make the Internet tick should be bothered with a bug report.
                                                                                                                                                                                                                                                                                                                  I would like to be able to say that memcmp’s ACSL contract was the product of careful deliberation, but unfortunately this is not the case: many standard function contracts were written quickly in order to get most of the standard library covered, and have not been tested by time. Anyway, upon proofreading the relevant clause in the C11 standard, my feeling was that the ACSL formalization was, in this particular case, right, and that it was undefined behavior to pass as memcmp argument a buffer that wasn’t fully valid, even if the implementation sort-of needs to read the buffer’s characters in order for the purpose of finding the first mismatch.

                                                                                                                                                                                                                                                                                                                  • The post then goes on to look at the memcmp code in glibc
                                                                                                                                                                                                                                                                                                                  • There are two distinct optimizations for long buffers, one that applies when both buffers start at the same offset modulo the word size, memcmp_common_alignment, and one that applies when they don’t, memcmp_not_common_alignment.

                                                                                                                                                                                                                                                                                                                    The function memcmp_common_alignment is relatively well-behaved: it reads from the two buffers aligned word by aligned word, and thus reads the entire words that contain differing bytes. If the caller passed buffers that aren’t valid after the differing byte, this amounts to reading out of bounds, but this sort of out-of-bounds access is not detected by the typical MMU, which works at the scale of the page.
                                                                                                                                                                                                                                                                                                                    The “not_common_alignment” case, however, tells a different story. When passed the carefully (mis-)aligned buffers t1 and (char*)t2+1, although these buffers differ in the 8th byte, Glibc’s implementation of memcmp reads 8 bytes beyond the end of t1. By making the 16th byte differ instead of the 8th one, it is also possible to make Glibc’s implementation of memcmp read 16 bytes beyond the end of t1.
                                                                                                                                                                                                                                                                                                                    In conclusion, yes, some implementations of memcmp will crash when invoked with buffers that aren’t valid for the full length, even if they differ early. The circumstances are rare (probably the reason this bug was still there to be found in a library that had already been tested with all the available techniques) but outside the programmer’s control. The pattern described in this post should be reported as a bug when found.

                                                                                                                                                                                                                                                                                                                    • It is interesting to read the detailed analysis of a bug in such a basic libc feature
                                                                                                                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                                                                                                                      News Roundup
                                                                                                                                                                                                                                                                                                                      Docker on FreeBSD

                                                                                                                                                                                                                                                                                                                      There are two approaches to running Docker on FreeBSD. First one was created back in 2015 and it was a native port of Docker engine to FreeBSD. It was an ambitious project but nobody stepped forward to continuously port the never-ending flow of upstream code to FreeBSD. So the port still exists (sysutils/docker-freebsd) but it wasn't updated since 2015 and it is Docker v1 (it is v17 as of 2017).

                                                                                                                                                                                                                                                                                                                      The other approach is to use official way of running Docker on platforms other than Linux. Well, somewhat official as Docker still does not support FreeBSD as a host officially. This is docker-machine tool which in turn will use VirtualBox to run a virtual machine with Linux and Docker engine. docker utility on the host will communicate with the engine inside VB where all the work will be done. This article describes what needs to be done to start using it.
                                                                                                                                                                                                                                                                                                                      Before we begin you need VirtualBox installed. Do not skip adding /boot/loader.conf and /etc/rc.conf lines mentioned on that page. You won't need user inteface or anything, docker-machine will do all the work, just make sure VirtualBox is present and ready to be used.
                                                                                                                                                                                                                                                                                                                      `pkg install docker docker-machine docker-compose’
                                                                                                                                                                                                                                                                                                                      Docker will store its stuff in ~/.docker. You might not want the virtual machine image files to live in your home, in this case just create a symlink:
                                                                                                                                                                                                                                                                                                                      mkdir ~/.docker
                                                                                                                                                                                                                                                                                                                      ln -s /storage/docker ~/.docker/machine
                                                                                                                                                                                                                                                                                                                      docker-machine create --driver virtualbox \
                                                                                                                                                                                                                                                                                                                      --virtualbox-memory 2048 \
                                                                                                                                                                                                                                                                                                                      --virtualbox-cpu-count 2 \
                                                                                                                                                                                                                                                                                                                      --virtualbox-disk-size 102400 \
                                                                                                                                                                                                                                                                                                                      --virtualbox-hostonly-cidr "10.2.1.1/24" \
                                                                                                                                                                                                                                                                                                                      docker1
                                                                                                                                                                                                                                                                                                                      Here's the example. We are creating machine named docker1. It is using VirtualBox driver, the vm has 2G of memory, 2 cores and 100G of disk space. docker-machine setups VirtualBox to use host-only network adapter (it will create vboxnet0 interface on the host automatically) and we are instructing it to use 10.2.1.1/24 as the address of this adapter — change it to what suits your needs or omit this flag (default is 192.168.99.1/24).
                                                                                                                                                                                                                                                                                                                      And basically that is all. Check if it is running:
                                                                                                                                                                                                                                                                                                                      docker-machine ls
                                                                                                                                                                                                                                                                                                                      If you do open VirtualBox interface you will find a virtual machine named docker1 running. You can start/stop/whatever your machine using docker-machine utility.

                                                                                                                                                                                                                                                                                                                      • Here’s how you can connect to the machine:
                                                                                                                                                                                                                                                                                                                      • docker utility by default tries to talk to Docker engine running on the same host. However with specific environment variables you can instruct it to talk to other host. docker-machine can export these variables for you.

                                                                                                                                                                                                                                                                                                                        eval docker-machine env docker1
                                                                                                                                                                                                                                                                                                                        docker run hello-world

                                                                                                                                                                                                                                                                                                                        • There was quite a bit of discussion about docker at the FreeBSD developers summit in Cambridge during the first week of August. Two docker developers who had worked on the Mac OS X port, one of whom is an OpenBSD advocate, explained how docker has evolved, and the linux-isms have been abstracted away such that a truly native docker solution for FreeBSD can be built and maintained with a lot less headache than before
                                                                                                                                                                                                                                                                                                                        • I look forward to seeing if we can’t make that happen
                                                                                                                                                                                                                                                                                                                        • ***
                                                                                                                                                                                                                                                                                                                          The POSIX Shell And Utilities
                                                                                                                                                                                                                                                                                                                          • The POSIX Shell And Utilities
                                                                                                                                                                                                                                                                                                                          • Compiled for The Shell Hater's Handbook
                                                                                                                                                                                                                                                                                                                          • ***
                                                                                                                                                                                                                                                                                                                            PostgreSQL – logging to a file

                                                                                                                                                                                                                                                                                                                            These steps were carried out on FreeBSD 11.0 with PostgreSQL 9.6 (two of my favorite tools).

                                                                                                                                                                                                                                                                                                                            I like logging. I like logging PostgreSQL. With logs, you can see what happened. Without, you can only guess.
                                                                                                                                                                                                                                                                                                                            Setting up logging for PostgreSQL involves several parts, each of which must be completed or else I don’t get what I want. This is not a criticism of PostgreSQL. It’s a feature.
                                                                                                                                                                                                                                                                                                                            I am documenting this because each time I configure a new PostgreSQL instance, it takes me more than one iteration to get it working. The goal: this post lets both you and me get it right the first time.
                                                                                                                                                                                                                                                                                                                            The parts include:

                                                                                                                                                                                                                                                                                                                            • Telling PostgreSQL to log via syslog
                                                                                                                                                                                                                                                                                                                            • Telling FreeBSD to local postgres to /var/log/postgres.log (my preference).
                                                                                                                                                                                                                                                                                                                            • Telling PostgreSQL the things you want logged.
                                                                                                                                                                                                                                                                                                                            • Changes to postgresql.conf
                                                                                                                                                                                                                                                                                                                            • The file location varies with the version installed. For PostgreSQL 9.6 on FreeBSD, the file is /var/db/postgres/data96/postgresql.conf (adjust 96 according to the version installed).
                                                                                                                                                                                                                                                                                                                              I made these changes to that file.
                                                                                                                                                                                                                                                                                                                              log_destination = 'syslog'
                                                                                                                                                                                                                                                                                                                              log_min_messages = notice
                                                                                                                                                                                                                                                                                                                              log_min_error_statement = notice
                                                                                                                                                                                                                                                                                                                              log_checkpoints = on
                                                                                                                                                                                                                                                                                                                              log_lock_waits = on
                                                                                                                                                                                                                                                                                                                              log_timezone = 'UTC'
                                                                                                                                                                                                                                                                                                                              By default, PostgreSQL logs to the local0 facility and is controlled by the syslog_facility in postgresql.conf. This will be used in syslog.conf (see the next section of this post).
                                                                                                                                                                                                                                                                                                                              The above mentioned changes require a reload:
                                                                                                                                                                                                                                                                                                                              service postgresql reload
                                                                                                                                                                                                                                                                                                                              • Changes to /etc/syslog.conf
                                                                                                                                                                                                                                                                                                                              • Now that we have PostgreSQL logging to syslog, we want to tell syslog where to put those messages.

                                                                                                                                                                                                                                                                                                                                I changed this line in /etc/syslog.conf:*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
                                                                                                                                                                                                                                                                                                                                With .notice pulling in some local0 messages, adding local0.none to the line will free the messages up for later use in the configuration file. Otherwise, the PostgreSQL messages will be in /var/log/messages.
                                                                                                                                                                                                                                                                                                                                The changed line is:
                                                                                                                                                                                                                                                                                                                                `.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err;local0.none /var/log/messages
                                                                                                                                                                                                                                                                                                                                Then, to get the messages into my preferred location, I added this to the file:
                                                                                                                                                                                                                                                                                                                                local0.* /var/log/postgresql.log`

                                                                                                                                                                                                                                                                                                                                • Log file rotation
                                                                                                                                                                                                                                                                                                                                • For rotating my log file, I added a new file: /usr/local/etc/newsyslog.conf.d/postgresql96

                                                                                                                                                                                                                                                                                                                                  /var/log/postgresql.log pgsql:wheel 640 7 * $D0 GB /var/db/postgres/data96/postmaster.pid 30

                                                                                                                                                                                                                                                                                                                                  Before restarting syslog, I did this, so the destination file existed. This isn’t always/strictly necessary, but because the ownership is not chown root:wheel, I do it to get that part set.

                                                                                                                                                                                                                                                                                                                                  touch /var/log/postgresql.log
                                                                                                                                                                                                                                                                                                                                  chown pgsql:wheel

                                                                                                                                                                                                                                                                                                                                  Restarting syslog:

                                                                                                                                                                                                                                                                                                                                  sudo kill -HUP `sudo cat /var/run/syslog.pid `

                                                                                                                                                                                                                                                                                                                                  That’s it Now you should see PostgreSQL logging in /var/log/postgresql.log.

                                                                                                                                                                                                                                                                                                                                  mandoc-1.14.2 released

                                                                                                                                                                                                                                                                                                                                  i just released portable mandoc-1.14.2. It is available now from http://mandoc.bsd.lv/.

                                                                                                                                                                                                                                                                                                                                  ```From: Ingo Schwarze [email protected]

                                                                                                                                                                                                                                                                                                                                  Date: Fri, 28 Jul 2017 20:12:44 +0200
                                                                                                                                                                                                                                                                                                                                  Subject: mandoc-1.14.2 released

                                                                                                                                                                                                                                                                                                                                  Hi,

                                                                                                                                                                                                                                                                                                                                  i just released portable mandoc-1.14.2.

                                                                                                                                                                                                                                                                                                                                  It is available now from http://mandoc.bsd.lv/ .

                                                                                                                                                                                                                                                                                                                                  All downstream maintainers are encouraged to update their ports

                                                                                                                                                                                                                                                                                                                                  and packages from 1.14.1 to 1.14.2.

                                                                                                                                                                                                                                                                                                                                  Mandoc 1.14.2 is a feature release introducing:

                                                                                                                                                                                                                                                                                                                                  • a new -Tmarkdown output mode
                                                                                                                                                                                                                                                                                                                                  • anchors for deep linking into -Thtml manual pages
                                                                                                                                                                                                                                                                                                                                  • a superset of the functionality of the former mdoclint(1) utility
                                                                                                                                                                                                                                                                                                                                  • a new -Wstyle message level with several new messages
                                                                                                                                                                                                                                                                                                                                  • automatic line breaking inside individual tbl(7) cells
                                                                                                                                                                                                                                                                                                                                  • a rewrite of the eqn(7) lexer, and some eqn(7) rendering improvements
                                                                                                                                                                                                                                                                                                                                  • support for many additional low-level roff(7) features
                                                                                                                                                                                                                                                                                                                                  • and various smaller features and bug fixes.
                                                                                                                                                                                                                                                                                                                                  • For more details, see: http://mandoc.bsd.lv/NEWS

                                                                                                                                                                                                                                                                                                                                    With the improved mandoc features, only twenty-five out of the

                                                                                                                                                                                                                                                                                                                                    ten thousand software packages in the OpenBSD ports tree still
                                                                                                                                                                                                                                                                                                                                    need groff to format their manual pages.

                                                                                                                                                                                                                                                                                                                                    Since the project has been called "mandoc" rather than "mdocml"

                                                                                                                                                                                                                                                                                                                                    for several years now, the website, the distribution tarball,
                                                                                                                                                                                                                                                                                                                                    and the source extraction directory are now also called "mandoc"
                                                                                                                                                                                                                                                                                                                                    rather than "mdocml".

                                                                                                                                                                                                                                                                                                                                    The release was tested on the following systems:

                                                                                                                                                                                                                                                                                                                                    • OpenBSD-current and OpenBSD-stable
                                                                                                                                                                                                                                                                                                                                    • NetBSD-current
                                                                                                                                                                                                                                                                                                                                    • illumos
                                                                                                                                                                                                                                                                                                                                    • Debian Linux
                                                                                                                                                                                                                                                                                                                                    • Void Linux x86_64 glibc and musl
                                                                                                                                                                                                                                                                                                                                    • Crux Linux
                                                                                                                                                                                                                                                                                                                                    • SunOS 5.11.2, 5.10, and 5.9
                                                                                                                                                                                                                                                                                                                                    • As before, catman(8) and the regression suite cannot be used on

                                                                                                                                                                                                                                                                                                                                      SunOS 5.10 and SunOS 5.9.
                                                                                                                                                                                                                                                                                                                                      A big thanks to everybody who provided patches, bug reports,
                                                                                                                                                                                                                                                                                                                                      feature suggestions, advice, and help with testing!
                                                                                                                                                                                                                                                                                                                                      Yours,
                                                                                                                                                                                                                                                                                                                                      Ingo```

                                                                                                                                                                                                                                                                                                                                      Beastie Bits
                                                                                                                                                                                                                                                                                                                                      • A good looking terminal emulator which mimics the old cathode display. Available in x11/cool-retro-terminal
                                                                                                                                                                                                                                                                                                                                      • Milestone Complete! OpenRC conversion
                                                                                                                                                                                                                                                                                                                                      • Healthy developer interaction between FreeBSD and IllumOS re: mdb
                                                                                                                                                                                                                                                                                                                                      • Large Batch of Kernel Errata Patches Released
                                                                                                                                                                                                                                                                                                                                      • opnsense 17.7 released
                                                                                                                                                                                                                                                                                                                                      • Twitter Co-Founder and CEO states “FreeBSD rules them all”
                                                                                                                                                                                                                                                                                                                                      • Hurry up and register for vBSDCon September 7-9 and EuroBSDCon September 21-24
                                                                                                                                                                                                                                                                                                                                      • ***
                                                                                                                                                                                                                                                                                                                                        Feedback/Questions
                                                                                                                                                                                                                                                                                                                                        • Dominik - Monitoring Software
                                                                                                                                                                                                                                                                                                                                        • Darren - Wonderful Awk
                                                                                                                                                                                                                                                                                                                                        • Andrew - Thanks
                                                                                                                                                                                                                                                                                                                                        • Jens - Migration Questions
                                                                                                                                                                                                                                                                                                                                        • ***
                                                                                                                                                                                                                                                                                                                                          1 hr 44 min
                                                                                                                                                                                                                                                                                                                                        • 206: To hier is UNIX

                                                                                                                                                                                                                                                                                                                                          Lumina Desktop 1.3 is out, we show you a Plasma 5 on FreeBSD tutorial, explore randomness, and more.

                                                                                                                                                                                                                                                                                                                                          This episode was brought to you by

                                                                                                                                                                                                                                                                                                                                          Headlines
                                                                                                                                                                                                                                                                                                                                          Lumina Desktop v1.3 released
                                                                                                                                                                                                                                                                                                                                          • Notable Changes:
                                                                                                                                                                                                                                                                                                                                          • New Utility: lumina-mediaplayer. Lumina Media Player is a graphic interface for the Qt QMediaPlayer Class, with Pandora internet radio streaming integration. Lumina Media Player supports many audio formats, including .ogg, .mp3, .mp4, .flac, and .wmv. It is also possible to increase the number of playable formats by installing gstreamer-plugins. This utility is found in the Applications → Utilities section, or opened by typing lumina-mediaplayer in a command line.
                                                                                                                                                                                                                                                                                                                                            • New Utility: lumina-xdg-entry. This is another simple utility designed to help users create .desktop entries and shortcuts. Find it in the Utilities application category, or open it by typing lumina-xdg-entry in a command line.
                                                                                                                                                                                                                                                                                                                                            • Lumina Desktop:
                                                                                                                                                                                                                                                                                                                                              • Desktop folders are integrated, and can now be manipulated directly from the desktop.
                                                                                                                                                                                                                                                                                                                                              • Added the automatic settings migration of a desktop monitor (single monitor only, for now).
                                                                                                                                                                                                                                                                                                                                              • Numerous speed and performance improvements with how icons load and the system interacts with the desktop.
                                                                                                                                                                                                                                                                                                                                              • Lumina-FM:
                                                                                                                                                                                                                                                                                                                                                • Now fully integrated with lumina-archiver.
                                                                                                                                                                                                                                                                                                                                                • A “System directory” tree pane is available. Options to enable/disable it are being added later, as it is on by default.
                                                                                                                                                                                                                                                                                                                                                • Numerous speed improvements with caching and loading icons.
                                                                                                                                                                                                                                                                                                                                                • Lumina Texteditor:
                                                                                                                                                                                                                                                                                                                                                  • There is a new json manifest file format for syntax highlighting support. Users can open this file, customize their highlighting options, and immediately see their changes without rebuilding the utility.
                                                                                                                                                                                                                                                                                                                                                  • The text editor now supports more than 10 different file formats.
                                                                                                                                                                                                                                                                                                                                                  • Added options for file-wide preferences in syntax files. Options include: word wrap, character per line limits, excess whitespace highlighting, font style restrictions, and tab-width settings.
                                                                                                                                                                                                                                                                                                                                                  • LTE supports tabs with detach, drag’n’drop, and location customization with the View menu option.
                                                                                                                                                                                                                                                                                                                                                  • Add checkable menu option to show the “unsaved changes” dialogue box on close.
                                                                                                                                                                                                                                                                                                                                                  • Lumina Screenshot:
                                                                                                                                                                                                                                                                                                                                                    • Adjustments to the lumina-screenshot interface.
                                                                                                                                                                                                                                                                                                                                                    • Add an adjustable warning to lumina-screenshot when closing with an unsaved image.
                                                                                                                                                                                                                                                                                                                                                    • Add functionality to select a specific area of the screen for screenshots.
                                                                                                                                                                                                                                                                                                                                                    • Lumina Archiver:
                                                                                                                                                                                                                                                                                                                                                      • Functionality improvements.
                                                                                                                                                                                                                                                                                                                                                      • Bug fixes.
                                                                                                                                                                                                                                                                                                                                                      • Interface changes.
                                                                                                                                                                                                                                                                                                                                                      • General Improvements:
                                                                                                                                                                                                                                                                                                                                                        • Permission checks for settings files (all utilities). When launched with sudo, all tools use or create a root-permissioned copy of the user’s settings file. This prevents a settings file being locked by root.
                                                                                                                                                                                                                                                                                                                                                        • UI text reworks to help re-unify style.
                                                                                                                                                                                                                                                                                                                                                        • Add hooks to update the desktop with icons for the /media directory when a system uses USB automounting functionality.
                                                                                                                                                                                                                                                                                                                                                        • Fix Fluxbox bug with windows workspace assignments.
                                                                                                                                                                                                                                                                                                                                                        • Work on new utility lumina-notify (not fully functional yet).
                                                                                                                                                                                                                                                                                                                                                        • Fix panel reporting error crashing lumina-config.
                                                                                                                                                                                                                                                                                                                                                        • Bug fix for dbus-send calls for Gentoo.
                                                                                                                                                                                                                                                                                                                                                        • Clean up automatic DPI scaling support.
                                                                                                                                                                                                                                                                                                                                                        • Bug fix for the panel clock.
                                                                                                                                                                                                                                                                                                                                                        • Compton compositor is now disabled by default (but can be manually enabled).
                                                                                                                                                                                                                                                                                                                                                        • Translation file updates.
                                                                                                                                                                                                                                                                                                                                                        • Documentation updates.
                                                                                                                                                                                                                                                                                                                                                        • ***
                                                                                                                                                                                                                                                                                                                                                          FreeBSD 11.0 and Plasma 5 HowTo

                                                                                                                                                                                                                                                                                                                                                          Here’s a step-by-step guide to getting a machine with FreeBSD 11 in it, running X, and KDE Plasma 5 Desktop and KDE Applications. It’s the latest thing! (Except that 11-STABLE is in the middle of the pack of what’s supported .. but the KDE bits are fresh. I run 10.3 with KDE4 or Plasma 5 on my physical machines, myself, so the FreeBSD version isn’t that important except that packages are readily available for 11-STABLE, not for 10-STABLE.)

                                                                                                                                                                                                                                                                                                                                                          • We skip the part about installing FreeBSD (it’s in there if you need it) and get right to the important parts that you need:
                                                                                                                                                                                                                                                                                                                                                          • An X Server and a backup X11 environment (ancient):
                                                                                                                                                                                                                                                                                                                                                          • pkg install xorg xterm twm

                                                                                                                                                                                                                                                                                                                                                            • Desktop technologies (modern):
                                                                                                                                                                                                                                                                                                                                                            • pkg install hal dbus

                                                                                                                                                                                                                                                                                                                                                              echo hald_enable=YES >> /etc/rc.conf
                                                                                                                                                                                                                                                                                                                                                              echo dbus_enable=YES >> /etc/rc.conf

                                                                                                                                                                                                                                                                                                                                                              • Next up, test whether the X server works by running startx and exiting out of twm.
                                                                                                                                                                                                                                                                                                                                                              • If running with ZFS, it’s a good idea to snapshot now, just so you can easily roll back to the it-works-with-basic-X11 setup you have now.

                                                                                                                                                                                                                                                                                                                                                                zfs snapshot -r zroot@x11

                                                                                                                                                                                                                                                                                                                                                                • Now swap out the default FreeBSD package repository, for the KDE-FreeBSD community one. This is documented also on the Area51 page.
                                                                                                                                                                                                                                                                                                                                                                • mkdir -p /usr/local/etc/pkg/repos

                                                                                                                                                                                                                                                                                                                                                                  cd /usr/local/etc/pkg/repos
                                                                                                                                                                                                                                                                                                                                                                  cat > FreeBSD.conf <
                                                                                                                                                                                                                                                                                                                                                                  FreeBSD: { enabled: no }
                                                                                                                                                                                                                                                                                                                                                                  EOF
                                                                                                                                                                                                                                                                                                                                                                  cat > Area51.conf <
                                                                                                                                                                                                                                                                                                                                                                  Area51: {
                                                                                                                                                                                                                                                                                                                                                                  url: "http://meatwad.mouf.net/rubick/poudriere/packages/110-amd64-kde/",
                                                                                                                                                                                                                                                                                                                                                                  priority: 2,
                                                                                                                                                                                                                                                                                                                                                                  enabled: yes
                                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                                  EOF

                                                                                                                                                                                                                                                                                                                                                                  • Tell pkg(8) to refresh itself (it may install a newer pkg, too), then install something nicer than xterm + twm, and then do some post-install configuration:
                                                                                                                                                                                                                                                                                                                                                                  • pkg update

                                                                                                                                                                                                                                                                                                                                                                    pkg install konsole plasma5-plasma-desktop
                                                                                                                                                                                                                                                                                                                                                                    echo cuse_load=YES >> /boot/loader.conf
                                                                                                                                                                                                                                                                                                                                                                    echo webcamd_enable=YES >> /etc/rc.conf

                                                                                                                                                                                                                                                                                                                                                                    • Log in as your test user, and set up .xinitrc to start Plasma 5:
                                                                                                                                                                                                                                                                                                                                                                    • cat > .xinitrc <

                                                                                                                                                                                                                                                                                                                                                                      #! /bin/sh
                                                                                                                                                                                                                                                                                                                                                                      /usr/local/bin/xterm -geometry +0+0 &
                                                                                                                                                                                                                                                                                                                                                                      KDE=/usr/local/bin/startkde
                                                                                                                                                                                                                                                                                                                                                                      test -x $KDE && exec /usr/local/bin/ck-launch-session $KDE
                                                                                                                                                                                                                                                                                                                                                                      exec /usr/local/bin/twm
                                                                                                                                                                                                                                                                                                                                                                      EOF
                                                                                                                                                                                                                                                                                                                                                                      chmod 755 .xinitrc

                                                                                                                                                                                                                                                                                                                                                                      • If you really want, you can run startx, but this isn’t the complete Plasma 5 desktop experience... and KDE Applications are not installed, either. So you get a bare xterm (useful to kill X or start konsole) and kwin and not much else. Good thing that getting the rest of KDE Plasma 5 Desktop and KDE Applications is pretty easy (and we could have skipped the intermediate step with konsole and gone straight to the finish:
                                                                                                                                                                                                                                                                                                                                                                      • pkg install kde

                                                                                                                                                                                                                                                                                                                                                                        • This metaport will pull in another 2GiB of stuff, for all the KDE Applications and a complete Plasma desktop. There are intermediate metaports for slightly-less-heavy installations, but this one is easy to remember and will almost certainly get you what you want. So it really comes down to installing X, dbus, hal, and then the kde package. Voila!
                                                                                                                                                                                                                                                                                                                                                                        • ***
                                                                                                                                                                                                                                                                                                                                                                          Full FreeBSD Server on a Raspberry Pi
                                                                                                                                                                                                                                                                                                                                                                          • Disclaimer :
                                                                                                                                                                                                                                                                                                                                                                            • The Raspberry PI is a such a great device. You can do a really huge amount of fun things with this little board...
                                                                                                                                                                                                                                                                                                                                                                            • The goal of this paper is to show how you can build a full personal server on your Raspberry PI, using FreeBSD and it's packages.
                                                                                                                                                                                                                                                                                                                                                                            • Here's how we'll proceed :
                                                                                                                                                                                                                                                                                                                                                                              • Get FreeBSD
                                                                                                                                                                                                                                                                                                                                                                              • Configure FreeBSD
                                                                                                                                                                                                                                                                                                                                                                              • Install and configure sudo
                                                                                                                                                                                                                                                                                                                                                                              • Configure your Wifi with a static IPv4 and IPv6 address
                                                                                                                                                                                                                                                                                                                                                                              • Install and start Packet Filter
                                                                                                                                                                                                                                                                                                                                                                              • Install and configure nginx with "let's encrypt" SSL / PHP / MySQL
                                                                                                                                                                                                                                                                                                                                                                              • Install and configure OpenSMTPd and SPAMd
                                                                                                                                                                                                                                                                                                                                                                              • Install and configure Netdata with nginx to monitor your system
                                                                                                                                                                                                                                                                                                                                                                              • Avoid OS detection
                                                                                                                                                                                                                                                                                                                                                                              • ***
                                                                                                                                                                                                                                                                                                                                                                                News Roundup
                                                                                                                                                                                                                                                                                                                                                                                HardenedBSD, now has openntpd in base
                                                                                                                                                                                                                                                                                                                                                                                • Over the past few months, Bernard Spil has been hard at work importing OpenNTPd 6.0p1 in HardenedBSD base. Starting with 12-CURRENT, HardenedBSD will ship with OpenNTPd by default. Just like with LibreSSL in base, HardenedBSD users have a choice when building world of which NTP daemon to use. Users who want to use the legacy NTPd can set WITHOUT_OPENNTPD and WITH_NTP in src.conf(5). Bernard will continue maintaining LibreSSL and OpenNTPd in HardenedBSD base.
                                                                                                                                                                                                                                                                                                                                                                                • Users who are upgrading from an existing 12-CURRENT system from source and who use the legacy NTP daemon in base will need to perform the following actions:

                                                                                                                                                                                                                                                                                                                                                                                  • Install new world
                                                                                                                                                                                                                                                                                                                                                                                  • Run mergemaster or etcupdate
                                                                                                                                                                                                                                                                                                                                                                                  • sysrc ntpd_enable="NO"
                                                                                                                                                                                                                                                                                                                                                                                  • sysrc local_openntpd_enable="YES"
                                                                                                                                                                                                                                                                                                                                                                                  • A binary update will be published within the next 24 hours that contains OpenNTPd in base. Those who use hbsd-update will only need to perform steps 3 and 4 above.

                                                                                                                                                                                                                                                                                                                                                                                  • Unix: How random is random
                                                                                                                                                                                                                                                                                                                                                                                    • Sandra Henry-Stocker writes on Networkworld:
                                                                                                                                                                                                                                                                                                                                                                                    • On Unix systems, random numbers are generated in a number of ways and random data can serve many purposes. From simple commands to fairly complex processes, the question “How random is random?” is worth asking.

                                                                                                                                                                                                                                                                                                                                                                                      EZ random numbers
                                                                                                                                                                                                                                                                                                                                                                                      If all you need is a casual list of random numbers, the RANDOM variable is an easy choice. Type "echo $RANDOM" and you'll get a number between 0 and 32,767 (the largest number that two bytes can hold).

                                                                                                                                                                                                                                                                                                                                                                                      • Note: this only works in bash, and is generally a silly thing to do
                                                                                                                                                                                                                                                                                                                                                                                      • Of course, this process is actually providing a "pseudo-random" number. As anyone who thinks about random numbers very often might tell you, numbers generated by a program have a limitation. Programs follow carefully crafted steps, and those steps aren’t even close to being truly random. You can increase the randomness of RANDOM's value by seeding it (i.e., setting the variable to some initial value). Some just use the current process ID (via $$) for that. Note that for any particular starting point, the subsequent values that $RANDOM provides are quite predictable.

                                                                                                                                                                                                                                                                                                                                                                                        • More complex random data
                                                                                                                                                                                                                                                                                                                                                                                        • For more serious requirements for random data, such as its use in encryption, some more truly random data comes into play. The /dev/random and /dev/urandom files get beyond the predictability of programming by making use of environmental noise gathered from device drivers and other system sources and stored it in an “entropy pool”.

                                                                                                                                                                                                                                                                                                                                                                                          • Examining entropy
                                                                                                                                                                                                                                                                                                                                                                                          • Randomness vs. entropy
                                                                                                                                                                                                                                                                                                                                                                                          • Generating files with random data
                                                                                                                                                                                                                                                                                                                                                                                          • Generating random numbers
                                                                                                                                                                                                                                                                                                                                                                                          • Beyond /dev/urandom
                                                                                                                                                                                                                                                                                                                                                                                          • ***
                                                                                                                                                                                                                                                                                                                                                                                            Moving firmware to userland
                                                                                                                                                                                                                                                                                                                                                                                            • This is a post from the DragonFlyBSD mailinglist:
                                                                                                                                                                                                                                                                                                                                                                                            • I would like to introduce a few ideas about the new firmware subsystem. I assume that it should not require adding a new system tools or modifying boot process.

                                                                                                                                                                                                                                                                                                                                                                                              Simplification is the first. It would be good to remove parent-child relationship and corresponding functionality. It would significantly simplify firmware handling. Its only practical use is when there are multiple images in one loadable kernel module. The module can be unloaded when all children are not in use. Usage of the children images is tracked through the counter for the parent image. If images will not be placed inside loadable kernel modules, the parent-child mechanism won't have any practical meaning. I think, currently the mechanism is not used anywhere in the DragonFly system and if it was, it could be easily replaced by putting every child image in its own module without modifying drivers.
                                                                                                                                                                                                                                                                                                                                                                                              There are two use cases according to who will provide firmware images to
                                                                                                                                                                                                                                                                                                                                                                                              the system:

                                                                                                                                                                                                                                                                                                                                                                                              • developers of DragonFly BSD (they can modify and rebuild the system)
                                                                                                                                                                                                                                                                                                                                                                                              • third-parties (they should not be required to modify and rebuild the system)
                                                                                                                                                                                                                                                                                                                                                                                              • All firmware images needs to have some information attached (at least,

                                                                                                                                                                                                                                                                                                                                                                                                if ack with a license is needed) which should be d) stored persistently.
                                                                                                                                                                                                                                                                                                                                                                                                The question is where to save the information for non-built-in images.

                                                                                                                                                                                                                                                                                                                                                                                                • Various solutions are proposed that meet some -- but not all -- of the mentioned requirements, along with pros and cons.
                                                                                                                                                                                                                                                                                                                                                                                                • It closes with:
                                                                                                                                                                                                                                                                                                                                                                                                • There would be two firmware sources: kernel and filesystem. In case of the same image names, user could have a choice by setting a kernel environment variable, firmware from which source has higher priority and will be provided to consumer.

                                                                                                                                                                                                                                                                                                                                                                                                  OpenBSD changes of note 625
                                                                                                                                                                                                                                                                                                                                                                                                  • Continue with some cleanup and improvement of the depend step of building. Lots of little things to support lex and yacc better as well.
                                                                                                                                                                                                                                                                                                                                                                                                  • Intel Optane parts are leaking into the wild, some driver fixes to support them.
                                                                                                                                                                                                                                                                                                                                                                                                  • Add support for pattern substitution to variables in ksh using a common syntax borrowed from ksh93. Or not, reverted.
                                                                                                                                                                                                                                                                                                                                                                                                  • Deprecate fgetln.
                                                                                                                                                                                                                                                                                                                                                                                                  • Add detection for missing X sets to syspatch.
                                                                                                                                                                                                                                                                                                                                                                                                  • Refinement of the inteldrm code, including better backlight support.
                                                                                                                                                                                                                                                                                                                                                                                                  • A special edition of slaacd for the installer.
                                                                                                                                                                                                                                                                                                                                                                                                  • After much wailing and gnashing of teeth, fix strtol to parse strings like “0xridiculous”.
                                                                                                                                                                                                                                                                                                                                                                                                  • A fix for malloc and zero sized allocations when using canaries.
                                                                                                                                                                                                                                                                                                                                                                                                  • Add the ability to pause and unpause VMs in vmd.
                                                                                                                                                                                                                                                                                                                                                                                                  • Remove “listen secure” syntax from smtpd.conf. It’s broken since a couple of months and noone complained.
                                                                                                                                                                                                                                                                                                                                                                                                  • Remove sending of router solicitations and processing of router advertisements from the kernel.
                                                                                                                                                                                                                                                                                                                                                                                                  • The lidsuspend sysctl has been fully replaced by lidaction.
                                                                                                                                                                                                                                                                                                                                                                                                  • Fix fortune to filter out unprintable characters. Convert the fortune files to using UTF-8 instead of archaic overprinting. Fortunes with unprintable words may still be obtained with the -o option.
                                                                                                                                                                                                                                                                                                                                                                                                  • Introduce some quirks to the IDE and ATA code to prevent drives from attaching twice on hyper-v.
                                                                                                                                                                                                                                                                                                                                                                                                  • Add vmctl send and receive as well.
                                                                                                                                                                                                                                                                                                                                                                                                  • Update to xterm 330.
                                                                                                                                                                                                                                                                                                                                                                                                  • Remove some magic cleanup from dhclient. It will not deliberately attempt to interfere with other operations on the same interface.
                                                                                                                                                                                                                                                                                                                                                                                                  • Update libexpat to 2.2.2. Fixes NULL parser dereference.
                                                                                                                                                                                                                                                                                                                                                                                                  • Ilja Van Sprundel found a whole mess of kernel bugs in this and that. Some info leaks, some erroneous signal handling, some unbounded malloc calls. Lions, tigers, bears. Try to fix them.
                                                                                                                                                                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                                                                                                                                                                    Beastie Bits
                                                                                                                                                                                                                                                                                                                                                                                                    • Heir - description of the file system hierarchy
                                                                                                                                                                                                                                                                                                                                                                                                    • FreeBSD hier(7)
                                                                                                                                                                                                                                                                                                                                                                                                    • sshlockout and your logs
                                                                                                                                                                                                                                                                                                                                                                                                    • net-mgmt/netdata can now monitor ZFS pools
                                                                                                                                                                                                                                                                                                                                                                                                    • Ted Unangst is reviewing some books, chapter by chapter. “Coders at Work”, “Founders at Work”, “the Mythical Man-Month”, “The Pragmatic Programmer”, and “Code: The Hidden Language of Computer Hardware and Software”. This is chapter 5, look for the bookreview tag on the site to find the previous ones
                                                                                                                                                                                                                                                                                                                                                                                                    • pfSense 2.3.4-p1 release now available
                                                                                                                                                                                                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                                                                                                                                                                                                      Feedback/Questions
                                                                                                                                                                                                                                                                                                                                                                                                      • Ben - Thanks
                                                                                                                                                                                                                                                                                                                                                                                                      • Jay - ZFS and Speed
                                                                                                                                                                                                                                                                                                                                                                                                      • Patrick - Portalfs removed?
                                                                                                                                                                                                                                                                                                                                                                                                      • Sir l33tname - ZFS pool question
                                                                                                                                                                                                                                                                                                                                                                                                      • ***
                                                                                                                                                                                                                                                                                                                                                                                                        1 hr 31 min
                                                                                                                                                                                                                                                                                                                                                                                                      • 205: FreeBSD Turning it up to 11.1

                                                                                                                                                                                                                                                                                                                                                                                                        FreeBSD 11.1-RELEASE is out, we look at building at BSD home router, how to be your own OpenBSD VPN provider, and find that glob matching can be simple and fast.

                                                                                                                                                                                                                                                                                                                                                                                                        This episode was brought to you by

                                                                                                                                                                                                                                                                                                                                                                                                        Headlines
                                                                                                                                                                                                                                                                                                                                                                                                        FreeBSD 11.1-RELEASE
                                                                                                                                                                                                                                                                                                                                                                                                        • FreeBSD 11.1 was released on July 26th
                                                                                                                                                                                                                                                                                                                                                                                                        • You can download it as an ISO or USB image, a prebuilt VM Image (vmdk, vhd, qcow2, or raw), and it is available as a cloud image (Amazon EC2, Microsoft Azure, Google Compute Engine, Vagrant)
                                                                                                                                                                                                                                                                                                                                                                                                        • Thanks to everyone, including the release engineering team who put so much time and effort into managing this release and making sure it came out on schedule, all of the FreeBSD developers who contributed the features, the companies that sponsored that development, and the users who tested the betas and release candidates.
                                                                                                                                                                                                                                                                                                                                                                                                        • Support for blacklistd(8) has been added to OpenSSH
                                                                                                                                                                                                                                                                                                                                                                                                        • The cron(8) utility has been updated to add support for including files within /etc/cron.d and /usr/local/etc/cron.d by default.
                                                                                                                                                                                                                                                                                                                                                                                                        • The syslogd(8) utility has been updated to add the include keyword which allows specifying a directory containing configuration files to be included in addition to syslog.conf(5). The default syslog.conf(5) has been updated to include /etc/syslog.d and /usr/local/etc/syslog.d by default.
                                                                                                                                                                                                                                                                                                                                                                                                        • The zfsbootcfg(8) utility has been added, providing one-time boot.config(5)-style options
                                                                                                                                                                                                                                                                                                                                                                                                        • The efivar(8) utility has been added, providing an interface to manage UEFI variables.
                                                                                                                                                                                                                                                                                                                                                                                                        • The ipsec and tcpmd5 kernel modules have been added, these can now be loaded without having to recompile the kernel
                                                                                                                                                                                                                                                                                                                                                                                                        • A number of new IPFW modules including Network Prefix Translation for IPv6 as defined in RFC 6296, stateless and stateful NAT64, and a module to modify the TCP-MSS of packets
                                                                                                                                                                                                                                                                                                                                                                                                        • A huge array of driver updates and additions
                                                                                                                                                                                                                                                                                                                                                                                                        • The NFS client now supports the Amazon® Elastic File System™ (EFS)
                                                                                                                                                                                                                                                                                                                                                                                                        • The new ZFS Compressed ARC feature was added, and is enabled by default
                                                                                                                                                                                                                                                                                                                                                                                                        • The EFI loader has been updated to support TFTPFS, providing netboot support without requiring an NFS server
                                                                                                                                                                                                                                                                                                                                                                                                        • For a complete list of new features and known problems, please see the online release notes and errata list, available at:
                                                                                                                                                                                                                                                                                                                                                                                                          • FreeBSD 11.1-RELEASE Release Notes
                                                                                                                                                                                                                                                                                                                                                                                                          • FreeBSD 11.1-RELEASE Errata
                                                                                                                                                                                                                                                                                                                                                                                                          • For more information about FreeBSD release engineering activities, please see: Release Engineering Information
                                                                                                                                                                                                                                                                                                                                                                                                          • Availability
                                                                                                                                                                                                                                                                                                                                                                                                            • FreeBSD 11.1-RELEASE is now available for the amd64, i386, powerpc, powerpc64, sparc64, armv6, and aarch64 architectures.
                                                                                                                                                                                                                                                                                                                                                                                                            • FreeBSD 11.1-RELEASE can be installed from bootable ISO images or over the network. Some architectures also support installing from a USB memory stick. The required files can be downloaded as described in the section below.
                                                                                                                                                                                                                                                                                                                                                                                                            • SHA512 and SHA256 hashes for the release ISO, memory stick, and SD card images are included at the bottom of this message.
                                                                                                                                                                                                                                                                                                                                                                                                            • PGP-signed checksums for the release images are also available at: FreeBSD 11.1 Release Checksum Signatures
                                                                                                                                                                                                                                                                                                                                                                                                            • A PGP-signed version of this announcement is available at: FreeBSD 11.1-RELEASE Announcement
                                                                                                                                                                                                                                                                                                                                                                                                            • ***
                                                                                                                                                                                                                                                                                                                                                                                                              Building a BSD home router - ZFS and Jails
                                                                                                                                                                                                                                                                                                                                                                                                              • Part of a series of posts about building a router:
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 1 -- discussing why you want to build your own router and how to assemble the APU2
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 2 -- some Unix history explanation of what a serial console is
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 3 -- demonstrating serial access to the APU and covering firmware update
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 4 -- installing pfSense
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 5 -- installing OPNsense instead
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 6 -- Comparison of pfSense and OPNsense
                                                                                                                                                                                                                                                                                                                                                                                                                • Part 7 -- Advanced installation of OPNsense
                                                                                                                                                                                                                                                                                                                                                                                                                • After the advanced installation in part 7, the tutorials covers converting an unused partition into swap space, and converting the system to ZFS
                                                                                                                                                                                                                                                                                                                                                                                                                • After creating a new pool using the set aside partition, some datasets are created, and the log files, ports, and obj ZFS datasets are mounted
                                                                                                                                                                                                                                                                                                                                                                                                                • The tutorial then goes on to cover how to download the ports tree, and install additional software on the router
                                                                                                                                                                                                                                                                                                                                                                                                                • I wonder what part 9 will be about.
                                                                                                                                                                                                                                                                                                                                                                                                                • ***
                                                                                                                                                                                                                                                                                                                                                                                                                  Be your own VPN provider with OpenBSD (v2)
                                                                                                                                                                                                                                                                                                                                                                                                                  • This article covers how to build your own VPN server with some advanced features including:
                                                                                                                                                                                                                                                                                                                                                                                                                    • Full Disk Encryption (FDE)
                                                                                                                                                                                                                                                                                                                                                                                                                    • Separate CA/signing machine (optional)
                                                                                                                                                                                                                                                                                                                                                                                                                    • Multiple DNSCrypt proxy instances for failover
                                                                                                                                                                                                                                                                                                                                                                                                                    • OpenVPN: Certificate Revocation List/CRL (optional)
                                                                                                                                                                                                                                                                                                                                                                                                                    • OpenVPN: TLS 1.2 only
                                                                                                                                                                                                                                                                                                                                                                                                                    • OpenVPN: TLS cipher based on AES-256-GCM only
                                                                                                                                                                                                                                                                                                                                                                                                                    • OpenVPN: HMAC-SHA512 instead of HMAC-SHA1
                                                                                                                                                                                                                                                                                                                                                                                                                    • OpenVPN: TLS encryption of control channel (makes it harder to identify OpenVPN traffic)
                                                                                                                                                                                                                                                                                                                                                                                                                    • The article starts with an explanation of the differences between OpenVPN and IPSEC.
                                                                                                                                                                                                                                                                                                                                                                                                                    • In the end the author chose OpenVPN because you can select the port it runs on, and it has a better chance of working from hotel or coffee shop WiFi.
                                                                                                                                                                                                                                                                                                                                                                                                                    • The guide them walks through doing an installation on an encrypted disk, with a caution about the limitations of encrypted disk with virtual machines hosted by other parties.
                                                                                                                                                                                                                                                                                                                                                                                                                    • The guide then locks down the newly installed system, configuring SSH for keys only, adding some PF rules, and configuring doas
                                                                                                                                                                                                                                                                                                                                                                                                                    • Then networking is configured, including enabling IP forwarding since this machine is going to act as the VPN gateway
                                                                                                                                                                                                                                                                                                                                                                                                                    • Then a large set of firewall rules are created that NAT the VPN traffic out of the gateway, except for DNS requests that are redirected to the gateways local unbound
                                                                                                                                                                                                                                                                                                                                                                                                                    • Then some python scripts are provided to block brute force attempts
                                                                                                                                                                                                                                                                                                                                                                                                                    • We will use DNSCrypt to make our DNS requests encrypted, and Unbound to have a local DNS cache. This will allow us to avoid using our VPS provider DNS servers, and will also be useful to your future VPN clients which will be able to use your VPN server as their DNS server too

                                                                                                                                                                                                                                                                                                                                                                                                                      Before configuring Unbound, which is the local DNS cache which will make requests to dnscrypt_proxy, we can configure an additional dnscrypt instance, as explained in the pkg readme. Indeed, dnscrypt DNS servers being public ones, they often goes into maintenance, become offline or temporarily unreachable. To address this issue, it is possible to setup multiple dnscrypt instances. Below are the steps to follow to add one, but you can add more if you wish

                                                                                                                                                                                                                                                                                                                                                                                                                      • Then a CA and Certificate are created for OpenVPN
                                                                                                                                                                                                                                                                                                                                                                                                                      • OpenVPN is installed and configured as a server
                                                                                                                                                                                                                                                                                                                                                                                                                      • Configuration is also provided for a client, and a mobile client
                                                                                                                                                                                                                                                                                                                                                                                                                      • Thanks to the author for this great tutorial
                                                                                                                                                                                                                                                                                                                                                                                                                      • You might also want to check out this section from their 2015 version of this post: Security vs Anonymity
                                                                                                                                                                                                                                                                                                                                                                                                                      • ***
                                                                                                                                                                                                                                                                                                                                                                                                                        Essen Hackathon Trip - Benedict Reuschling
                                                                                                                                                                                                                                                                                                                                                                                                                        • Over on the FreeBSD Foundation Blog, Benedict provides a detailed overview of the Essen Hackathon we were at a few weeks ago.
                                                                                                                                                                                                                                                                                                                                                                                                                        • Head over there and give it a read, and get a feel for what these smaller type of community events are like. Hopefully you can attend, or better yet, organize, a similar event in your area.
                                                                                                                                                                                                                                                                                                                                                                                                                        • News Roundup
                                                                                                                                                                                                                                                                                                                                                                                                                          Blog about my self-hosted httpd blog

                                                                                                                                                                                                                                                                                                                                                                                                                          I really like Twitter because it allows me to share short messages, we have a great community, and 140 characters are enough for everybody.

                                                                                                                                                                                                                                                                                                                                                                                                                          And this statement was exactly 140 characters, but sometimes I want to say more than that. And that's why I finally created this new blog. I was never really into blogging because I barely had time or the audience to write long articles. I sometimes wrote short stories for sites like undeadly.org, I collected some of them here, but my own blog was hosted on tumblr and never saw any activity.
                                                                                                                                                                                                                                                                                                                                                                                                                          I want to try it again, and this time I decided to create a self-hosted blog. Something that runs on my own server and with httpd, the web server that I wrote for OpenBSD. So I was looking for potential blogging tools that I could use to run my own blog. Besides the popular and heavyweight ones such as WordPress, there are countless other options: I looked at blogs from fellow developers, such as Ted Unangst's flak (I like the fact that it is written in Lua but the implementation is a bit over my head), or Pelican that is used by Peter Hessler for bad.network (but, sorry, I don't like Python), and finally Kristaps Dzonsons' sblg that is used for all of his projects and blogs. I decided to use sblg.
                                                                                                                                                                                                                                                                                                                                                                                                                          Kristaps keeps on releasing very useful free software. Most well-known is mandoc, at least everyone is using it for manpages these days, but there is is also his BCHS (beaches) web stack which strongly advertises OpenBSD's httpd. Great. I also use kcgi whenever I have to write small CGIs. So sblg seemed like the right choice to me.
                                                                                                                                                                                                                                                                                                                                                                                                                          Let me quickly iterate over my current Makefile. I keep on tweaking this file, so it might have been changed by the time you are reading this article. Please note that the Makefile is written for OpenBSD's make, a distant derivative of pmake which is not like GNU make.
                                                                                                                                                                                                                                                                                                                                                                                                                          I'm not a designer or web developer, but I appreciate good looking web pages. I wanted to have something that is responsive, works on desktops and mobiles, looks somewhat modern, works without JavaScript, but doesn't disqualify me for all the eye candy from a geek point of view.
                                                                                                                                                                                                                                                                                                                                                                                                                          I bootstrapped the theme by creating a simple grid layout with a fairly typical blog style: banner, top menu, middle text, sidebar. In 2017, bootstrap is probably a vintage (or retro) framework but it makes it very easy to create responsive pages with a proper layout and without caring about all the CSS and HTML5 madness too much. I also use Font Awesome because it is awesome, provides some fancy icons, and was suggested in sblg's example templates (let's blame Kristaps for it). I do not include any JavaScript which prevents me from using bootstrap's responsive hamburger menu.
                                                                                                                                                                                                                                                                                                                                                                                                                          I have to admit that "reykfloeter" is not an ideal name for a blog. My actual name is "Reyk Flöter", and I normally just use my first name "reyk" as a user- and nickname, but it was taken when I registered my Twitter account and the related domain. So I picked reykfloeter in a few places.
                                                                                                                                                                                                                                                                                                                                                                                                                          I'm aware that my German last name is nearly unpronounceable for others, so "reykfloeter" appears like a random concatenation of letters. As most of us, I own a number of domains and maybe I should move the blog to bsd.plumbing (which is used as a home for relayd and httpd), arc4random.com (but I intended to use it as a fine OpenBSD-powered Entropy-as-a-Service for poor Linuxers), or even copper.coffee?
                                                                                                                                                                                                                                                                                                                                                                                                                          In addition to the domain, I also need a good blog name or tag line. A very memorable example in the BSD world is Peter Hansteen's THAT GRUMPY BSD GUY blog. So what should I use?

                                                                                                                                                                                                                                                                                                                                                                                                                          • Reyk Flöter's blog
                                                                                                                                                                                                                                                                                                                                                                                                                            • OpenBSD hacker. Coffee nerd. Founder.
                                                                                                                                                                                                                                                                                                                                                                                                                            • Ask Reyk (imaginary how-tos and 10 step guides)
                                                                                                                                                                                                                                                                                                                                                                                                                            • [Sewage, Drainage and BSD Plumbing](bsd.plumbing/blog)
                                                                                                                                                                                                                                                                                                                                                                                                                            • [A Replacement Call for Random](arc4random.com)
                                                                                                                                                                                                                                                                                                                                                                                                                            • [Coffee with Reyk](copper.coffee)
                                                                                                                                                                                                                                                                                                                                                                                                                            • For now it will just be reykfloeter - blog

                                                                                                                                                                                                                                                                                                                                                                                                                              iXsystems releases the X10
                                                                                                                                                                                                                                                                                                                                                                                                                              • TrueNAS X10 is the the 3rd generation of the TrueNAS unified storage line. The X10 is the first of a new TrueNAS series, and will be expandable to up to 360TB with the TrueNAS ES12 expansion shelf.
                                                                                                                                                                                                                                                                                                                                                                                                                              • The X10 is cost effective, at a 30% lower price point than the Z20, making it an effective addition to your backup/DR infrastructure. The street price of a 20TB non-HA model falls under $10K. It’s designed to move with six predefined configurations that match common use cases. The dual controllers for high availability are an optional upgrade to ensure business continuity and avoid downtime.
                                                                                                                                                                                                                                                                                                                                                                                                                              • The X10 boasts 36 hot swap SAS using two expansion shelves, for up to 360TB of storage, allowing you to backup thousands of VMs or share tens of thousands of files. One of the use cases for TrueNAS X10 is for backup, so users can upgrade the X10 to two ports of blazing 10GigE connectivity. The 20TB non-HA model enables you to backup over 7,000 VDI VMs for under $3.00 per VM. Overall, the X10 is a greener solution than the TrueNAS Z product line, with the non-HA version boasting only 138 watts of power and taking up only 2U of space.
                                                                                                                                                                                                                                                                                                                                                                                                                              • Best of all, the TrueNAS X10 starts at $5,500 street. You can purchase a 120TB configuration today for under $20K street.
                                                                                                                                                                                                                                                                                                                                                                                                                              • Glob Matching Can Be Simple And Fast Too

                                                                                                                                                                                                                                                                                                                                                                                                                                Here’s a straightforward benchmark. Time how long it takes to run ls (a*)nb in a directory with a single file named a100, compared to running ls | grep (a.*)nb. Superscripts denote string repetition and parentheses are for grouping only, so that when n is 3, we’re running ls a*a*a*b in a directory containing the single file aaa…aaa (100 a’s), compared against ls | grep a.*a.*a.*b in the same directory.

                                                                                                                                                                                                                                                                                                                                                                                                                                The exception seems to be the original Berkeley csh, which runs in linear time (more precisely, time linear in n). Looking at the source code, it doesn’t attempt to perform glob expansion itself. Instead it calls the C library implementation glob(3), which runs in linear time, at least on this Linux system. So maybe we should look at programming language implementations too.
                                                                                                                                                                                                                                                                                                                                                                                                                                Most programming languages provide some kind of glob expansion, like C’s glob. Let’s repeat the experiment in a variety of different programming languages:
                                                                                                                                                                                                                                                                                                                                                                                                                                Perhaps the most interesting fact evident in the graph is that GNU glibc, the C library used on Linux systems, has a linear-time glob implementation, but BSD libc, the C library used on BSD and macOS systems, has an exponential-time implementation.
                                                                                                                                                                                                                                                                                                                                                                                                                                PHP is not shown in the graph, because its glob function simply invokes the host C library’s glob(3), so that it runs in linear time on Linux and in exponential time on non-Linux systems. (I have not tested what happens on Windows.) All the languages shown in the graph, however, implement glob matching without using the host C library, so the results should not vary by host operating system.
                                                                                                                                                                                                                                                                                                                                                                                                                                The netkit ftpd runs quickly on Linux because it relies on the host C library’s glob function. If run on BSD, the netkit ftpd would take exponential time. ProFTPD ships a copy of the glibc glob, so it should run quickly even on BSD systems. Ironically, Pure-FTPd and tnftpd take exponential time on Linux because they ship a copy of the BSD glob function. Presumably they do this to avoid assuming that the host C library is bug-free, but, at least in this one case, the host C library is better than the one they ship.

                                                                                                                                                                                                                                                                                                                                                                                                                                • Additional Reading
                                                                                                                                                                                                                                                                                                                                                                                                                                • This post is an elaboration of an informal 2012 Google+ post showing that most shells used exponential-time glob expansion. At the time, Tom Duff, the author of Plan 9’s rc shell, commented that, “I can confirm that rc gets it wrong. My excuse, feeble as it is, is that doing it that way meant that the code took 10 minutes to write, but it took 20 years for someone to notice the problem. (That’s 10 ‘programmer minutes’, i.e. less than a day.)” I agree that’s a reasonable decision for a shell. In contrast, a language library routine, not to mention a network server, today needs to be robust against worst-case inputs that might be controlled by remote attackers, but nearly all of the code in question predates that kind of concern. I didn’t realize the connection to FTP servers until I started doing additional research for this post and came across a reference to CVE-2010-2632 in FreeBSD’s glob implementation.

                                                                                                                                                                                                                                                                                                                                                                                                                                  BSD VPS Providers Needed

                                                                                                                                                                                                                                                                                                                                                                                                                                  One of TDP’s recent projects is accumulating a list of virtual private server services (VPS) that provide a BSD option.

                                                                                                                                                                                                                                                                                                                                                                                                                                  VPS’s are generally inexpensive services that enable the user to only concern themselves with software configuration, and not be bothered with hardware or basic operating system setup. In the pre-Cloud era, VPS providers were the “other people’s computers” that users outsourced their systems to.
                                                                                                                                                                                                                                                                                                                                                                                                                                  The same shortcomings of cloud services apply to VPS providers. You don’t control the hardware. Your files are likely viewable by users up the directory hierarchy. The entropy source or pool is a single source for multiple systems. The same time drift applies to all time-keeping services.
                                                                                                                                                                                                                                                                                                                                                                                                                                  Nevertheless, VPS services are often cheap and provide a good spread in terms of geography. All a provider really needs is a few server-grade computers and a decent network connection. VPS’s are still a gateway drug to bare-metal servers, although it seems more and more of these gateway users stop at stage one.
                                                                                                                                                                                                                                                                                                                                                                                                                                  Cheap systems with a public IP are also a great way to tinker with a new operating system.
                                                                                                                                                                                                                                                                                                                                                                                                                                  For this reason, TDP created this list of BSD VPS providers. Some explicitly deny running Tor as a server. Some just reference vague “proxy services.” Others don’t mention Tor or proxies at all.
                                                                                                                                                                                                                                                                                                                                                                                                                                  The list is a start with currently just under 70 VPS providers listed. Input through various channels already started, and TDP intends to update the list over the coming months. A first draft email and open letter addressed to the providers were drafted, and we are looking to speak directly to at least some of the better-known BSD VPS providers.
                                                                                                                                                                                                                                                                                                                                                                                                                                  We may be able to convince a few to allow public Tor relays, or at least published bridges. These providers could be new BSD users’ gateway drug into the world of BSD Tor nodes. Running a Tor relay shouldn’t be considered a particularly risky activity. Maybe we can adjust that perception.
                                                                                                                                                                                                                                                                                                                                                                                                                                  Let us know any input via email or GitHub, and we’ll be glad to make updates.

                                                                                                                                                                                                                                                                                                                                                                                                                                  Beastie Bits
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Avoid OS Detection with OpenBSD
                                                                                                                                                                                                                                                                                                                                                                                                                                  • TrueOS update to fix updating
                                                                                                                                                                                                                                                                                                                                                                                                                                  • MidnightBSD 0.8.5 VirtualBox Install
                                                                                                                                                                                                                                                                                                                                                                                                                                  • BSD Pizza Night in Portland
                                                                                                                                                                                                                                                                                                                                                                                                                                  • ***
                                                                                                                                                                                                                                                                                                                                                                                                                                    Feedback/Questions
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Andrew - BSDCan videos?
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Marc - The Rock64 Board
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Jason - Follow up on UEFI and Bhyve
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Patrick - EFI booting
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ***
                                                                                                                                                                                                                                                                                                                                                                                                                                      1 hr 14 min

                                                                                                                                                                                                                                                                                                                                                                                                                                    About BSD Now

                                                                                                                                                                                                                                                                                                                                                                                                                                    From the publisher's feed

                                                                                                                                                                                                                                                                                                                                                                                                                                    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…

                                                                                                                                                                                                                                                                                                                                                                                                                                    More shows like BSD Now

                                                                                                                                                                                                                                                                                                                                                                                                                                    The Changelog: Software Development, Open Source by Changelog Media

                                                                                                                                                                                                                                                                                                                                                                                                                                    The Changelog: Software Development, Open Source

                                                                                                                                                                                                                                                                                                                                                                                                                                    286 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Security Now (Audio) by TWiT

                                                                                                                                                                                                                                                                                                                                                                                                                                    Security Now (Audio)

                                                                                                                                                                                                                                                                                                                                                                                                                                    2,011 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    MacBreak Weekly (Audio) by TWiT

                                                                                                                                                                                                                                                                                                                                                                                                                                    MacBreak Weekly (Audio)

                                                                                                                                                                                                                                                                                                                                                                                                                                    2,018 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Accidental Tech Podcast by Marco Arment, Casey Liss, John Siracusa

                                                                                                                                                                                                                                                                                                                                                                                                                                    Accidental Tech Podcast

                                                                                                                                                                                                                                                                                                                                                                                                                                    2,144 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    LINUX Unplugged by Jupiter Broadcasting

                                                                                                                                                                                                                                                                                                                                                                                                                                    LINUX Unplugged

                                                                                                                                                                                                                                                                                                                                                                                                                                    272 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Risky Business by Risky Business Media

                                                                                                                                                                                                                                                                                                                                                                                                                                    Risky Business

                                                                                                                                                                                                                                                                                                                                                                                                                                    374 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Late Night Linux by The Late Night Linux Family

                                                                                                                                                                                                                                                                                                                                                                                                                                    Late Night Linux

                                                                                                                                                                                                                                                                                                                                                                                                                                    169 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Darknet Diaries by Jack Rhysider

                                                                                                                                                                                                                                                                                                                                                                                                                                    Darknet Diaries

                                                                                                                                                                                                                                                                                                                                                                                                                                    8,063 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Behind the Bastards by Cool Zone Media and iHeartPodcasts

                                                                                                                                                                                                                                                                                                                                                                                                                                    Behind the Bastards

                                                                                                                                                                                                                                                                                                                                                                                                                                    15,564 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux Dev Time by The Late Night Linux Family

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux Dev Time

                                                                                                                                                                                                                                                                                                                                                                                                                                    22 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    2.5 Admins by The Late Night Linux Family

                                                                                                                                                                                                                                                                                                                                                                                                                                    2.5 Admins

                                                                                                                                                                                                                                                                                                                                                                                                                                    98 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux After Dark by The Late Night Linux Family

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux After Dark

                                                                                                                                                                                                                                                                                                                                                                                                                                    29 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    This Day in AI Podcast by Michael Sharkey, Chris Sharkey

                                                                                                                                                                                                                                                                                                                                                                                                                                    This Day in AI Podcast

                                                                                                                                                                                                                                                                                                                                                                                                                                    221 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux Matters by Linux Matters

                                                                                                                                                                                                                                                                                                                                                                                                                                    Linux Matters

                                                                                                                                                                                                                                                                                                                                                                                                                                    22 Listeners

                                                                                                                                                                                                                                                                                                                                                                                                                                    Better Offline by Cool Zone Media and iHeartPodcasts

                                                                                                                                                                                                                                                                                                                                                                                                                                    Better Offline

                                                                                                                                                                                                                                                                                                                                                                                                                                    608 Listeners