chroot(8) on steroids if you
will).
While the whole raison d' tre behind this project was "just because", and many
more mature solutions exist, I decided that it'd be nice to find an actual use
case for this (otherwise I tend to lose interest pretty quickly) so I wrote a
lil (and rather dumb) pbuilder clone that uses pflask instead of chroot.
The nice thing about pflask is that, differently from e.g. LXC, it doesn't need
any pre-configuration and can be used directly on a vanilla debootstrap(8)ed
Debian system:
$ sudo mkdir -p /var/cache/pflask $ sudo debootstrap --variant=buildd $DIST /var/cache/pflask/base-$DIST-$ARCHWhere
$DIST and $ARCH are e.g. unstable and amd64.
Once that's done just run pflask-debuild on the package sources:
$ apt-get source somepackage $ cd somepackage-XYX $ pflask-debuildThe script will take care of creating a new container,
chroot(2)ing into it,
installing all the required dependencies, building and signing the package (it
also runs lintian!).
The main difference from pbuilder is that pflask will mount a copy-on-write
filesystem (using AuFS) on the / of the container so that any modification
(e.g. installation of packages) can be easily discarded once the container
terminates (similarly to what cowbuilder(8) does, modulo the hardlinks hack).
Additionally, thanks to the mount namespace created inside the container, all
of this will be isolated from the host system and other containers, so that
multiple packages can be built simultaneously on the same base debootstrapped
directory.
Another possibility would be that of disabling the network inside the container
using a network namespace, in order to prevent the package build system from
downloading stuff from Internet while at the same time maintaining the network
active on the host system, but I haven't done any experiment in this direction
yet.
Note though that all of this is rather crude and experimental, but as a little
hack it seems to work rather well (YMMV).
A maintenance release (now at version 0.1.2) of my RcppDE package (previously
described in these
two posts)
is now CRAN.
More details about the package are available in the
vignette
also included in the RcppDE R package.
Changes were minimal and driven mostly by some CRAN Policy changes which now
prefer vignette sources files in (top-level) directory vignettes/
Courtesy of CRANberries, there
is also a diffstat report for the
most recent release.
Current and previous releases are available here
as well as on CRAN.
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 my random
package for truly (hardware-based) random numbers (pulled from
random.org) is now on
CRAN.
It's
been
a
while
since previous releases.
The package is described in a detailed
vignette
as well as in a
essay
by Mads Haahr.
Changes were minimal and driven mostly by some CRAN Policy changes which now
prefer vignette sources files in (top-level) directory vignettes/
Courtesy of CRANberries, there
is also a diffstat report for the
most recent release.
Current and previous releases are available here
as well as on CRAN.
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 (now at version 0.2.5) of my gcbd package (described
only in these
two posts)
is now CRAN.
More details about the package are available in the
paper which is
also included in the gcbd R package.
Changes were minimal and driven mostly by some CRAN Policy changes which now
prefer vignette sources files in (top-level) directory vignettes/
Courtesy of CRANberries, there
is also a diffstat report for the
most recent release.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Fingerprints and Key IDsOpenPGPv4 fingerprints are made from an SHA-1 digest over the key's public key material, creation date, and some boilerplate. SHA-1 digests are 160 bits in length. The "long key ID" of a key is the last 64 bits of the key's fingerprint. The "short key ID" of a key is the last 32 bits of the key's fingerprint. You can see both of the key IDs as a hash in and of themselves, as "32-bit truncated SHA-1" is a sort of hash (albeit not a cryptographically secure one). I'm arguing here that short Key IDs and long Key IDs are actually useless, and we should stop using them entirely where we can do so. We certainly should not be exposing normal human users to them. (Note that I am not arguing that OpenPGP v4 fingerprints themselves are cryptographically insecure. I do not believe that there are any serious cryptographic risks currently associated with OpenPGP v4 fingerprints. This post is about Key IDs specifically, not fingerprints.)Key IDs have serious problemsAsheesh pointed out two years ago that OpenPGP short key IDs are bad because they are trivial to replicate. This is called a preimage attack against the short key ID (which is just a truncated fingerprint). Today, David Leon Gil demonstrated that a collision attack against the long key ID is also trivial. A collision attack differs from a preimage attack in that the attacker gets to generate two different things that both have the same digest. Collision attacks are easier than preimage attacks because of the birthday paradox. dlg's colliding keys are not a surprise, but hopefully the explicit demonstration can serve as a wakeup call to help us improve our infrastructure. So this is not a way to spoof a specific target's long key ID on its own. But it indicates that it's more of a worry than most people tend to think about or plan for. And remember that for a search space as small as 64-bits (the long key ID), if you want to find a pre-image against any one of 2k keys, your search is actually only in a (64-k)-bit space to find a single pre-image. The particularly bad news: gpg doesn't cope well with the two keys that have the same long key ID: 0 dkg@alice:~$ gpg --import x gpg: key B8EBE1AF: public key "9E669861368BCA0BE42DAF7DDDA252EBB8EBE1AF" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) 0 dkg@alice:~$ gpg --import y gpg: key B8EBE1AF: doesn't match our copy gpg: Total number processed: 1 2 dkg@alice:~$This probably also means that caff (from the signing-party package) will also choke when trying to deal with these two keys. I'm sure there are other OpenPGP-related tools that will fail in the face of two keys with matching 64-bit key IDs. We should not use Key IDs I am more convinced than ever that key IDs (both short and long) are actively problematic to real-world use of OpenPGP. We want two things from a key management framework: unforgability, and human-intelligible handles. Key IDs fail at both.
... Creating var directory '/usr/src/git/debian/pkg-mariadb/builddir/mysql-test/var'... Checking supported features... MariaDB Version 5.5.32-MariaDB-1 Installing system database... - SSL connections supported Collecting tests... Using server port 42388 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019 oqgraph.basic [ skipped ] No OQGraph oqgraph.binlog [ skipped ] No OQGraph sphinx.sphinx [ skipped ] No Sphinx archive.archive-big [ skipped ] Test needs --big-test binlog.binlog_multi_engine [ skipped ] ndbcluster disabled binlog.binlog_spurious_ddl_errors [ disabled ] BUG#11761680 2013-01-18 astha Fixed on mysql-5.6 and trunk binlog.binlog_truncate_innodb [ disabled ] BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed federated.federated_server [ skipped ] Test needs --big-test ...
For the fifth year in a row the fearless WebKitGTK+ hackers have gathered in A Coru a to bring GNOME and the web closer. Igalia has organized and hosted it as usual, welcoming a record 30 people to its office. The GNOME foundation has sponsored my trip allowing me to fly the cool 18 seats propeller airplane from Lisbon to A Coru a, which is a nice adventure, and have pulpo a feira for dinner, which I simply love! That in addition to enjoying the company of so many great hackers.
The goals for the hackfest have been ambitious, as usual, but we made good headway on them. Web the browser (AKA Epiphany) has seen a ton of little improvements, with Carlos splitting the shell search provider to a separate binary, which allowed us to remove some hacks from the session management code from the browser. It also makes testing changes to Web more convenient again. Jon McCan has been pounding at Web s UI making it more sleek, with tabs that expand to make better use of available horizontal space in the tab bar, new dialogs for preferences, cookies and password handling. I have made my tiny contribution by making it not keep tabs that were created just for what turned out to be a download around. For this last day of hackfest I plan to also fix an issue with text encoding detection and help track down a hang that happens upon page load.
Martin Robinson and myself have as usual dived into the more disgusting and wide-reaching maintainership tasks that we have lots of trouble pushing forward on our day-to-day lives. Porting our build system to CMake has been one of these long-term goals, not because we love CMake (we don t) or because we hate autotools (we do), but because it should make people s lives easier when adding new files to the build, and should also make our build less hacky and quicker it is sad to see how slow our build can be when compared to something like Chromium, and we think a big part of the problem lies on how complex and dumb autotools and make can be. We have picked up a few of our old branches, brought them up-to-date and landed, which now lets us build the main WebKit2GTK+ library through cmake in trunk. This is an important first step, but there s plenty to do.
Under the hood, Dan Winship has been pushing HTTP2 support for libsoup forward, with a dead-tree version of the spec by his side. He is refactoring libsoup internals to accomodate the new code paths. Still on the HTTP front, I have been updating soup s MIME type sniffing support to match the newest living specification, which includes specification for several new types and a new security feature introduced by Internet Explorer and later adopted by other browsers. The huge task of preparing the ground for a one process per tab (or other kinds of process separation, this will still be topic for discussion for a while) has been pushed forward by several hackers, with Carlos Garcia and Andy Wingo leading the charge.
Other than that I have been putting in some more work on improving the integration of the new Web Inspector with WebKitGTK+. Carlos has reviewed the patch to allow attaching the inspector to the right side of the window, but we have decided to split it in two, one providing the functionality and one the API that will allow browsers to customize how that is done. There s a lot of work to be done here, I plan to land at least this first patch durign the hackfest. I have also fought one more battle in the never-ending User-Agent sniffing war, in which we cannot win, it looks like.
I am very happy to be here for the fifth year in a row, and I hope we will be meeting here for many more years to come! Thanks a lot to Igalia for sponsoring and hosting the hackfest, and to the GNOME foundation for making it possible for me to attend! See you in 2014!

Just a trivial fact: every polyhedron that is used in linear programming is
convex, that is !!mathjaxbegin-i!! QXggXGxlcSBi
!!mathjaxend-i!! is convex, for a matrix !!mathjaxbegin-i!! QQ==
!!mathjaxend-i!! and a (column)
vector !!mathjaxbegin-i!! Yg==
!!mathjaxend-i!!.
Proof: Take any !!mathjaxbegin-i!! eCcsIHgnJw==
!!mathjaxend-i!! that satisfy the system of inequalities !!mathjaxbegin-i!! QXggXGxlcSBi
!!mathjaxend-i!!.
Then, for !!mathjaxbegin-i!! MCBcbGVxIFxsYW1iZGEgXGxlcSAx
!!mathjaxend-i!!, we have that !!mathjaxbegin-i!! XGxhbWJkYSBBeCcgXGxlcSBcbGFtYmRhIGI=
!!mathjaxend-i!!,
that is !!mathjaxbegin-i!! QSBcbGFtYmRhIHgnIFxsZXEgXGxhbWJkYSBi
!!mathjaxend-i!!. Similarly, for !!mathjaxbegin-i!! eCcn
!!mathjaxend-i!!, we have
that !!mathjaxbegin-i!! QSAoMS1cbGFtYmRhKSB4JyBcbGVxICgxLVxsYW1iZGEpIGI=
!!mathjaxend-i!!. Summing the inequalities, we
get:
!!mathjaxbegin-d!! CiBBW1xsYW1iZGEgeCcgKyAoMS1cbGFtYmRhKSB4JyddIFxsZXEgW1xsYW1iZGEgKyAoMS1cbGFt
YmRhKV0gYiA9IGIsCg==
!!mathjaxend-d!!
which means that !!mathjaxbegin-i!! XGhhdHt4fSA9IFxsYW1iZGEgeCcgKyAoMS1cbGFtYmRhKSB4Jyc=
!!mathjaxend-i!! is again a
solution of the original set of inequalities, thus concluding the argument.
A nice set of recent posts have done a great job detailing the remaining ways that a root user can get at kernel memory. Part of this is driven by the ideas behind UEFI Secure Boot, but they come from the same goal: making sure that the root user cannot directly subvert the running kernel. My perspective on this is toward making sure that an attacker who has gained access and then gained root privileges can t continue to elevate their access and install invisible kernel rootkits.
An outline for possible attack vectors is spelled out by Matthew Gerrett s continuing useful kernel lockdown patch series. The set of attacks was examined by Tyler Borland in Bypassing modules_disabled security . His post describes each vector in detail, and he ultimately chooses MSR writing as the way to write kernel memory (and shows an example of how to re-enable module loading). One thing not mentioned is that many distros have MSR access as a module, and it s rarely loaded. If modules_disabled is already set, an attacker won t be able to load the MSR module to begin with. However, the other general-purpose vector, kexec, is still available. To prove out this method, Matthew wrote a proof-of-concept for changing kernel memory via kexec.
Chrome OS is several steps ahead here, since it has hibernation disabled, MSR writing disabled, kexec disabled, modules verified, root filesystem read-only and verified, kernel verified, and firmware verified. But since not all my machines are Chrome OS, I wanted to look at some additional protections against kexec on general-purpose distro kernels that have CONFIG_KEXEC enabled, especially those without UEFI Secure Boot and Matthew s lockdown patch series.
My goal was to disable kexec without needing to rebuild my entire kernel. For future kernels, I have proposed adding /proc/sys/kernel/kexec_disabled, a partner to the existing modules_disabled, that will one-way toggle kexec off. For existing kernels, things got more ugly.
What options do I have for patching a running kernel?
First I looked back at what I d done in the past with fixing vulnerabilities with systemtap. This ends up being a rather heavy-duty way to go about things, since you need all the distro kernel debug symbols, etc. It does work, but has a significant problem: since it uses kprobes, a root user can just turn off the probes, reverting the changes. So that s not going to work.
Next I looked at ksplice. The original upstream has gone away, but there is still some work being done by Jiri Slaby. However, even with his updates which fixed various build problems, there were still more, even when building a 3.2 kernel (Ubuntu 12.04 LTS). So that s out too, which is too bad, since ksplice does exactly what I want: modifies the running kernel s functions via a module.
So, finally, I decided to just do it by hand, and wrote a friendly kernel rootkit. Instead of dealing with flipping page table permissions on the normally-unwritable kernel code memory, I borrowed from PaX s KERNEXEC feature, and just turn off write protect checking on the CPU briefly to make the changes. The return values for functions on x86_64 are stored in RAX, so I just need to stuff the kexec_load syscall with mov -1, %rax; ret (-1 is EPERM):
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
static unsigned long long_target;
static char *target;
module_param_named(syscall, long_target, ulong, 0644);
MODULE_PARM_DESC(syscall, "Address of syscall");
/* mov $-1, %rax; ret */
unsigned const char bytes[] = 0x48, 0xc7, 0xc0, 0xff, 0xff, 0xff, 0xff,
0xc3 ;
unsigned char *orig;
/* Borrowed from PaX KERNEXEC */
static inline void disable_wp(void)
unsigned long cr0;
preempt_disable();
barrier();
cr0 = read_cr0();
cr0 &= ~X86_CR0_WP;
write_cr0(cr0);
static inline void enable_wp(void)
unsigned long cr0;
cr0 = read_cr0();
cr0 = X86_CR0_WP;
write_cr0(cr0);
barrier();
preempt_enable_no_resched();
static int __init syscall_eperm_init(void)
int i;
target = (char *)long_target;
if (target == NULL)
return -EINVAL;
/* save original */
orig = kmalloc(sizeof(bytes), GFP_KERNEL);
if (!orig)
return -ENOMEM;
for (i = 0; i < sizeof(bytes); i++)
orig[i] = target[i];
pr_info("writing %lu bytes at %p\n", sizeof(bytes), target);
disable_wp();
for (i = 0; i < sizeof(bytes); i++)
target[i] = bytes[i];
enable_wp();
return 0;
module_init(syscall_eperm_init);
static void __exit syscall_eperm_exit(void)
int i;
pr_info("restoring %lu bytes at %p\n", sizeof(bytes), target);
disable_wp();
for (i = 0; i < sizeof(bytes); i++)
target[i] = orig[i];
enable_wp();
kfree(orig);
module_exit(syscall_eperm_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kees Cook <kees@outflux.net>");
MODULE_DESCRIPTION("makes target syscall always return EPERM");
If I didn t want to leave an obvious indication that the kernel had been manipulated, the module could be changed to:
sys_kexec_load (found via /proc/kallsyms) before I disable module loading via modprobe. Here s my upstart script:
# modules-disable - disable modules after rc scripts are done
#
description "disable loading modules"
start on stopped module-init-tools and stopped rc
task
script
cd /root/modules/syscall_eperm
make clean
make
insmod ./syscall_eperm.ko \
syscall=0x$(egrep ' T sys_kexec_load$' /proc/kallsyms cut -d" " -f1)
modprobe disable
end script
And now I m safe from kexec before I have a kernel that contains /proc/sys/kernel/kexec_disabled.
2013, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
A new Armadillo release 3.930 came
out a few days ago, with a very nice set of changes (see below). I rolled
this into RcppArmadillo
0.3.930.0. However, one of these changes revealed that R shipped only the standard SVD for
complex-valued matrices, and not the more performant divide-and-conquer
approach. So in R builds using the default built-in Lapack, at least one
CRAN package no longer built.
After some back and forth, Conrad
put some branching in the library to fall back to the standard SVD, and I
added a built-time configuration test for an appropriate preprocessor
directive used by the fallback code. This is now on
which is now on CRAN
and in Debian as
RcppArmadillorelease
0.3.930.1, and Conrad will probably update the
Armadillo page as well (though the
fix is only needed with R's builtin Rlapack). Also of note is that R Core
already added the missing Fortran routine zgesdd to R 3.1.0 (aka
"R-devel") so this issue goes away with the next release. Also of note, I
wrote up a short Rcpp Gallery post
illustrating the performance gains available from divide-and-conquer SVD.
The complete list of changes is below.
Changes in RcppArmadillo version 0.3.930.1 (2013-12-09)Courtesy of CRANberries, there is also a diffstat report for the most recent release As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.Changes in RcppArmadillo version 0.3.930.0 (2013-12-06)
- Upgraded to Armadillo release Version 3.930.1
- Armadillo falls back to standard complex svd if the more performant divide-and-conquer variant is unavailable
- Added detection for Lapack library and distinguish between R's own version (withhout
zgesdd) and system Lapack; a preprocessor define is set accordingly
- Upgraded to Armadillo release Version 3.930 ("Dragon's Back")
- added divide-and-conquer variant of
svd_econ(), for faster SVD- added divide-and-conquer variant of
pinv(), for faster pseudo-inverse- added element-wise variants of
min()andmax()- added
size()based specifications of submatrix view sizes- added
randi()for generating matrices with random integer values- added more intuitive specification of sort direction in
sort()andsort_index()- added more intuitive specification of method in
det(),.i(),inv()andsolve()- added more precise timer for the
wall_clockclass when using C++11- New unit tests for complex matrices and vectors
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
dc elements for the realm were appended to a provided
partial base. Now, the complete DN of the root of the Active Directory
tree should be provided. This is more flexible and more useful with a
wider variety of Active Directory setups.
Second, I took advantage of the backward-incompatibilities to change the
module name to sync.so from krb5_sync.so, since the latter
sounded weirdly redundant and verbose when installed in the Kerberos
plugin directory. This will require a configuration change to the plugin
configuration for the KDC or kadmin server.
Also in this release are a couple of new options: ad_queue_only, which
forces all changes to be queued for later processing instead of processed
in real time, and syslog, which can be used to turn off the internal
syslog logging of non-errors from the module. (This is mostly useful for
test suites.)
Now, password changes are queued on any Active Directory failure, not just
a few oddly-distinguished ones. The previous behavior was rather specific
to Stanford's needs, and queuing all password changes shouldn't pose any
problems.
Finally, the krb5-sync-backend utility program for manipulating the queued
changes has been completely rewritten and is much cleaner. It now uses
the Net::Remctl::Backend Perl module for command and option handling, so
that module (provided with remctl 3.4 or
later) must be installed. It also requires IPC::Run, which is available
from CPAN. It uniformly supports a -d option to specify the queue
location, and skips event files during processing that no longer exist.
You can get the latest release from krb5-sync distribution page.
--with flag without a path would
result in yes/include and yes/lib to be added to the
compiler and linker paths. It also adds Autoconf probles for Cyrus SASL
libraries, contributed by Julien LIE based on the INN macros.
This release also adds support for KADM5_MISSING_KRB5_CONF_PARAMS to
portable/kadmin.h and the test_tmpdir function to Test::RRA::Automake.
The latter works the same as it does in the C and shell TAP libraries.
Finally, the shared valgrind suppression file adds a suppression for the
memory allocated by dlopen to store error messages for dlerror on Linux,
which is apparently never freed.
You can get the latest release from the rra-c-util distribution page.
I spent yesterday at the very enjoyable
Big Data Summit
held at the
University of Illinois Research Park
at the edge of the
University of Illinois at Urbana-Champaign.
campus.
My (short) presentation was part of a panel session on R and Big Data
which Doug Simpson
of the UIUC Statistics department
had put together very well. We heard from a vendor / technology
provider with Christopher Nguyen from Adatao
talking about their "Big R", from industry with Andy Stevens talking about
a number of some real-life challenges with big data at
John Deere,
from academia with
Jonathon Greenberg
talking about R and HPC for geospatial research and I added a few short
comments and links about R, HPC and Rcpp. My few slides are now up on
my talks / presentations page.
Overall, a good day with a number of interesting presentations and of course
a number of engaging hallway discussions.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Next.