Today is the monday after FOSDEM 2014, and I'm slowly waking up.
Being in charge of the video team, and after having spent a whole
week preparing followed by a whole weekend stressing about, today is a
day of slowly waking up from hibernation and returning gear to various
rental companies.
At FOSDEM 2013, we had recorded five rooms. Even though we did lose a
few talks, I felt pretty good about the whole thing, and I think we did
pretty well then. It had been my plan to increase the number of rooms to
be recorded from 5 to a reasonably higher number say, 10 or
so but someone convinced me to
do all of them.
I'll readily admit I was afraid. Scratch that, I was terrified.
Petrified, that we wouldn't be able to pull it off. For previous
editions, we'd kept the number conservative, since video work is a
high-risk business: if something goes wrong with volunteers work (say,
the heralding volunteer doesn't show up), you find a replacement, or you
have a staff member introduce a speaker, and the show will go on.
Not so with video work: if something minor goes wrong, you will most
likely lose content. If something minor goes wrong in one devroom, I'll
deal with it. If something minor goes wrong in 20% of devrooms, that's 4
to 5 devrooms, and I can't deal with it. Moreover, finding enough
volunteers to manage the video for five rooms was a challenge last year;
I couldn't even begin to imagine how to do so for 22 of
them.
We did work out a way that didn't seem too far-fetched, and
that might work: why not look for volunteers from the devrooms
themselves? But then, they couldn't be expected to have the required
experience, so we'd have to do a lot of handholding.
The week before FOSDEM, four of us sat down in an office in Mechelen,
and started preparing. We had a lot to do; and when you do, more jobs
keep being added to the pile; TODO lists tend to grow longer, not
shorter. Installing servers, testing cameras, setting twinpact
dipswitches, configuring laptops. Changing a few tests in the config
management system, and having to go over the laptops again. Buying extra
gear. Buying yet more extra gear, several times. Buying cardboard boxes
when it appeared that the plastic foldable ones we'd ordered wouldn't
make it in time, and unloading the pallet of them when it did, after
all, so we could load them into the van with all of the other gear.
Laminating instruction sheets. Receiving shipments of rented gear.
Calling another supplier last minute when one of our other suppliers had
contacted us to let us know one of their cameras that they'd promised us
had broken down, and couldn't be repaired in time. Calling that
last-minute supplier again when we found out that some of the
cameras we'd rented could do HDV only (and not DV), and we needed to
find more than the ones we'd already asked for. Discovering that
his cameras were of the same problematic model and so
also couldn't be used. The feeling of relief when he called me
a few hours later and told me he'd managed to scrounge up enough cameras
to help us out after all.
And then it was time to go to the ULB and start setting up
everything. On friday, we had a little bit of help, but did have to do
most of it ourselves. After setting up everything in every room and
testing as much as possible within the time constraints that we had, we
picked up the most expensive bits of the gear, brought it down to a safe
place, and went home.
On saturday and sunday, for me it was mostly a matter of handing out
gear to various devrooms, running around to fix various issues, and then
in the evening receiving boxes back, using a checklist to ensure
everything expected was in the box (and that things not needed would
remain in the room, or be sent back).
It was exhausting, to the extent that on saturday afternoon, I had to
take a bit of time off so I could go and rest.
I think it's safe to say that something like this hasn't been done
before. FOSDEM is a huge conference; most conferences with multiple
rooms don't have more somewhere between 5 and 10 of them. The fact that
we have so many more, and the fact that we record all
of them, puts FOSDEM video work in a class of its own, to the extent
that the professional cameramen I talked to in order to get the right
cameras would incredulously ask "what do you need that for?"
when I gave them the numbers we needed.
As such, I didn't expect, nor was aiming for, perfection.
Unfortunately, with video work it is close to impossible to attain
perfection; I have told multiple people during the event that I would be
happy if we reached 85% of talks recorded at acceptable quality; and
though it is much too soon to say for certain, my gut feeling tells m
that we've probably achieved that.
One thing we hadn't planned for was streaming. During the past three
years, FOSDEM enlisted the help and sponsorship of flumotion to get
streaming going. Unfortunately, that did not work out this year; and
since we already had far too much on our plates with everything else, we
decided to forego streaming and focus on recording, only.
A few days before the event, however, Steinar
Gunderson took it upon himself to fix that. While we couldn't
support him a great deal, we could give him access to the secondary
laptops (which weren't otherwise doing much anyway) on which he could
then do his thing. This was mostly transparent to us; we did communicate
to some extent (e.g., when a machine that had been down had fixed and
was working again), but he mostly did his thing while we did ours. Full
details, for those who want it, in the linked blog post.
Today, then, I spent most of my time handling hardware: waiting for
other members of FOSDEM to drive the van up to my office; waiting for
the laptop rental company to retrieve most of the laptops; waiting for
two of the camera rental companies to retrieve their cameras and
tripods; driving over to the final camera rental company to return their
cameras and tripods; and finally, driving up to the ULB to retrieve the
last laptops who had been copying files all night.
As I write this, some video files have already been uploaded to
the FOSDEM video archive. However,
these are extremely low-quality renditions of video snippets that need
to be reviewed; they are not ready yet for public consumption. When
those files exist, expect an announcement through the main FOSDEM website.
Back in 2006, the compiler in Ubuntu was patched to enable most build-time security-hardening features (relro, stack protector, fortify source). I wasn t able to convince Debian to do the same, so Debian went the route of other distributions, adding security hardening flags during package builds only. I remain disappointed in this approach, because it means that someone who builds software without using the packaging tools on a non-Ubuntu system won t get those hardening features. Think of a sysadmin trying the latest nginx, or a vendor like Valve building games for distribution. On Ubuntu, when you do that ./configure && make you ll get the features automatically.
Debian, at the time, didn t have a good way forward even for package builds since it lacked a concept of global package build flags . Happily, a solution (via dh) was developed about 2 years ago, and Debian package maintainers have been working to adopt it ever since.
So, while I don t think any distro can match Ubuntu s method of security hardening compiler defaults, it is valuable to see the results of global package build flags in Debian on the package archive. I ve had an on-going graph of the state of build hardening on both Ubuntu and Debian for a while, but only recently did I put together a comparison of a default install. Very few people have all the packages in the archive installed, so it s a bit silly to only look at the archive statistics. But let s start there, just to describe what s being measured.
Here s today s snapshot of Ubuntu s development archive for the past year (you can see development opening after a release every 6 months with an influx of new packages):
Here s today s snapshot of Debian s unstable archive for the past year (at the start of May you can see the archive unfreezing after the Wheezy release; the gaps were my analysis tool failing):
Ubuntu s lines are relatively flat because everything that can be built with hardening already is. Debian s graph is on a slow upward trend as more packages get migrated to dh to gain knowledge of the global flags.
Each line in the graphs represents the count of source packages that contain binary packages that have at least 1 hit for a given category. ELF is just that: a source package that ultimately produces at least 1 binary package with at least 1 ELF binary in it (i.e. produces a compiled output). The Read-only Relocations ( relro ) hardening feature is almost always done for an ELF, excepting uncommon situations. As a result, the count of ELF and relro are close on Ubuntu. In fact, examining relro is a good indication of whether or not a source package got built with hardening of any kind. So, in Ubuntu, 91.5% of the archive is built with hardening, with Debian at 55.2%.
The stack protector and fortify source features depend on characteristics of the source itself, and may not always be present in package s binaries even when hardening is enabled for the build (e.g. no functions got selected for stack protection, or no fortified glibc functions were used). Really these lines mostly indicate the count of packages that have a sufficiently high level of complexity that would trigger such protections.
The PIE and immediate binding ( bind_now ) features are specifically enabled by a package maintainer. PIE can have a noticeable performance impact on CPU-register-starved architectures like i386 (ia32), so it is neither patched on in Ubuntu, nor part of the default flags in Debian. (And bind_now doesn t make much sense without PIE, so they usually go together.) It s worth noting, however, that it probably should be the default on amd64 (x86_64), which has plenty of available registers.
Here is a comparison of default installed packages between the most recent stable releases of Ubuntu (13.10) and Debian (Wheezy). It s clear that what the average user gets with a default fresh install is better than what the archive-to-archive comparison shows. Debian s showing is better (74% built with hardening), though it is still clearly lagging behind Ubuntu (99%):
2014, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
A new major release 0.11.0 of
Rcpp is now
on the CRAN network for
GNU R and
binaries for Debian have been uploaded
as well.
Before you read on, please note that this release will most likely
require a reinstallation of all your packages using
Rcpp
as it now works without a user-facing shared library.
The biggest change in this version is that it is now effectively
headers-only. Before you wonder, there is still compiled code provided by
Rcpp for use by
packages. But this uses the function registration mechanism of
GNU R instead via
instantiation at package startup. This does make package building easier,
will remove the need to query GNU R for the
Rcpp library file in
src/Makevars when compiling, and should generally avoid building issues such
as the dreaded fails on paths with spaces still annoying users of a
certain OS.
There are a number of other fixes, upgrades and other extensions detailed in
NEWS file extract below, in the ChangeLog file in the package and on the
Rcpp Changelog page
as well as in a release announcement I'll post later.
Changes in Rcpp version 0.11.0 (2014-02-02)Thanks to CRANberries, you can also look at a diff to the previous release 0.10.6. As always, even fuller details are on the Rcpp Changelog page and the Rcpp page which also leads to the downloads, the browseable doxygen docs and zip files of doxygen output for the standard formats. A local directory has source and documentation too. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page
- Changes in Rcpp API:
- Functions provided/used by Rcpp are now registered with R and instantiated by client package alleviating the need for explicit linking against
libRcppwhich is therefore no longer created.- Updated the
Rcpp.package.skeleton()function accordingly.- New class
StretchyListfor pair lists with fast addition of elements at the front and back. This abstracts the 3 functionsNewList,GrowListandInsertused in various packages and in parsers in R.- The function
dnt,pnt,qntsugar functions were incorrectly expanding to the no-degree-of-freedoms variant.- Unit tests for
pntwere added.- The sugar table function did not handle NAs and NaNs properly for numeric vectors. Fixed and tests added.
- The internal coercion mechanism mapping numerics to strings has been updated to better match R (specifically with
Inf,-Inf, andNaN.)- Applied two bug fixes to Vector
sort()andRObjectdefinition spotted and corrected by Kevin Ushey- New
checkUserInterrupt()function that provides a C++ friendly implementation ofR_CheckUserInterrupt.- Changes in Rcpp attributes:
- Embedded R code chunks in sourceCpp are now executed within the working directory of the C++ source file.
- Embedded R code chunks in sourceCpp can now be disabled.
- Changes in Rcpp documentation:
- The Rcpp-FAQ and Rcpp-package vignettes have been updated and expanded.
- Vignettes are now typeset with grey background for code boxes.
- The bibtex reference file has been update to reflexct current package versions.
- Changes in Rcpp unit tests:
- The file
tests/doRUnit.Rwas rewritten following the pattern deployed in RProtoBuf which is due to Murray Stokely- The function
test()was rewritten; it provides an easy entry point to running unit tests of the installed package
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Somewhere back in August or September, I pre-ordered a CuBox-i A nicely finished, completely hackable, and reasonably powerful ARM system, nicely packaged and meant to be used to hack on. A sweet deal!
There are four models (you can see the different models' specs here) I went for the top one, and bought a CuBox-i4Pro. That means, I have a US$130 nice little box, with 4 ARM7 cores, 2GB RAM, WiFi, and... well, all of its basic goodies and features. For some more details, look at the CuBox-i block diagram.
I got it delivered by early January, and (with no real ARM experience on my side) I finally got to a point where I can, I believe, contribute something to its adoption/usage: How to get a basic Debian system installed and running in it.
The ARM world is quite different to the x86 one: Compatibility is much harder, the computing platform does not self-describe properly, and a kernel must first understand how a specific subarchitecture is before being able to boot on it. Somewhere in the CuBox forums (or was it the IRC channel?) I learnt that the upstream Linux kernel does not yet boot on the i.MX6 chip (although support is rumored to be merged for the 3.14 release), so I am using both a kernel and an uBoot bootloader not built for (or by) Debian people. Besides that, the result I will describe is a kosher Debian install. Yes, I know that my orthodox friends and family will say that 99% kosher is taref... But remember I'm never ever that dogmatic. (yeah, right!)
Note that there is a prebuilt image you can run if you are so inclined: In the CuBox-i forums and wiki, you will find links to a pre-installed Debian image you can use... But I cannot advise to do so. First, it is IMO quite bloated (you need a 4GB card for a very basic Debian install? Seriously?) Second, it has a whole desktop environment (LXDE, if I recall correctly) and a whole set of packages I will probably not use in this little box. Third, there is a preinstalled user, and that's a no-no (user: debian, password: debian). But, most importantly, fourth: It is a nightly build of the Testing (Jessie) suite... Built back in December. So no, as a Debian Developer, it's not something we should recommend our users to run!
So, in the end and after quite a bit of frustration due to my lack of knowledge, here goes the list of steps I followed:
# dd if=SPL-U-Boot.img of=/dev/mmcblk0 bs=1024 seek=1.# dd if=busybox.img of=/dev/mmcblk0debootstrap --foreign --arch=armhf wheezy /media/mmcblk0p2 http://http.debian.net/debian
U-Boot SPL 2013.10-rc4-gd05c5c7-dirty (Jan 12 2014 - 02:18:28) Boot Device: SD1 reading u-boot.img Load image from RAW... U-Boot 2013.10-rc4-gd05c5c7-dirty (Jan 12 2014 - 02:18:28) CPU: Freescale i.MX6Q rev1.2 at 792 MHz Reset cause: POR Board: MX6-CuBox-i DRAM: 2 GiB MMC: FSL_SDHC: 0 In: serial Out: vga Err: vga Net: phydev = 0x0 Phy not found PHY reset timed out FEC (Re)start USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found Hit any key to stop autoboot: 3
# mount /dev/mmcblk0p2 /mnt# chroot /mnt# debootstrap --second-stage
# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully # echo cubox-i.gwolf.org > /etc/hostname
# echo 'T0:23:respawn:/sbin/getty -L ttymxc0 115200 vt100' >> /etc/inittab
# exit # umount /mnt # mount / -o remount,ro
CuBox-i U-Boot > setenv root /dev/mmcblk0p2 rootfstype=ext3 ro rootwait CuBox-i U-Boot > boot
** File not found /boot/busyEnv.txt ** 4703740 bytes read in 390 ms (11.5 MiB/s) ## Booting kernel from Legacy Image at 10000000 ... Image Name: Linux-3.0.35-8 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4703676 Bytes = 4.5 MiB Load Address: 10008000 Entry Point: 10008000 Verifying Checksum ... OK Loading Kernel Image ... OK Starting kernel ... Unable to get enet.0 clock pwm-backlight pwm-backlight.0: unable to request PWM for backlight pwm-backlight pwm-backlight.1: unable to request PWM for backlight _regulator_get: get() with no identifier mxc_sdc_fb mxc_sdc_fb.2: NO mxc display driver found! INIT: version 2.88 booting [info] Using makefile-style concurrent boot in runlevel S. [....] Starting the hotplug events dispatcher: udevd. ok [....] Synthesizing the initial hotplug events...done. [....] Waiting for /dev to be fully populated...done. [....] Activating swap...done. [....] Cleaning up temporary files... /tmp. ok [....] Activating lvm and md swap...done. [....] Checking file systems...fsck from util-linux 2.20.1 done. [....] Mounting local filesystems...done. [....] Activating swapfile swap...done. [....] Cleaning up temporary files.... ok [....] Setting kernel variables ...done. [....] Configuring network interfaces...done. [....] Cleaning up temporary files.... ok [....] Setting up X socket directories... /tmp/.X11-unix /tmp/.ICE-unix. ok INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] Starting enhanced syslogd: rsyslogd. ok [....] Starting periodic command scheduler: cron. ok Debian GNU/Linux 7 cubox-i.gwolf.org ttymxc0 cubox-i login:
root@cubox-i:~# apt-get clean root@cubox-i:~# df -h Filesystem Size Used Avail Use% Mounted on rootfs 1008M 347M 611M 37% / /dev/root 1008M 347M 611M 37% / devtmpfs 881M 0 881M 0% /dev tmpfs 177M 132K 177M 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 353M 0 353M 0% /run/shm
While the user may have simply pressed the "call" button, Lumicall alerts them to several ways that they may proceed:
| On purpose | By mistake | |
|---|---|---|
| Good | Feature | |
| Bad | Bug |
| On purpose | By mistake | |
|---|---|---|
| Good | Feature | |
| Bad | Antifeature | Bug |
| On purpose | By mistake | |
|---|---|---|
| Good | Feature | Antibug |
| Bad | Antifeature | Bug |
"To demonstrate the usefulness of this type of analysis, we turned our attention to criminal activity. In the Bitcoin economy, criminal activity can appear in a number of forms, such as dealing drugs on Silk Road or simply stealing someone else s bitcoins. We followed the flow of bitcoins out of Silk Road (in particular, from one notorious address) and from a number of highly publicized thefts to see whether we could track the bitcoins to known services. Although some of the thieves attempted to use sophisticated mixing techniques (or possibly mix services) to obscure the flow of bitcoins, for the most part tracking the bitcoins was quite straightforward, and we ultimately saw large quantities of bitcoins flow to a variety of exchanges directly from the point of theft (or the withdrawal from Silk Road). As acknowledged above, following stolen bitcoins to the point at which they are deposited into an exchange does not in itself identify the thief; however, it does enable further de-anonymization in the case in which certain agencies can determine (through, for example, subpoena power) the real-world owner of the account into which the stolen bitcoins were deposited. Because such exchanges seem to serve as chokepoints into and out of the Bitcoin economy (i.e., there are few alternative ways to cash out), we conclude that using Bitcoin for money laundering or other illicit purposes does not (at least at present) seem to be particularly attractive."These researches are not the first to analyse the Bitcoin transaction log. The 2011 paper "An Analysis of Anonymity in the Bitcoin System" by Fergal Reid and Martin Harrigan is summarized like this:
"Anonymity in Bitcoin, a peer-to-peer electronic currency system, is a complicated issue. Within the system, users are identified by public-keys only. An attacker wishing to de-anonymize its users will attempt to construct the one-to-many mapping between users and public-keys and associate information external to the system with the users. Bitcoin tries to prevent this attack by storing the mapping of a user to his or her public-keys on that user's node only and by allowing each user to generate as many public-keys as required. In this chapter we consider the topological structure of two networks derived from Bitcoin's public transaction history. We show that the two networks have a non-trivial topological structure, provide complementary views of the Bitcoin system and have implications for anonymity. We combine these structures with external information and techniques such as context discovery and flow analysis to investigate an alleged theft of Bitcoins, which, at the time of the theft, had a market value of approximately half a million U.S. dollars."I hope these references can help kill the urban myth that Bitcoin is anonymous. It isn't really a good fit for illegal activites. Use cash if you need to stay anonymous, at least until regular DNA sampling of notes and coins become the norm. :) As usual, if you use Bitcoin and want to show your support of my activities, please send Bitcoin donations to my address 15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.
The 3D-printing technology has gained quite a big momentum in recent times. Its use is spreading widely even among hobbyists and many sources report daily several (sometimes weird) examples of its usage. The thing I like most, as a Free Software activist, is that several 3D-printing-related free and open source software are already available and quite good, and some printers are even released as free hardware.
Unfortunately, Debian is quite lagged behind with regard to the availability of such software in our archive, especially compared to other distributions who already ship much of it. Hopefully this situation will change drastically thanks to the brand new Debian 3D-Printing team, whose purpose is to make Debian a rocking platform to do some serious 3D-printing.
The team is bootstrapping right now, and we are looking for volunteers who are willing to help us. Packagers are greatly welcomed, but also triagers, users and passionate people with some experience in the field are extremely valuable.
People willing to join the team can take a look at our (in-progress) wiki page and apply on the team page on Alioth. As with any good packaging team, a mailing list is available to share ideas, feel free to subscribe it, and feel free to join #debian-3dprinting on OFTC if you want to hang out with other team members.
Yesterday was the first day of my new routine, except I haven't really
established the new routine yet. I think that's going to take a few weeks. It
was, however, the first day of Zoe's new routine, she started Kindergarten.
"Kindergarten" is a bit of an ambiguous term, even within Australia, it
seems. Back when I went to school, there was "pre-school", which was, as
best I can determine, what "Kindergarten" is now, except a year later. It
was optional, half a week, and the year preceding the start of primary
("elementary") school. I think every other state was already doing an extra
year of school (which I think they called "Kindergarten", "Kinder", or
something starting with "K") so Queensland blew up "pre-school", created
"Prep" and now that's the first year of primary school. Zoe will start
"Prep" next year.
Then the Queensland education boffins realised that kids were missing out on
the stuff that "pre-school" used to offer, so they reintroduced it in the
form of "Kindergarten"
(by Queensland standards). It's supposed to be play-based, and isn't really
"long day care". Zoe does Monday, Tuesday and every other Wednesday, from
8:30am until 2:20pm.
I'd only heard about C&K from a
friend after moving back to Brisbane, so we were very fortunate to secure a
place without having camped out on a waiting list from birth. We got very
lucky, and ended up getting multiple offers, but we're pretty thrilled with
the one that Zoe got into. It's a relatively new facility, right next to a
state school and some bushland. They take the kids on excursions into the
bushland, and up to the state school where there's some chickens. The
Kindergarten facility itself is really lovely.
Anyway, yesterday was Zoe's first day. I biked there yesterday morning
(without Zoe) and it took me about 11 minutes. It took me more like 15
minutes to pick her up with the bike trailer. It's uphill on the way there,
but not too much of a slog.
It's been really great that Zoe's BFF from day care, Megan, also scored a
place in the same Kindergarten, as I think this will help the transition for
both girls greatly.
I was able to stay for an extended period of time to help settle Zoe in, and
I was able to leave without her being particularly distressed.
I then biked home, running a few errands along the way. I then got stuck
into a woodworking project (I'm trying to make a
little wooden clothesline for Zoe).
It turns out trying to cut a halved joint with a
hand saw and chisel is a lot of work. I've managed to aggravate an old
rotator cuff injury and the two pieces are a tad too tight, so I'm thinking
I'll redo it and cut the joint out with an electric router instead. I
probably spent at least a couple of hours faffing around with that.
So I banged away with a hammer and chisel for a bit, got a haircut, had a
late lunch and next thing I knew it was 2pm and time to head back on the
bike to pick up Zoe.
She was still asleep on her stretcher when I arrived to pick her up, which
wasn't that surprising, since she tends to sleep later and longer at day
care. I got a good opportunity to chat with her teacher about her first day
and then gently woke her up with a kiss, and we headed home.
I introduced Zoe to one of our new neighbours, and after a snack, we drove
into Fortitude Valley where I had to pick up some mail from my post office
box. When we got back home, I started on dinner while Zoe watched a little
bit of TV. I spontaneously invited my cousin over to join us for dinner, and
we walked down to the Hawthorne Garage for a babyccino after dinner.
It was a good day.
I realised that I'm going to have to be super regimented with my time on the
days Zoe is in Kindergarten, because 2pm is going to roll around very
quickly. "Scarcity brings clarity", as Sergey says...
A new minor / maintenance release RQuantLib 0.3.11
is now on CRAN and
in Debian.
Like the RcppClassic upload two days ago
and the RcppZiggurat and
RcppEigen uploads yesterday,
this release was motivated at least in part by an upcoming Rcpp release about
which I should have more to day soon. A few things got polished and
updated, and we added a plugin which should make use via Rcpp Attribute easier.
RQuantLib
combines (some of) the quantitative analytics of
QuantLib with the
R statistical computing environment and language.
Thanks to
CRANberries, there is
also a
diff to the previous release 0.3.10.
Full changelog details, examples and more details about this package are at
my RQuantLib page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
There will be a new option in gcc 4.9 named -fstack-protector-strong , which offers an improved version of -fstack-protector without going all the way to -fstack-protector-all . The stack protector feature itself adds a known canary to the stack during function preamble, and checks it when the function returns. If it changed, there was a stack overflow, and the program aborts. This is fine, but figuring out when to include it is the reason behind the various options.
Since traditionally stack overflows happen with string-based manipulations, the default (-fstack-protector), only includes the canary code when a function defines an 8 (--param=ssp-buffer-size=N, N=8 by default) or more byte local character array. This means just a few functions get the checking, but they re probably the most likely to need it, so it s an okay balance. Various distributions ended up lowering their default --param=ssp-buffer-size option down to 4, since there were still cases of functions that should have been protected but the conservative gcc upstream default of 8 wasn t covering them.
However, even with the increased function coverage, there are rare cases when a stack overflow happens on other kinds of stack variables. To handle this more paranoid concern, -fstack-protector-all was defined to add the canary to all functions. This results in substantial use of stack space for saving the canary on deep stack users, and measurable (though surprisingly still relatively low) performance hit due to all the saving/checking. For a long time, Chrome OS used this, since we re paranoid. :)
In the interest of gaining back some of the lost performance and not hitting our Chrome OS build images with such a giant stack-protector hammer, Han Shen from the Chrome OS compiler team created the new option -fstack-protector-strong, which enables the canary in many more conditions:
-fstack-protector-all for about 10 months now.
As a quick demonstration of the options, you can see this example program under various conditions. It tries to show off an example of shoving serialized data into a non-character variable, like might happen in some network address manipulations or streaming data parsing. Since I m using memcpy here for clarity, the builds will need to turn off FORTIFY_SOURCE, which would also notice the overflow.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct no_chars
unsigned int len;
unsigned int data;
;
int main(int argc, char * argv[])
struct no_chars info = ;
if (argc < 3)
fprintf(stderr, "Usage: %s LENGTH DATA...\n", argv[0]);
return 1;
info.len = atoi(argv[1]);
memcpy(&info.data, argv[2], info.len);
return 0;
Built with everything disabled, this faults trying to return to an invalid VMA:
$ gcc -Wall -O2 -U_FORTIFY_SOURCE -fno-stack-protector /tmp/boom.c -o /tmp/boom $ /tmp/boom 64 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Segmentation fault (core dumped)Built with FORTIFY_SOURCE enabled, we see the expected catch of the overflow in
memcpy:
$ gcc -Wall -O2 -D_FORTIFY_SOURCE=2 -fno-stack-protector /tmp/boom.c -o /tmp/boom $ /tmp/boom 64 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *** buffer overflow detected ***: /tmp/boom terminated ...So, we ll leave FORTIFY_SOURCE disabled for our comparisons. With pre-4.9 gcc, we can see that
-fstack-protector does not get triggered to protect this function:
$ gcc -Wall -O2 -U_FORTIFY_SOURCE -fstack-protector /tmp/boom.c -o /tmp/boom $ /tmp/boom 64 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Segmentation fault (core dumped)However, using
-fstack-protector-all does trigger the protection, as expected:
$ gcc -Wall -O2 -U_FORTIFY_SOURCE -fstack-protector-all /tmp/boom.c -o /tmp/boom $ /tmp/boom 64 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *** stack smashing detected ***: /tmp/boom terminated Aborted (core dumped)And finally, using the gcc snapshot of 4.9, here is
-fstack-protector-strong doing its job:
$ /usr/lib/gcc-snapshot/bin/gcc -Wall -O2 -U_FORTIFY_SOURCE -fstack-protector-strong /tmp/boom.c -o /tmp/boom $ /tmp/boom 64 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *** stack smashing detected ***: /tmp/boom terminated Aborted (core dumped)For Linux 3.14, I ve added support for
-fstack-protector-strong via the new CONFIG_CC_STACKPROTECTOR_STRONG option. The old CONFIG_CC_STACKPROTECTOR will be available as CONFIG_CC_STACKPROTECTOR_REGULAR. When comparing the results on builds via size and objdump -d analysis, here s what I found with gcc 4.9:
A normal x86_64 defconfig build, without stack protector had a kernel text size of 11430641 bytes with 36110 function bodies. Adding CONFIG_CC_STACKPROTECTOR_REGULAR increased the kernel text size to 11468490 (a +0.33% change), with 1015 of 36110 functions stack-protected (2.81%). Using CONFIG_CC_STACKPROTECTOR_STRONG increased the kernel text size to 11692790 (+2.24%), with 7401 of 36110 functions stack-protected (20.5%). And 20% is a far-cry from 100% if support for -fstack-protector-all was added back to the kernel.
The next bit of work will be figuring out the best way to detect the version of gcc in use when doing Debian package builds, and using -fstack-protector-strong instead of -fstack-protector. For Ubuntu, it s much simpler because it ll just be the compiler default.
2014, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
A new maintenance release of
RcppEigen is now on
CRAN. And just like
yesterday's RcppClassic upload
and
today's RcppZiggurat upload,
the timing was motivated chiefly by some minor caretaking for an upcoming
Rcpp release --
hopefully soon, and with more details to follow.
But this release also contains some minor cleanups. The NEWS
file entry shown below lists all changes.
Changes in RcppEigen version 0.3.2.0.2 (2014-01-26)Courtesy of CRANberries, there are diffstat reports for the most recent release relative to the preceding version. Questions, comments etc about RcppEigen should go to the rcpp-devel mailing list off the R-Forge page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new maintenance release of
RcppZiggurat
is now on CRAN. And just like
yesterday's RcppClassic upload,
this is motivated chiefly by some minor caretaking for an upcoming
Rcpp release --
hopefully soon, and with more details to follow.
This release also contains some small extensions and work-in-progress. By
using R's uniform generator, we can fall back to R's seeding of the RNG --
but going through the R data structures has a performance hit. Similarly,
and somewhat surprisingly, the default generators in both Boost and the C++11
library are not all that speedy.
The NEWS file entry shown below lists all changes.
Changes in version 0.1.2 (2013-12-28)Courtesy of CRANberries, there are diffstat reports for the most recent release relative to the preceding version. More detailed information is on the RcppZiggurat page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.
- Add a new generator deploying R's unif_rand which faciliates use of Ziggurat as the user-supplied generator for N(0,1)
- Update a 'local' demo comparing normal distribution RNGs from Boost, C++11 and Armadillo none of which are particularly speedy
- Add declaration to import a symbol from Rcpp to
NAMESPACEto ensure proper instantiation with the upcoming Rcpp version
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A maintenance release of RcppClassic, now at version 0.9.5, went out to
CRAN today. Nothing changed in
user-facing code. The build was triggered by a change in an upcoming Rcpp
release (more about that another time), and a few minor updates were needed
for extended checks done by R.
Courtesy of CRANberries, there is
the set of changes relative to
the previous release 0.9.4.
Questions, comments etc should go to the
rcpp-devel mailing list
off the R-Forge page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Friday was my last day
at Solarflare
Communications, which I joined in 2006 (originally as Level 5
Networks).
When I started, Level 5 Networks (L5N) had a 2-port gigabit Ethernet
controller called EF1 and a user-level network stack called
EtherFabric which ran on Linux. It had nearly completed the Falcon
project to develop a 10-gigabit controller (also supporing a 2-port
gigabit mode) and was porting EtherFabric to Windows. Later that
year, however, L5N merged with Solarflare Communications (SF), which
was developing a 10GBASE-T PHY (for 10-gigabit Ethernet over
twisted-pair cables). The investors and management saw the
opportunity to create an integrated 10GBASE-T LAN-on-motherboard
chip that would be attractive to OEMs and so had the potential for
mass sales. EtherFabric was put on the back-burner, but regular net
drivers for Linux, Windows and other operating systems became more
important.
In a change from my previous jobs, my initial role at L5N was to
maintain and extend the in-house test automation software, Runbench,
written in Python. I worked with Dickon Reed who had written most
of Runbench up to then. One of my first major tasks was to extend
it to cover DUTs running Windows. Aside from changing Runbench
itself, I wrote a simple SSH server to be installed on DUTs, using
the
Twisted.Python framework.
(Cygwin's port of OpenSSH wasn't suitable for running a lot of
native Windows commands.) I rewrote the test-installation script
for the Windows driver itself, converting it to Python (with a C
extension to get around
the WOW64
nonsense). As Windows does not allow loading a driver just once
(like insmod in Linux), except by using the kernel
debugger, I added a time check in the driver so the
test-installation script can make it fail early when reloaded after
a reboot, so that a crasher bug in the probe path would usually be
recoverable.
In 2007 I persuaded management in Cambridge to loan several older
servers to DebConf. I
took them there and back by car, and they were used to convert video
for live streams
and recordings.
(This was repeated in 2009.)
I was also asked to work on other small development tasks, including
some cleanup on the Linux net driver (sfc). In mid-2007, when SF
decided it was time to get sfc upstream (in-tree), I joined Steve
Hodgson and Robert Stonehouse in working on that.
Out-of-tree (separately distributed) drivers for Linux normally need
a large number of preprocessor conditions for compatibility with
Linux's kernel
module API across a range of supported versions. They may also
implement some features with a driver-specific interface that should
be replaced with a standard interface (possibly including the work
to define that standard). They may not comply with the kernel
coding style or unwritten conventions for kernel code. All of these
problems were present and had to be dealt with. As part of this
work, I extended unifdef
so that it could be used to remove all of the backward-compatibility
and not-for-upstream code without introducing extra blank lines. I
could then export the out-of-tree driver from CVS(!) into a kernel
source tree automatically and turn it into a patch or patch series
that would stand a chance of being acceptable upstream.
Our
first
few
attempts
got
little
response,
but eventually we newbies got the message that the driver was simply
too
big for a single submission and that putting patches on a web
site because they're too big for the list was not a solution. In
the next week, I removed about half of the code (on a git branch),
resulting in a relatively lean driver that could be sent to the
netdev list. And finally the 9th (I think) submission
was accepted.
Following this, I continued to work on sfc but was also brought into
the Siena project. Siena (SFL9021) was the LAN-on-motherboard chip
that had been planned following the merger. It combined a dual-port
controller based on Falcon with a 10GBASE-T PHY and a management
controller (MC) to support Lights-Out Management (LOM). (Since
10GBASE-T has not taken off, it is now mostly sold as the SFC9020
variant in which the PHY is disabled.) I worked on some of the test
framework and test cases for validating the controller design in
software simulation and FPGA. In the course of this I learned to
read and (somewhat) understand the chip design written in Verilog,
but only made a single trivial fix to it.
In August 2009, the first Siena ASICs came back from the fab. There
were a few ASIC-specific bugs but all of them were quickly worked
around in firmware, so it would soon be ready for production. But
there was much work still to be done on the driver and firmware.
The firmware had until then been running in a smaller block of RAM
with no peripherals to manage, while sfc had earlier been modified
just enough to configure a sim or FPGA for running a userland test
application. sfc now had many special cases scattered around it,
and would tell the MC firmware to peek and poke registers that were
no longer directly accessible from the host.
The software and firmware developers had agreed that, in order to
support LOM, the MC would be responsible for managing the ports and
all peripherals and drivers would send higher-level requests to the
MC. As a bonus, this removed the need for the driver to know the
details of each new board, so that it would not be necessary to
backport sfc into distribution kernels very often. Over the next
few months, the firmware team did an excellent job of defining and
implementing those operations, including writing the driver-side
functions to invoke them. Meanwhile, Steve and I concentrated on
refactoring sfc so most of the Falcon/Siena differences could be
abstracted through a few structures with function pointers.
The refactoring and new code for Siena were completed and submitted
upstream in several large patch series in October and November. In
fact, there were so many patches that Solarflare appeared in LWN's
table of who wrote Linux
2.6.33 (as did I, thanks also to another patch series adding
firmware metadata to many drivers). Sadly we had missed Linux
2.6.32 which was a longterm stable branch and used in many
distributions, but I was able to get this version backported into
all the major distributions over the next year.
(To be continued.)
Next.