|
|
Log in / Subscribe / Register

LWN.net Weekly Edition for December 17, 2015

Encrypted databases with ZeroDB

By Jake Edge
December 16, 2015

An object database can clearly store encrypted objects, but querying them will be rather difficult without decrypting them. The whole point of an encrypted database, though, is that the server should be unable to disclose any of the data it stores if it gets compromised. That implies that the client will need to be an integral part of the query process—unlike regular database systems—but limiting unencrypted data to the client side only provides resilience against attacks on the data at rest or in transit. Indeed that is exactly what ZeroDB has set out to do.

On December 7, the source code for ZeroDB was released as free software under the Affero GPLv3. So far, both the client and server pieces are Python programs, though a JavaScript client "will be following soon".

At its heart, though, ZeroDB is about the protocol between client and server, as well as the query processing that is completely handled by the client. Any kind of storage service could be used to store the blobs of data, since the server will have no way to understand anything about them, other than an index value that is used to retrieve them. It is effectively treated as a block server of sorts. As a March blog post about ZeroDB describes, the data is stored in B-trees, but the server doesn't know that, as everything it stores is encrypted using keys it doesn't have:

The server doesn't know how individual objects are organized within a tree structure, or whether they even belong to a tree structure at all. It cannot compare objects, or even tell whether they are the same object.

ZeroDB uses the venerable Zope Object Database (ZODB) to store its data. Models are created on the client to describe the data—each field so defined is indexed by the client—but the objects stored can contain other non-indexed fields as well. By using the B-trees created for each indexed data field, the client can traverse the data structures to find the data it is looking for.

When a client does a query, it requests pieces of the tree (buckets) using the unique ID generated when the bucket was stored. When decrypted, the buckets refer to other buckets that are also retrieved if they are needed by the query. Those buckets may also be locally cached to reduce the number of round trips required.

Handling queries on the client side seems like it might be slow, but the numbers presented in the blog post are certainly not terrible, though they are for pretty simple tests:

We tested ZeroDB's full text search over the lkml archive (plaintext ~250 MB), which showed that a remote query over encrypted data is ~0.5s (the server was deployed at AWS in Oregon while the query was performed from San Francisco).

Saving the data into the database also takes logarithmic time. Our tests showed that insert queries take ~0.5s in similar conditions.

As noted in the post, one server can be providing chunks of data to multiple clients in parallel, so the usual database server bottleneck for query processing can be avoided. In addition, multiple clients could have independent databases with their own keys and/or share keys and databases—the server is just storing blobs and it is up to clients to decrypt, interpret, and use them. By default, the clients encrypt the tree structure and objects that are stored on the server using the same elliptic curve (secp256k1) that Bitcoin uses.

The ZeroDB documentation page shows how to install, configure, and use the database; it also looks at the kinds of queries supported by the system. Establishing a connection to the database should look somewhat familiar to anyone who has used the Django object-relational mapping (ORM) or SQLAlchemy, which "greatly inspired" the ZeroDB API:

    db = zerodb.DB(("localhost", 8001), 
                   username="root", 
		   password="<your passphrase>")

Querying the db instance is fairly straightforward. If an Employee model has been defined (using the ZeroDB models module), a query for highly paid employees named "John" might look like:

    rich_johns = db[Employee].query(InRange("salary", 195000, 200000),
                                    name="John")

There is a whole list of query operators listed in the documentation, which contains all of the basic tests one might expect. There is also support for JSON queries (similar to those of MongoDB) by running a separate server program (api_server.py) that talks to the normal ZeroDB server.

Being able to store data "in the cloud" without worrying that attackers or others will be able to access it inappropriately certainly has appeal. So the idea behind ZeroDB is reasonable, but there are still some hurdles to clear. First and foremost, has the crypto been implemented in a reasonable and secure manner? Using existing crypto libraries and parameters (e.g. Bitcoin's curve) is a good first step, but some kind of serious vetting from crypto experts seems needed before users should trust their data to the system. Performance may also be an area that will need some work.

Another question arises: is this simply a "throw it over the wall" release or will there be an attempt to put together a true open-source project? In the week since the release, there have been no posts to the zerodb-dev Google group, though perhaps there is more happening at the project's Slack site. There are other open-source encrypted database systems (SQLCipher for one), but ZeroDB's end-to-end encryption will provide more protection than systems that do the decryption on the server. Whether that leads to an active project remains to be seen.

Comments (3 posted)

The PhotoFlow 0.2.5 release

By Nathan Willis
December 16, 2015

The PhotoFlow image editor is a relative newcomer to the field of free-software photography tools. The project was started in 2014, and some people might consider it an odd choice of undertaking—given that there are, these days, quite a few capable raw-photo editors to choose from. But PhotoFlow does bring something new to the table; it places greater emphasis on the use of layers and masks, akin to the tools commonly found in vector editors, painting applications, and the like. That may make PhotoFlow a more natural fit for users who find an emphasis on raw-image functionality like demosaicing and tone mapping less than helpful.

The newest release of PhotoFlow is version 0.2.5, from December 7. There are source packages available, as well as binaries packaged for Ubuntu and Arch Linux, plus Mac and Windows installers. Those looking to run PhotoFlow on Linux will need to install the VIPS image-processing library; the other dependencies are standard fare for GTK+ applications.

[PhotoFlow's main window]

PhotoFlow uses single-window interface; if one opens up multiple images, they are placed in tabs. Within each tab, there is a "Layers" list on the left hand side, an image histogram above the list, a set of zoom buttons in the bottom right corner, and that is about it. At least for now, the UI provides only text labels for the relevant controls. That could make it hard for users to discover that the "+", "G+", and "-" buttons at the bottom of the layer list is where all the fun begins.

To get started, one should click on the "+" button. This pops up an "Add New Layer" window, populated with a slate of layer types, each of which corresponds to some sort of image-adjustment operation. That can feel a little different if you are used to "layer" meaning only a set of visible pixels, but having layers that perform an operation is a concept used in Krita, SVG filters, and in GIMP's filter layers. PhotoFlow offers about 65 layer types at present, grouped by category. "B/C/S/H Adjustment" is a brightness/contrast/saturation/hue layer, "Sharpen" is an image-sharpening layer, and so on. Many include a paragraph of descriptive text in the Add New Layer dialog, and there are some fairly advanced options available, like the foreground-extraction and "inpainting" operations from G'MIC.

[PhotoFlow filtering]

So far, this may all sound like standard fare. Where PhotoFlow diverges, though, is in how the various adjustment layers are employed in the user interface. By default, adding a new layer simply inserts it into the layer list (above the currently selected layer or, if no layer is selected, on the top). Double-clicking on the layer's name opens up that layer's block of controls in a new pane on the right-hand side of the window. Inkscape does something similar, but raw photo editors like RawTherapee and darktable insist on packing every adjustment tool's control into a single strip down one side. That strip quickly fills up, requiring the user to scroll up and down with the mouse, hoping not to accidentally click on a slider while trying to get to the tool of interest. After having used PhotoFlow, one also begins to appreciate its lack of "filesystem tree" or "image browser" pane taking up more real estate.

The layer list also allows users to group layers together—new groups are created with the "G+" button. Grouping layers makes it possible to enable and disable multiple layers at once, as well as to rearrange groups of layers on the list. Individual layers can be rearranged, too, but once there are more than a few, dragging and dropping them gets tedious (not to mention error-prone, since getting layers out of order can seriously affect the final image).

[PhotoFlow masks]

PhotoFlow also offers an extensive set of tools for creating and applying masks to an image's adjustment layers. Many layer types include a drop-down filter tool at the bottom of their controls; this option lets the user quickly restrict the adjustment's effect by pixel brightness, saturation, or hue—effectively creating an implicit mask.

The more powerful option, however, is to double-click on the blank rectangle that sits next to a layer's name in the layer list. This will open another tab on the left side of the interface named "opacity (layer name)." In that tab, the user can add mask layers of several varieties. PhotoFlow provides tools for building gradient masks, drawing masks directly onto the image canvas, and several other options. In each case, creating the mask in "opacity (foo)" limits the effects of the operations in the foo layer.

Here again, there are "mask" tools in many other raw-photo editors, but in those other applications the mask-editing features can feel like an afterthought. I am not particularly fond of darktable's approach, for instance, which involves a mask manager widget that is separate from the image-adjustment tools. PhotoFlow binds a mask to each layer or layer group; it is a natural one-to-one mapping and it is difficult to get the masks mixed up.

PhotoFlow has its share of awkwardness, though. For example, a few of the adjustment layers take effect immediately, but those that involve drawing on the canvas—such as the crop tool—do not. The user has to click on a pencil icon in the layer's control panel, which adds an unnecessary step. On top of that, the pencil icon is also present on every other layer control panel, even though it seems to have no function on most of them. Alongside the pencil icon are several other toggle buttons, the purpose of which can be equally unclear for many layer types. The pushpin icon, for example, shows masks in red, but it seems to have no effect on non-mask layers. And there are little peculiarities, such as the fact that there are multiple places on screen where you can enable or disable any given layer (the layer list and the layer's control panel), using different icons.

[PhotoFlow multi-layer effects]

When one takes PhotoFlow's layer and masking tools together, the result is an editor that is surprisingly easy to use. There is no accounting for taste in UIs, of course, but my suspicion is that many users who have spent time in GIMP, Photoshop, or other general-purpose image editors will have an easier time manipulating effects to achieve the look they want in PhotoFlow than in darktable.

That having been said, a simple and clean interface is easy to implement in the early days of a project, and PhotoFlow is only at version 0.2.5. Perhaps clutter will creep in as the codebase and user community expands; it is hard to say. For now, however, PhotoFlow remains an application to watch. The team is making minor releases every few weeks, each of which bring a handful of new features. There is also a growing set of tutorials (video and text-based) that can help users get up to speed—whether they have experience with other image editors or not.

Comments (2 posted)

Page editor: Jonathan Corbet

Security

Increasing the range of address-space layout randomization

By Jonathan Corbet
December 16, 2015
Many attempts to exploit vulnerabilities in computing systems depend on the ability to locate a specific data structure or piece of code in a running process. Attempts that proceed with an incorrect address will typically fail or, even better, cause a crash that brings attention to the exploit attempt. For this reason, most contemporary systems try to obscure the layout of running processes. To a great extent this effort relies on not leaking information from those processes, or from the kernel, but it is also important to avoid letting those locations be predictable in the first place. The mechanisms used in Linux toward this end are seen by many as woefully inadequate; a current patch set is unlikely to change that impression greatly, but it might just succeed in increasing security on some systems.

Address space layout randomization (ASLR) introduces some randomness into the locations where a process's code and data segments are placed within that process's address space. Two processes running the same program should, under ASLR, see that program placed in different virtual locations. The Linux kernel first implemented ASLR back in 2005. Even then, that implementation was seen as being, at best, a partial solution to the problem.

ASLR works by calculating a random offset to be added to the return value from every mmap() call. Since mmap() is used to place most data and code segments, that causes this offset to apply to most of the process's address space (one exception is the stack, which has a separate offset). On 32-bit systems, the offset is an eight-bit value; the offset is interpreted in pages, so, on these systems, memory areas from mmap() will have a random offset between zero and 255 pages. Note that the lowest bits of the address of any mapping are not random, since mappings are page-aligned.

This offset will be sufficient to frustrate (almost all the time) a simple exploit that tries a single, hard-coded address. It is somewhat less effective, though, if the exploit is able to retry with varying offsets of its own. Only 256 attempts are required to explore the entire range of potential offsets; an exploit running locally can probably work through the entire set in well less than a second, especially if it is able to avoid causing process crashes in its attempts. ASLR, thus, does not provide a great deal of additional security against such threats.

The problem is that there is only so much address space to play with, especially on 32-bit systems. Shifting the heap and stack areas around will reduce the space between them (traditional layout schemes having been designed to maximize that space); that, in turn, can cause programs needing to do huge allocations to fail. Increasing the amount of randomness in the layout offset may not cause problems in a lot of systems, but a mechanism that goes into everybody's kernel has to be implemented conservatively. Thus, the eight-bit value used on 32-bit systems (64-bit systems have more space to play with, so a 28-bit offset is used on x86-64, for example).

One might think that 32-bit systems are on the way out, but there are still a lot of them — including a lot of Android devices. When the "Stagefright" vulnerability, which affects Android systems, was disclosed in July, Mark Brand at Google set out to write an exploit for it. He duly found that ASLR was not a significant obstacle in the face of a brute-force attack; as he put it: "I knew that ASLR on 32-bit was always a bit shaky; but I didn’t think it was this broken." An easily exploitable vulnerability on vast numbers of Android devices is a bit of a nightmare scenario; it would be nice if the kernel had ways to mitigate exploits in such situations. ASLR, as it turns out, is, in its current form, not really one of those ways.

The interesting thing about Android, though, is that it is a relatively controlled environment. It may not always need the same level of generality that a kernel-for-everybody must provide. If it is known that Android systems will not be making huge allocations (and that should be fairly well known), then it may well be safe to increase the randomness of the ASLR mechanism, making brute-force attacks harder to carry out. But current kernels offer no way to increase the amount of randomness used with ASLR.

It would not be out of character for the Android developers to simply patch a higher degree of randomness into the kernel shipped with the Android distribution. But, sometimes, they try to get a general solution into the upstream kernel instead. That is what is happening with Daniel Cashman's patch to provide an customizable random offset range for ASLR.

This patch set replaces the compile-time ASLR offset range with a pair of new sysctl knobs called /proc/sys/vm/mmap_rnd_bits and /proc/sys/vm/mmap_rnd_compat_bits. The first covers normal processes, while the second applies to those running in the compatibility mode — 32-bit processes running on a 64-bit kernel, for example. The default value matches the value in current kernels, so users will see no change unless they (or their distributor) explicitly make a change.

As the names suggest, these knobs control the number of address-space bits used for the ASLR random offset. Each architecture sets minimum and maximum values that make sense, given the available address space. On x86, the value may range between eight and 16 bits (for 32-bit) or 28 and 32 (for 64-bit). The limits for ARM are rather more complicated, depending on the specific subarchitecture and the page size in use. In all cases, though, this patch makes it possible to increase the number of bits used for the random offset. Each additional bit doubles the space that must be searched, making an exploit slower and more likely to be detected. If the Android developers are able to use this feature to increase ASLR randomness, the next Stagefright-like vulnerability will, hopefully, be harder to exploit.

This patch set has been through a number of revisions (six thus far with at least one more expected) based on comments. Those comments, though, are concerned with how the patch can be improved; there does not seem to be any real discomfort with the idea in general. So Linux kernels could offer more random address-space layout randomization in the relatively near future.

Comments (16 posted)

Brief items

Security quotes of the week

They know that the smart, major terrorist groups will never use systems with government-mandated backdoors for their important communications, they'll continue to use strong systems developed in and/or distributed by countries without such government mandates, or their own strong self-designed apps.

So it seems clear that the real reason for the government push for encryption backdoors is an attempt not to catch the most dangerous terrorists that they're constantly talking about, but rather a selection of "low-hanging fruit" of various sorts.

Inept would-be low-level terrorists. Drug dealers. Prostitution rings. Free speech advocates and other political dissidents. You know the types.

That is, just about everybody EXCEPT the most dangerous terrorist groups that wouldn't go near backdoored encryption systems with a ten foot pole, yet are the very groups governments are loudly claiming backdoor systems are required to fight.

— Lauren Weinstein

Although the new policy is primarily tailored towards worried parents, adults who become victims of online abuse will also be covered. The policy money can be used to pay a reputation management team that would restore the person's public image, or even to hire a forensic specialist to trace the origins of the trolling.

Chubb's clients will be able to sign up for troll insurance with a policy renewal starting from January 1, 2016.

— Andrii Degeler in Ars Technica on a new type of insurance

Comments (7 posted)

An authentication bypass issue in GRUB

The GRUB bootloader (versions 1.98 to 2.02) has an integer underflow issue which can enable a local attacker to bypass authentication on a locked-down system. "Grub2 is the bootloader used by most Linux systems including some embedded systems. This results in an incalculable number of affected devices."

Comments (12 posted)

New vulnerabilities

arts: privilege escalation

Package(s):arts kdelibs CVE #(s):CVE-2015-7543
Created:December 10, 2015 Updated:December 31, 2015
Description: From the Debian-LTS advisory:

It has been reported that arts uses the insecure mktemp() function to create the temporary directory it uses to host user-specific sockets. It is thus possible for another user to hijack this temporary directory and gain IPC access it should not have.

Alerts:
Fedora FEDORA-2015-8dd01b09a9 arts 2015-12-30
Fedora FEDORA-2015-6e50918d8e kdelibs3 2015-12-29
Debian-LTS DLA-367-1 kdelibs 2015-12-10
Fedora FEDORA-2015-6d473c95ee arts 2015-12-29
Debian-LTS DLA-366-1 arts 2015-12-10

Comments (none posted)

bind: socket error

Package(s):bind CVE #(s):CVE-2015-8461
Created:December 16, 2015 Updated:December 16, 2015
Description: From the Slackware advisory:

Address fetch context reference count handling error on socket error.

Alerts:
Fedora FEDORA-2015-2df40de264 dnsperf 2015-12-22
Fedora FEDORA-2015-2df40de264 bind-dyndb-ldap 2015-12-22
Fedora FEDORA-2015-2df40de264 bind 2015-12-22
Fedora FEDORA-2015-09bf9e06ea dnsperf 2015-12-19
Fedora FEDORA-2015-09bf9e06ea bind-dyndb-ldap 2015-12-19
Fedora FEDORA-2015-09bf9e06ea bind 2015-12-19
Slackware SSA:2015-349-01 bind 2015-12-15

Comments (none posted)

bind: denial of service

Package(s):bind CVE #(s):CVE-2015-8000
Created:December 16, 2015 Updated:December 29, 2015
Description: From the Arch Linux advisory:

An error in the parsing of incoming responses allows some records with an incorrect class to be accepted by BIND instead of being rejected as malformed. This can trigger a REQUIRE assertion failure when those records are subsequently cached. Intentional exploitation of this condition is possible and could be used as a denial-of-service vector against servers performing recursive queries.

An attacker who can cause a server to request a record with a malformed class attribute can use this bug to trigger a REQUIRE assertion in db.c, causing named to exit and denying service to clients. The risk to recursive servers is high. Authoritative servers are at limited risk if they perform authentication when making recursive queries to resolve addresses for servers listed in NS RRSETs.

Alerts:
Oracle ELSA-2016-2094 bind97 2016-10-21
Oracle ELSA-2016-2093 bind 2016-10-21
Red Hat RHSA-2016:0079-01 bind 2016-01-28
Red Hat RHSA-2016:0078-01 bind 2016-01-28
SUSE SUSE-SU-2016:0227-1 bind 2016-01-25
openSUSE openSUSE-SU-2015:2391-1 bind 2015-12-29
Fedora FEDORA-2015-e278e12ebc dhcp 2015-12-28
Fedora FEDORA-2015-e278e12ebc bind99 2015-12-28
SUSE SUSE-SU-2015:2359-1 bind 2015-12-25
openSUSE openSUSE-SU-2015:2365-1 bind 2015-12-25
openSUSE openSUSE-SU-2015:2364-1 bind 2015-12-25
SUSE SUSE-SU-2015:2340-1 bind 2015-12-22
SUSE SUSE-SU-2015:2341-1 bind 2015-12-22
Fedora FEDORA-2015-2df40de264 dnsperf 2015-12-22
Fedora FEDORA-2015-2df40de264 bind-dyndb-ldap 2015-12-22
Fedora FEDORA-2015-2df40de264 bind 2015-12-22
Mageia MGASA-2015-0481 bind 2015-12-20
Fedora FEDORA-2015-09bf9e06ea dnsperf 2015-12-19
Fedora FEDORA-2015-40882ddfb1 dhcp 2015-12-19
Fedora FEDORA-2015-40882ddfb1 bind99 2015-12-19
Fedora FEDORA-2015-09bf9e06ea bind-dyndb-ldap 2015-12-19
Fedora FEDORA-2015-09bf9e06ea bind 2015-12-19
Scientific Linux SLSA-2015:2655-1 bind 2015-12-17
Scientific Linux SLSA-2015:2658-1 bind97 2015-12-16
Scientific Linux SLSA-2015:2656-1 bind 2015-12-16
Oracle ELSA-2015-2658 bind97 2015-12-16
Oracle ELSA-2015-2656 bind 2015-12-16
Oracle ELSA-2015-2655 bind 2015-12-16
Oracle ELSA-2015-2655 bind 2015-12-16
Debian-LTS DLA-370-1 bind9 2015-12-17
CentOS CESA-2015:2658 bind97 2015-12-16
CentOS CESA-2015:2656 bind 2015-12-16
CentOS CESA-2015:2655 bind 2015-12-16
CentOS CESA-2015:2655 bind 2015-12-16
Red Hat RHSA-2015:2658-01 bind97 2015-12-16
Red Hat RHSA-2015:2656-01 bind 2015-12-16
Red Hat RHSA-2015:2655-01 bind 2015-12-16
Ubuntu USN-2837-1 bind9 2015-12-15
Slackware SSA:2015-349-01 bind 2015-12-15
Debian DSA-3420-1 bind9 2015-12-15
Arch Linux ASA-201512-10 bind 2015-12-16

Comments (none posted)

cups-filters: command execution

Package(s):cups-filters CVE #(s):CVE-2015-8560
Created:December 16, 2015 Updated:December 31, 2015
Description: From the Debian advisory:

Adam Chester discovered that missing input sanitising in the foomatic-rip print filter might result in the execution of arbitrary commands.

Alerts:
Fedora FEDORA-2015-998911cf3f cups-filters 2015-12-30
openSUSE openSUSE-SU-2015:2367-1 cups-filters 2015-12-27
CentOS CESA-2016:0491 foomatic 2016-03-23
Scientific Linux SLSA-2016:0491-1 foomatic 2016-03-23
Oracle ELSA-2016-0491 foomatic 2016-03-22
Red Hat RHSA-2016:0491-01 foomatic 2016-03-22
Debian DSA-3429-1 foomatic-filters 2015-12-21
Fedora FEDORA-2015-a108c34086 cups-filters 2015-12-19
Debian-LTS DLA-371-1 foomatic-filters 2015-12-18
Mageia MGASA-2015-0476 cups-filters 2015-12-16
Ubuntu USN-2838-2 foomatic-filters 2015-12-16
Ubuntu USN-2838-1 cups-filters 2015-12-16
Debian DSA-3419-1 cups-filters 2015-12-15

Comments (none posted)

grub2: code execution

Package(s):grub2 CVE #(s):CVE-2015-8370
Created:December 14, 2015 Updated:January 7, 2016
Description: From the Red Hat bugzilla:

A buffer overflow flaw was found in the way grub2 checked the password entered by the user during bootup. A local attacker could use this flaw to circumvent the password check and, potentially, execute arbitrary code on the system.

See the original report for lots of details on this vulnerability.

Alerts:
openSUSE openSUSE-SU-2016:0036-1 grub2 2016-01-06
SUSE SUSE-SU-2015:2399-1 grub2 2015-12-30
SUSE SUSE-SU-2015:2386-1 grub2 2015-12-29
SUSE SUSE-SU-2015:2385-1 grub2 2015-12-29
SUSE SUSE-SU-2015:2387-1 grub2 2015-12-29
openSUSE openSUSE-SU-2015:2392-1 grub2 2015-12-29
openSUSE openSUSE-SU-2015:2375-1 grub2 2015-12-27
Scientific Linux SLSA-2015:2623-1 grub2 2015-12-21
Mageia MGASA-2015-0480 grub2 2015-12-20
Gentoo 201512-03 grub 2015-12-19
Slackware SSA:2015-351-01 grub 2015-12-17
Fedora FEDORA-2015-90c27b6e91 grub2 2015-12-17
Debian DSA-3421-1 grub2 2015-12-16
Ubuntu USN-2836-1 grub2 2015-12-15
Oracle ELSA-2015-2623 grub2 2015-12-15
CentOS CESA-2015:2653 grub2 2015-12-16
Red Hat RHSA-2015:2623-01 grub2 2015-12-15
Fedora FEDORA-2015-cebe5133e7 grub2 2015-12-13
Debian-LTS DLA-368-1 grub2 2015-12-12

Comments (none posted)

kdelibs: privilege escalation

Package(s):kdelibs CVE #(s):CVE-2015-7543
Created:December 10, 2015 Updated:December 31, 2015
Description: From the Debian-LTS advisory:

It has been reported that kdelibs uses the insecure mktemp() function to create the temporary directory it uses to host user-specific sockets. It is thus possible for another user to hijack this temporary directory and gain socket accesses it should not have.

Alerts:
Fedora FEDORA-2015-2f4b92ed2e kdelibs3 2015-12-30

Comments (none posted)

keepassx: information disclosure

Package(s):keepassx CVE #(s):CVE-2015-8378
Created:December 11, 2015 Updated:December 24, 2015
Description:

From the Arch Linux advisory:

It was found that XML export function creates hidden XML file containing user passwords in plaintext without warning, when the export is canceled, which may go unnoticed by the user.

In this case the password database was exported as the file “.xml” in the current working directory (often $HOME or the directory of the database) and is world readable.

Alerts:
Mageia MGASA-2015-0483 keepassx 2015-12-24
Arch Linux ASA-201512-8 keepassx 2015-12-10

Comments (none posted)

kernel: two vulnerabilities

Package(s):kernel CVE #(s):CVE-2015-7515 CVE-2015-8374
Created:December 16, 2015 Updated:December 16, 2015
Description: From the Red Hat bugzilla:

CVE-2015-7515: An out-of-bounds memory access flaw was found in aiptek USB tablet driver in aiptek_probe() function in drivers/input/tablet/aiptek.c. The driver assumes that the interface always has at least one endpoint. By using a specially crafted USB device with no endpoints on one of its interfaces an unprivileged user with a physical access to the system can trigger a kernel NULL pointer dereference causing the system to panic.

CVE-2015-8374: An information leak vulnerability was found when truncating a file to a smaller size which consists of an inline extent that is compressed. The data between the new file size and the old file size were not discarded, wasting metadata space and allowing for the truncated data to be leaked and the data corruption/loss to occur. The number of bytes used by the inode were not correctly decremented, which gives wrong report for callers of the stat(2) syscall. It is possible for a caller of the clone ioctl to actually read the data that was truncated, allowing for a security breach without requiring root access to the system, using only standard filesystem operations.

Note that this is a Btrfs vulnerability; see this commit for details.

Alerts:
Red Hat RHSA-2016:2584-02 kernel-rt 2016-11-03
Red Hat RHSA-2016:2574-02 kernel 2016-11-03
openSUSE openSUSE-SU-2016:2649-1 kernel 2016-10-26
Oracle ELSA-2016-3618 kernel 2016-09-22
Oracle ELSA-2016-3618 kernel 2016-09-22
Oracle ELSA-2016-3617 kernel 2016-09-22
Oracle ELSA-2016-3617 kernel 2016-09-22
SUSE SUSE-SU-2016:2074-1 kernel 2016-08-15
Debian DSA-3607-1 kernel 2016-06-28
Ubuntu USN-2967-2 linux-ti-omap4 2016-05-09
Ubuntu USN-2971-3 linux-raspi2 2016-05-09
Ubuntu USN-2971-2 linux-lts-wily 2016-05-09
Ubuntu USN-2970-1 linux-lts-vivid 2016-05-09
Ubuntu USN-2969-1 linux-lts-utopic 2016-05-09
Ubuntu USN-2968-2 linux-lts-trusty 2016-05-09
Ubuntu USN-2967-1 kernel 2016-05-09
Ubuntu USN-2968-1 kernel 2016-05-09
Ubuntu USN-2971-1 kernel 2016-05-09
SUSE SUSE-SU-2016:1203-1 kernel 2016-05-03
SUSE SUSE-SU-2016:1102-1 kernel 2016-04-19
Scientific Linux SLSA-2016:2574-2 kernel 2016-12-14
SUSE SUSE-SU-2016:0911-1 kernel 2016-03-30
Debian DSA-3426-1 kernel 2015-12-17
Ubuntu USN-2886-2 linux-ti-omap4 2016-02-01
Ubuntu USN-2890-3 linux-raspi2 2016-02-01
Ubuntu USN-2890-2 linux-lts-wily 2016-02-01
Ubuntu USN-2889-2 linux-lts-vivid 2016-02-01
Ubuntu USN-2888-1 linux-lts-utopic 2016-02-01
Ubuntu USN-2887-2 linux-lts-trusty 2016-02-01
Ubuntu USN-2886-1 kernel 2016-02-01
Ubuntu USN-2887-1 kernel 2016-02-01
Ubuntu USN-2889-1 kernel 2016-02-01
Ubuntu USN-2890-1 kernel 2016-02-01
Fedora FEDORA-2015-c4ed00a68f kernel 2015-12-16
Fedora FEDORA-2015-ac9a19888e kernel 2015-12-16

Comments (none posted)

knot: out-of-bound read

Package(s):knot CVE #(s):
Created:December 11, 2015 Updated:December 16, 2015
Description:

From the Fedora advisory:

New upstream release: - security fix: out-of-bound read in packet parser for malformed NAPTR record.

Alerts:
Fedora FEDORA-2015-b5a8f09e32 knot 2015-12-11
Fedora FEDORA-2015-df0f324367 knot 2015-12-11

Comments (none posted)

mozilla: multiple vulnerabilities

Package(s):firefox thunderbird seamonkey CVE #(s):CVE-2015-7201 CVE-2015-7202 CVE-2015-7203 CVE-2015-7204 CVE-2015-7205 CVE-2015-7207 CVE-2015-7208 CVE-2015-7210 CVE-2015-7211 CVE-2015-7212 CVE-2015-7213 CVE-2015-7214 CVE-2015-7215 CVE-2015-7216 CVE-2015-7217 CVE-2015-7218 CVE-2015-7219 CVE-2015-7220 CVE-2015-7221 CVE-2015-7222 CVE-2015-7223
Created:December 16, 2015 Updated:April 18, 2016
Description: From the Arch Linux advisory:

- CVE-2015-7201 CVE-2015-7202 (arbitrary code execution): Mozilla developers and community identified and fixed several memory safety bugs in the browser engine used in Firefox and other Mozilla-based products. Some of these bugs showed evidence of memory corruption under certain circumstances, and we presume that with enough effort at least some of these could be exploited to run arbitrary code.

- CVE-2015-7203 CVE-2015-7220 CVE-2015-7221 (buffer overflow): Security researcher Ronald Crane reported three buffer overflows affecting released code that were found through code inspection. They do not all have clear mechanisms to be exploited through web content but are vulnerable if a mechanism can be found to trigger them.

- CVE-2015-7204 (denial of service): Security researcher Cajus Pollmeier reported crashing during some Javascript variable assignments. The issue was caused by an implementation error with unboxed objects and property storing in the JavaScript engine. This error could result in a potentially exploitable crash when triggered by JavaScript content as well as leading to errors on some websites.

- CVE-2015-7205 (information disclosure): Security researcher Ronald Crane reported an underflow found through code inspection. This does not all have a clear mechanism to be exploited through web content but could be vulnerable if a means can be found to trigger it.

- CVE-2015-7207 (same-origin policy bypass): Security researcher cgvwzq reported that it is possible to read cross-origin URLs following a redirect if perfomance.getEntries() is used along with an iframe to host a page. Navigating back in history through script, content is pulled from the browser cache for the redirected location instead of going to the original location. This is a same-origin policy violation and could allow for data theft.

- CVE-2015-7208 (cookie injection): Security researcher musicDespiteEverything reported an issue when ASCII code 11 for vertical tab is stored in a cookie in violation of RFC6265. This may result in incorrect cookie handling by servers, resulting in the potential ability to set cookie values and read cookie data from users in concert with some web servers if the vertical tab character is mishandled during parsing.

- CVE-2015-7210 (arbitrary code execution): Security researcher Looben Yang reported a use-after-free error in WebRTC that occurs due to timing issues in WebRTC when closing channels. WebRTC may still believe is has a datachannel open after another WebRTC function has closed it. This results in attempts to use the now destroyed datachannel, leading to a potentially exploitable crash.

- CVE-2015-7211 (URL spoofing): Security researcher Abdulrahman Alqabandi reported that when a data: URI is parsed, the hash ('#') symbol is incorrectly handled, allowing for spoofing attacks. This issue could result in the wrong URI being displayed as a location, which can mislead users to believe they are on a different site than the one loaded.

- CVE-2015-7212 (denial of service): Security researcher Abhishek Arya (Inferno) of the Google Chrome Security Team used the Address Sanitizer tool to discover an integer overflow when when allocating textures of extremely larges sizes during graphics operations. This results in a potentially exploitable crash when triggered.

- CVE-2015-7213 (denial of service): Security researcher Ronald Crane reported a vulnerability found through code inspection. This issue is an integer overflow while processing an MP4 format video file when an a erroneously-small buffer is allocated and then overrun, resulting in a potentially exploitable crash.

- CVE-2015-7214 (cross-origin restriction bypass): Security researcher Tsubasa Iinuma reported a mechanism to violate same-origin policy to content using data: and view-soure: URIs to confuse protections and bypass restrictions. This resulted in the ability to read data from cross-site URLs and local files.

- CVE-2015-7215 (information disclosure): Security researcher Masato Kinugawa reported a cross-origin information leak through the error events in web workers. This violates same-origin policy and the leaked information could potentially be used by a malicious party to gather authentication tokens and other data from third-party websites.

- CVE-2015-7216 CVE-2015-7217 (denial of service): Security researcher Gustavo Grieco reported that on Linux Gnome systems the dialog for choosing local files uses the operating system's gdk-pixbuf library to render thumbnails for image file types. This library supports various image decoders, and Grieco reported that the Jasper and TGA decoders were unmaintained and have several known vulnerabilities. Firefox has disabled the use of those decoders in gdk-pixbuf.

- CVE-2015-7218 CVE-2015-7219 (denial of service): Security researcher Stuart Larsen reported two issues with HTTP/2 resulting in integer underflows that lead to intentional aborts when the errors are detected. In the first issue, if a malformed HTTP2 header frame is received with only a single byte, an integer underflow can be created in some circumstances. In the second issue, a malformed HTTP2 PushPromse frame is received and the length of the decompressed buffer is miscalculated, leading to another integer underflow. In both of these instances, more memory is allocated than is allowed, triggering assertions and intentional aborts (a denial of service) but no exploitable crashes.

- CVE-2015-7222 (denial of service): Mozilla developer Gerald Squelart fixed an integer underflow in the libstagefright library initially reported by Joshua Drake to Google. The issues occurred in MP4 format video file while parsing cover metadata, leading to a buffer overflow. This results in a potentially exploitable crash and can be triggered by a malformed MP4 file served by web content.

- CVE-2015-7223 (privilege escalation): Mozilla developer Kris Maglione reported a mechanism where WebExtension APIs could be used to escalate privilege. This could allow arbitrary web content to execute code with the privileges of a particular WebExtension when using these API calls. Depending on the privileges of the extension used, this could result in personal information theft and cross-site scripting (XSS) attacks, including theft of browser cookies. This is mitigated by the requirement to have a WebExtension installed that is vulnerable to this issue.

Alerts:
openSUSE openSUSE-SU-2016:0306-1 firefox 2016-02-02
Ubuntu USN-2859-1 thunderbird 2016-01-13
Scientific Linux SLSA-2016:0001-1 thunderbird 2016-01-06
CentOS CESA-2016:0001 thunderbird 2016-01-06
CentOS CESA-2016:0001 thunderbird 2016-01-06
CentOS CESA-2016:0001 thunderbird 2016-01-06
Oracle ELSA-2016-0001 thunderbird 2016-01-05
Oracle ELSA-2016-0001 thunderbird 2016-01-05
Red Hat RHSA-2016:0001-01 thunderbird 2016-01-05
Fedora FEDORA-2015-6d64c257cf thunderbird 2016-01-02
openSUSE openSUSE-SU-2015:2406-1 Mozilla 2015-12-31
Debian DSA-3432-1 icedove 2016-01-01
Gentoo 201512-10 firefox 2015-12-30
Mageia MGASA-2015-0492 thunderbird 2015-12-28
openSUSE openSUSE-SU-2015:2380-1 xulrunner 2015-12-28
Arch Linux ASA-201512-14 thunderbird 2015-12-25
Slackware SSA:2015-357-01 mozilla-thunderbird 2015-12-23
openSUSE openSUSE-SU-2015:2353-1 firefox 2015-12-24
SUSE SUSE-SU-2015:2336-1 firefox 2015-12-21
SUSE SUSE-SU-2015:2334-1 firefox 2015-12-21
SUSE SUSE-SU-2015:2335-1 firefox 2015-12-21
Slackware SSA:2016-106-01 thunderbird 2016-04-15
Slackware SSA:2016-085-02 thunderbird 2016-03-25
openSUSE openSUSE-SU-2016:0894-1 thunderbird 2016-03-26
Mageia MGASA-2016-0124 iceape 2016-03-25
openSUSE openSUSE-SU-2016:0876-1 thunderbird 2016-03-24
Mageia MGASA-2016-0105 firefox 2016-03-09
Fedora FEDORA-2015-7ab3d3afcf firefox 2015-12-22
Scientific Linux SLSA-2015:2657-1 firefox 2015-12-17
Fedora FEDORA-2015-51b1105902 firefox 2015-12-18
openSUSE openSUSE-SU-2016:0309-1 firefox 2016-02-02
openSUSE openSUSE-SU-2016:0308-1 Seamonkey 2016-02-02
openSUSE openSUSE-SU-2016:0307-1 seamonkey 2016-02-02
Oracle ELSA-2015-2657 firefox 2015-12-16
Oracle ELSA-2015-2657 firefox 2015-12-16
Oracle ELSA-2015-2657 firefox 2015-12-16
Mageia MGASA-2015-0477 firefox 2015-12-16
Debian DSA-3422-1 iceweasel 2015-12-16
CentOS CESA-2015:2657 firefox 2015-12-16
CentOS CESA-2015:2657 firefox 2015-12-16
CentOS CESA-2015:2657 firefox 2015-12-17
Red Hat RHSA-2015:2657-01 firefox 2015-12-16
Ubuntu USN-2833-1 firefox 2015-12-15
Slackware SSA:2015-349-03 firefox 2015-12-15
Fedora FEDORA-2015-c7b1be8823 seamonkey 2015-12-16
Fedora FEDORA-2015-28e56e52e7 seamonkey 2015-12-16
Arch Linux ASA-201512-9 firefox 2015-12-16

Comments (none posted)

oxide-qt: code execution

Package(s):oxide-qt CVE #(s):CVE-2015-8478
Created:December 11, 2015 Updated:December 16, 2015
Description:

From the Ubuntu advisory:

Multiple security issues were discovered in V8. If a user were tricked in to opening a specially crafted website, an attacker could potentially exploit these to read uninitialized memory, cause a denial of service via renderer crash or execute arbitrary code with the privileges of the sandboxed render process.

Alerts:
Ubuntu USN-2825-1 oxide-qt 2015-12-10

Comments (none posted)

proftpd: denial of service

Package(s):proftpd CVE #(s):
Created:December 14, 2015 Updated:December 24, 2015
Description: From the Red Hat bugzilla:

Part of the SFTP handshake involves "extensions", which are key/value pairs, comprised of strings. In SSH, strings are encoded for network transport as a 32-bit length, followed by the bytes.

The mod_sftp module currently places no bounds/length limitations when reading these SFTP extension key/value data from the network. A malicious attacker might attempt to encode large values, and allocate more memory than is necessary.

To avoid undue resource exhaustion by a remote client, mod_sftp should place a limit on the maximum length of acceptable extension keys/values.

Alerts:
Mageia MGASA-2015-0485 proftpd 2015-12-24
Fedora FEDORA-2015-97055df8a0 proftpd 2015-12-12
Fedora FEDORA-2015-7a89e8db70 proftpd 2015-12-11

Comments (none posted)

pygments: shell injection

Package(s):pygments CVE #(s):CVE-2015-8557
Created:December 16, 2015 Updated:December 5, 2016
Description: From the Debian LTS advisory:

It was discovered that there was a shell injection vulnerability in pygments, a syntax highlighting package written in Python.

Alerts:
Debian DSA-3445-1 pygments 2016-01-13
Ubuntu USN-2862-1 pygments 2016-01-07
Gentoo 201612-05 pygments 2016-12-04
Mageia MGASA-2015-0478 python-pygments 2015-12-17
Debian-LTS DLA-369-1 pygments 2015-12-15

Comments (none posted)

qemu: denial of service

Package(s):qemu CVE #(s):CVE-2015-8504
Created:December 14, 2015 Updated:December 29, 2015
Description: From the Red Hat bugzilla:

Qemu emulator built with the VNC display driver support is vulnerable to an arithmetic exception flaw. It occurs on the VNC server side while processing the 'SetPixelFormat' messages from a client.

A privileged remote client could use this flaw to crash the guest resulting in DoS.

Alerts:
openSUSE openSUSE-SU-2016:2494-1 xen 2016-10-11
SUSE SUSE-SU-2016:1785-1 kvm 2016-07-11
openSUSE openSUSE-SU-2016:1750-1 qemu 2016-07-06
SUSE SUSE-SU-2016:1745-1 xen 2016-07-06
SUSE SUSE-SU-2016:1703-1 qemu 2016-06-29
SUSE SUSE-SU-2016:1698-1 kvm 2016-06-28
Mageia MGASA-2016-0023 qemu 2016-01-17
openSUSE openSUSE-SU-2016:0126-1 xen 2016-01-14
openSUSE openSUSE-SU-2016:0124-1 xen 2016-01-14
openSUSE openSUSE-SU-2016:0123-1 xen 2016-01-14
Fedora FEDORA-2015-b406a8e4f2 qemu 2015-12-29
SUSE SUSE-SU-2016:1560-1 qemu 2016-06-13
SUSE SUSE-SU-2016:1318-1 xen 2016-05-17
SUSE SUSE-SU-2016:1154-1 xen 2016-04-26
SUSE SUSE-SU-2016:0955-1 xen 2016-04-05
SUSE SUSE-SU-2016:0873-1 xen 2016-03-24
SUSE SUSE-SU-2016:0658-1 Xen 2016-03-04
Debian DSA-3470-1 qemu-kvm 2016-02-08
Debian DSA-3471-1 qemu 2016-02-08
Debian DSA-3469-1 qemu 2016-02-08
Fedora FEDORA-2015-08e4af5a20 xen 2015-12-20
Gentoo 201602-01 qemu 2016-02-04
Ubuntu USN-2891-1 qemu, qemu-kvm 2016-02-03
Fedora FEDORA-2015-12a089920e xen 2015-12-17
Fedora FEDORA-2015-b2e8518b8e qemu 2015-12-14

Comments (none posted)

xen: denial of service

Package(s):xen CVE #(s):CVE-2015-6654
Created:December 10, 2015 Updated:December 16, 2015
Description: From the Xen security advisory:

XENMAPSPACE_gmfn_foreign dumps the p2m, on ARM, when it fails to get a reference on the foreign page. However, dump_p2m_lookup does not use rate-limited printk.

A malicious infrastructure domain, which is allowed to map memory of a foreign guest, would be able to flood the Xen console.

Domains deliberately given partial management control may be able to deny service to other parts of the system.

As a result, in a system designed to enhance security by radically disaggregating the management, the security may be reduced. But, the security will be no worse than a non-disaggregated design.

Alerts:
Mageia MGASA-2016-0098 xen 2016-03-07
Debian DSA-3414-1 xen 2015-12-09

Comments (none posted)

Page editor: Jake Edge

Kernel development

Brief items

Kernel release status

The current development kernel is 4.4-rc5, released on December 13. "If you have all your Christmas shopping done, I would heartily recommend giving rc5 a whirl in between the eggnogs and the decorations. And if you're not celebrating the holidays, you have no excuse for not testing it all out." Linus expects the 4.4 kernel to come out on time at the beginning of January, but is contemplating delaying the 4.5 merge window to allow developers to recover from the holidays.

Stable updates: 4.3.3, 4.2.8, and 4.1.15 were released on December 14. Note that 4.2.8 is the end of the line for the 4.2.x series from Greg Kroah-Hartman, though the Canonical kernel team has announced plans to maintain this release through August 2016.

Comments (none posted)

Quotes of the week

I can't reasonably expect people to get ready for the merge window while being drunk on eggnog or whatever.
— Linus Torvalds

Maybe people can think of ftrace as a poem. But people will never think that I give such a short speech.
— Steve Rostedt

All's fair in love, war, and code defense.
— Dan Williams

Comments (none posted)

Luu: Files are hard

Here is a lengthy posting from Dan Luu on why it is so hard to safely write files on Unix-like systems. It comes down to a combination of POSIX semantics and filesystem bugs. "Something to note here is that while btrfs’s semantics aren’t inherently less reliable than ext3/ext4, many more applications corrupt data on top of btrfs because developers aren’t used to coding against filesystems that allow directory operations to be reordered (ext2 was the only other filesystem that allowed that reordering). We’ll probably see a similar level of bug exposure when people start using NVRAM drives that only have byte-level atomicity. People almost always just run some tests to see if things work, rather than making sure they’re coding against what’s legal in a POSIX filesystem."

Comments (141 posted)

AMD's 2016 Linux driver plans (AnandTech)

AnandTech reports on AMD's plans for Linux graphics driver support. In short: more open code, but some proprietary components will remain. "The significant change here is that by having the RTG closed source driver based around the open source driver, the company is now only maintaining a single code base, is pushing as much as possible into open source, and that the open source driver is receiving these features far sooner than it was previously. This greatly improves the quality of life for open source driver users, but it’s also reciprocal for RTG: it’s a lot easier to keep up to date with Linux kernel changes with an open source kernel mode driver than a closed source driver, and quickly integrate improvements submitted by other developers."

Comments (34 posted)

Kernel development news

Toward more predictable and reliable out-of-memory handling

By Jonathan Corbet
December 16, 2015
The kernel's out-of-memory (OOM) behavior has been a topic of discussion almost since the inception of the linux-kernel mailing list. Opinions abound on how the kernel should account for memory, whether it should allow memory to be overcommitted, what it means to be out of memory, and what should be done when that situation comes about. There seems to be general agreement on only one thing: OOM situations are bad, and the kernel's handling of OOM situations is even worse. Over the years, numerous developers have tried to improve the situation; the latest attempt can be seen in two patch sets from Michal Hocko.

OOM detection

The first patch set tries to answer a question that one might think would be obvious: how do we know when the system is out of memory? The problem is that a running system is highly dynamic. The lack of a free page to allocate at the moment does not mean that such pages could not be created; given the high cost of invoking the OOM killer, it is best not to declare an OOM situation if the kernel might be able to scrounge some memory from somewhere. Current kernels, though, are a bit unpredictable regarding when they give up and, in some cases, might wait too long.

If there are no pages to satisfy an allocation request, the kernel will perform direct reclaim to try to free some memory. In some cases, direct reclaim will be successful; that happens, for example, if it finds clean pages that can be immediately repurposed. In other cases, though, reclaiming pages requires writing them back to backing store; those pages will not be available for what is, from a computer's perspective, a long time. Still, they should become available eventually, so the kernel is justifiably reluctant to declare an OOM situation for as long as reclaimable pages exist.

The problem is that there are no real bounds on how long it might take for "reclaimable" pages to actually be reclaimed, for a number of reasons. Additionally, the allocator can conceivably find itself endlessly retrying if a single page is reclaimed, even if that page cannot be used for the current allocation request. As a result, the kernel can find itself hung up in allocation attempts that do not succeed, but which do not push the system into OOM handling.

Michal's patch defines a new heuristic for deciding when the system is truly out of memory. When an allocation attempt initially fails, the logic is similar to what is done in current kernels: a retry will be attempted (after an I/O wait) if there is a memory zone in the system where the sum of free and reclaimable pages is at least as large as the allocation request. If the retries continue to fail, though, a couple of changes come into play.

The first of those is that there is an upper bound of sixteen retries; after that, the kernel gives up and goes into OOM-handling mode. That may bring about an OOM situation sooner than current kernels (which can loop indefinitely) will, but, as Michal put it: "OOM killer would be more appropriate than looping without any progress for unbounded amount of time". Beyond that, the kernel's count of the number of reclaimable pages is discounted more heavily after each unsuccessful retry; after eight retries, that number will be cut in half. That makes it increasingly unlikely that the estimate of reclaimable pages will motivate the kernel to keep retrying.

The result of these changes is that the kernel will go into OOM handling in a more predictable manner when memory gets tight. Users will still curse the results, but the system as a whole should more reliably survive OOM situations.

The OOM reaper

At least, that should be the case if the OOM killer is actually able to free pages when the kernel invokes it. As has been seen in recent years, it is not that hard to create a situation where the OOM killer is unable to make any progress, usually because the targeted process is blocked on a lock and the OOM situation itself prevents that lock from being released. If an OOM-killed process cannot run, it cannot exit and, thus, it cannot free its memory; as a result, the entire OOM-killing mechanism fails.

The observation (credited to Mel Gorman and Oleg Nesterov) at the core of Michal's OOM reaper patch set is that it is not necessary to wait for the targeted process to die before stripping it of much of its memory. That process has received a SIGKILL signal, meaning it will not run again in user mode. That, in turn, means that it will no longer access any of its anonymous pages. Those pages can be reclaimed immediately without changing the end result.

The OOM reaper is implemented as a separate thread; this is done because the reaper must be able to run when it is called upon to do its work. Other kernel execution mechanisms, such as workqueues, might themselves be blocked by the OOM situation, so they cannot be counted upon. If this patch is merged, the oom_reaper thread will sit unused on the majority of Linux systems out there, but it will be certain to be available on the systems where it is needed.

The reaper is not without its rough edges. It must still take the mmap_sem lock to free the pages, meaning that it could be blocked if mmap_sem is held elsewhere. Still, Michal says that the probability of trouble "is reduced considerably" compared to current kernels. One other potential problem is that, if the targeted process is dumping core at the time it is killed, removing its pages may corrupt the dump. This tradeoff is worthwhile, though, Michal says, since keeping the system running is more important in such situations.

Memory-management patches are notoriously difficult to get merged into the kernel. With regard to the OOM detection patch, Michal said the work "has been sitting and waiting for the fundamental objections for quite some time and there were none". He would like to see it merged in 4.6 or thereafter. Objections to the OOM reaper have also been hard to find, but there has been no talk yet as to when that patch might head for the mainline. Once these patches get there, the OOM-handling subsystem may work a little better, but it seems unlikely that users will appreciate it any more than they do now.

Comments (10 posted)

Encrypted file backup for ext4

By Jake Edge
December 16, 2015

Backing up files from an encrypted filesystem without having access to the key is a more complicated process than one might think. For one thing, the directory containing the files is likely encrypted as well, so some mechanism to extract an encrypted version of the file name would be needed. A recent patch set posted to the linux-ext4 mailing list would provide support for extracting files from an encrypted ext4 filesystems for backup or other purposes.

Ted Ts'o posted the patches on December 10. They add some ioctl() commands and a mount option to allow administrators to extract the information needed to store a copy of the file without having a copy of the encryption key. It would not, however, allow the restoration of the file without the key. According to Ts'o, manipulating both the encrypted directory and file without the user's key is tricky: "establishing a link means that we have to manipulate both the encrypted directory and the encrypted file, and doing this through the VFS interface is non-trivial"

There are three chunks of information that need to be stored so that a file can be restored: the encrypted file data, an encrypted version of the file name, and the metadata that contains the encryption context that is stored as an extended attribute (xattr). Before a privileged process (i.e. one with CAP_SYS_ADMIN) can read the encrypted file contents, though, the filesystem must be mounted with a newly added option (ciphertext_access).

The patches allow the encrypted file data to be read using the O_DIRECT mechanism. But there is a snag. The file size might not be a multiple of the AES block size (which is used for doing the encryption); reading the short chunk at the end of such a file is not supported by O_DIRECT, Ts'o said. Adding a way to do that would require changes to the direct I/O code, which may be controversial. So instead, a "shadow" copy of the inode is used with a file size that works and the encrypted file is padded with zeroes to that size when read. That is something of a hack, Ts'o acknowledged. In addition, the original file size will need to be added to the list of data that gets stored as part of the backup (i.e. along with the encrypted file name and the encryption metadata).

For the encryption metadata, two ioctl() commands have been added: EXT4_IOC_GET_ENCRYPTION_METADATA and EXT4_IOC_SET_ENCRYPTION_METADATA. As the names imply, they get and set the metadata needed to decrypt the file and file name when the user's key is available. Lastly, the EXT4_IOC_GET_ENCRYPTED_FILENAME command will retrieve the encrypted file name.

Andreas Dilger asked why ioctl() and O_DIRECT were used, rather than virtual xattrs and regular reads. If the key is not present, reading the file could simply return the encrypted contents. That, coupled with virtual xattrs for the other needed pieces, would allow existing tools (e.g. tar --xattrs) to back up the files, he said.

But Ts'o pointed out a few problems with that approach. The problem with the file size will need to be dealt with by any tool that is used. And he is unconvinced that the effort needed to handle file restoration without the key will be worth it. Beyond that, though, his choice of O_DIRECT was deliberate: direct I/O does not use the page cache, so the cache cannot get "poisoned" with pages of encrypted data.

In our current design, the page cache for an encrypted file always contains the plaintext. This is necessary so that mmap(2) will work correctly. So if user B is logged onto a machine where user A is active, and user A's keys are in the kernel, we don't determine access control [decisions] for user B based on whether or not the user has the appropriate keyring in a keyring accessible to them. We use Unix permissions to provide security isolation between two users which are logged in.

He continued by noting that user space should drop the plain text pages from the page cache when user A logs out (and A's keys are removed from the kernel), but that he doesn't want the integrity of an encrypted backup to depend on that. Also, it should still be possible to do an encrypted backup while A is logged in, which can be done when using direct I/O to read the encrypted data. In summary, he said that there are enough reasons that regular backup tools can't be used for this purpose, so "it's simpler all around to use specific ioctls".

Jan Kara expressed concern about the shadow inode "hack". He thought that it might not be needed, since direct I/O reads will return any partial block at the end of the file. In addition, the locking implications of effectively having two copies of the inode for a single file were worrisome, he said. So far, Ts'o has not replied, but removing the shadow inode, if that turns out to be possible, will only simplify matters.

Ts'o also posted a C program and script that he has been using to test the changes. While a mechanism to backup encrypted files is certainly needed, the interface proposed feels a little clunky overall, though there may be no real way around that. Ts'o also alluded to another use case that he has for the feature, which he was unable to disclose, that may partly be guiding the interface as well. Given that he is the ext4 maintainer, though, it seems likely we will see some kind of change along these lines before long.

Comments (2 posted)

Read-mostly research in 2015

December 16, 2015

This article was contributed by Paul McKenney

[Editor's note: this article was co-written by Paul McKenney and Aravinda Prasad].

It has been just over one year since the last LWN article on read-mostly research. However, it is good to see that there have been a number of interesting papers since then related to RCU and other read-mostly topics. This article gives a quick summary of them.

Validation

Joseph Tassarotti (Carnegie-Mellon University), Derek Dreyer (Max Planck Institute for Software Systems), and Viktor Vafeiadis (also MPI-SWS) carried out a manual proof of correctness of the quiescent-state-based reclamation (QSBR) variant of user-space RCU. This paper modeled rcu_dereference() with C11 memory_order_acquire loads rather than the memory_order_consume loads intended for that purpose. However, given the current parlous state of memory_order_consume [PDF], this shortcut is quite understandable. Their paper is titled “Verifying Read-Copy-Update in a Logic for Weak Memory [PDF]” and appeared in the 2015 Proceedings of the 36th annual ACM SIGPLAN conference on Programming Language Design and Implementation. Another researcher asked me if I felt that their assumptions were adequate, and as previously reported here, I replied that, since they found no bugs, their assumptions clearly must be unrealistic. In the authors' defense, the proof is highly non-trivial, so the lack of bugs was not due to lack of effort.

Iftekhar Ahmed of Oregon State University gave a presentation to the Scalability microconference of the 2015 Linux Plumbers Conference describing a “mutant” technique for verifying test suites that he is applying to Linux-kernel RCU. Each mutant is a copy of the RCU code, but with a single change, or “mutation”. For example, a given statement might be deleted, a comparison operator might be changed, or a constant might be changed. The question is then whether rcutorture will complain about the mutant. Mutants that rcutorture does not complain about are said to have “survived”.

Of course, some mutants will never produce a complaint. For example, a mutation that removes a BUG_ON() or that changes (say) “while (1)” to “while (2)” produces a correct program. Some manual inspection of surviving mutants is therefore required. However, such manual inspection has been rewarded by the finding of not one but two holes in rcutorture, one of which was hiding a real bug—in Tiny RCU, believe it or not. [Full disclosure: I am collaborating with Iftekhar and his professors, Alex Groce and Carlos Jensen, and am co-author on a resulting paper [PDF].]

Quick Quiz 1: Wait a minute!!! How can you possibly create a logic expression that represents all executions of a parallel program???
Answer
The past year also saw the release of version 5 of the University of Oxford C Bounded Model Checker (CBMC), led by Daniel Kröning. CBMC takes a C program as input, and creates a logic expression that takes the program's inputs as inputs, and that evaluates to true if some combination of those inputs can trigger an assert or result in an array-out-of-bounds condition. This new version introduces multiprocessor capability (including some weak-memory support), and is capable of automatically verifying some trivial RCU implementations, including the Linux kernel's Tiny RCU. It is early days for CBMC's multiprocessor feature, but its appearance is a welcome development.

Using and implementing RCU

Mike Ash posted a description of an RCU-like primitive in Apple's Objective-C runtime. Interestingly enough, this approach identifies read-side critical sections via designated code ranges. This of course means that it scans all CPUs' program counters in order to identify grace periods. This approach is interesting in being a distinct method of achieving zero-overhead read-side critical sections, albeit one that poses some interesting practical challenges for large read-side critical sections that call many functions and for reliable sampling of other CPUs' program counters without undue degradation of realtime response.

Editor's note: for those wondering how an algorithm that takes locks can be "lock-free," you're not alone. According to Paul, in common academic usage, "lock-free" means "at least one thread is guaranteed to make progress." Algorithms that do not take locks at all, instead, are "lockless."
Pedro Ramalhete and Andreia Correia took a much simpler approach, using reader-writer locking to implement RCU, resulting in what they call poor-man's URCU [PDF]. Although this is by no means the first lock-based implementation of RCU, it is, as far as I know, the first lock-based implementation that boasts lock-free readers. Their trick is to use not one but two reader-writer locks. Readers loop doing a read-side trylock on each of these two locks in turn, exiting the loop upon successful acquisition of either of the two locks. Writers are serialized by another lock, and simply write-acquire and write-release the two reader-writer locks in succession. If a writer is delayed while write-holding one of these two locks, readers can still make progress by acquiring the other lock. Although poor man's RCU seems unlikely to become a production-quality implementation of RCU, it is worth studying in its own right. After all, it is not every day that someone achieves non-blocking forward-progress guarantees with what is usually considered to be a blocking primitive!

Maya Arbel and Adam Morrison, both of Technion, wrote a paper titled “Predicate RCU: An RCU for Scalable Concurrent Updates [PDF]”. This title might come as quite a surprise to those of us for whom RCU has long provided eminently scalable updates. However, Arbel and Morrison were working with an internal tree whose non-leaf nodes can contain data, described here [PDF]. It turns out that deleting an item from an internal tree is more complex than in an external tree where only leaf nodes contain data. This added complexity is especially vexing because RCU-protected readers cannot be excluded, which is a particular problem when those readers are finding the spot in which to do an insertion. This interaction between complex deletions and RCU lookup-insertions is handled by holding locks across grace periods, which can degrade both performance and scalability. Of course, holding locks across grace periods places those grace periods on the critical path, which motivated the authors to work hard to reduce grace-period duration, hence predicate RCU.

Predicate RCU allows updaters to wait only on those readers that are involved with the update in question, which should shorten grace periods. This should in turn reduce the penalty for holding locks across grace periods, however, there is no free lunch: Shorter grace periods mean fewer updates per grace period and thus higher per-update overhead. This effect is anything but subtle: a 2004 USENIX paper notes that RCU has been observed satisfying more than 1,000 updates with a single grace period while running an unremarkable workload. Nevertheless, if you must hold a lock across a grace period, a shorter grace period is going to be a good thing, as can be seen in the Linux kernel's synchronize_net() function, which uses synchronize_rcu_expedited() when called with the networking layer's RTNL lock held.

Quick Quiz 2: Given the performance penalties, shouldn't someone stop researchers from holding locks across grace periods?
Answer
Therefore, given that Arbel and Morrison need to hold locks across RCU grace periods, they need short grace periods. To this end, predicate-RCU readers associate themselves with an algorithm-specific value. For example, readers of a hash table might associate themselves with the lookup key, which would allow updaters to wait only for those readers whose keys hashed to the hash bucket being updated. This is in some ways similar to the Linux kernel's SRCU, where the srcu_struct serves as the value associating readers and updaters. Either way, given that updaters only need to wait on a small subset of the readers, one would expect grace periods to elapse more quickly, which would in turn be expected to reduce the penalty for waiting for a grace period while holding a lock. Their performance results meet this expectation: Although they do not achieve linear scalability, shorter grace periods do improve their performance. Of course, avoiding waiting for grace periods while holding locks would likely improve performance and scalability even more!

Developers who assume that academics ignore their work will be happy to see that this paper cites a couple of LWN articles.

Yujie Liu (Lehigh University), Victor Luchangco (Oracle Labs), and Michael Spear (also Lehigh) wrote a 2013 paper titled “Mindicators: A Scalable Approach to Quiescence [PDF]”. This paper presses the scalable non-zero indicator (SNZI) [$PDF] technique into service as a grace-period mechanism, and compares it to several other approaches. The intent appears to be to use this mechanism to implement transactional memory (TM), which also appears to require low-latency grace periods, in part courtesy of TM's linearizability requirements, which in turn seems to limit scalability. They do call out the relationship to RCU.

Alexander Matveev (MIT), Nir Shavit (MIT and Tel-Aviv University), Pascal Felber (University of Neuchâtel), and Patrick Marlier (also University of Neuchâtel) recently published a Symposium on Operating Systems Principles (SOSP) paper titled “Read-Log-Update: A Lightweight Synchronization Mechanism for Concurrent Programming [PDF]”, which can be thought of as a software transactional memory (STM) extension that includes explicitly marked read-only transactions. However, unlike RCU readers, these read-only transactions are guaranteed to see a point-in-time snapshot of the union of all RLU-protected data structures across multiple traversals. Of course, this does impose significant additional overhead on RLU updaters, as they acknowledge in their Figure 7, which shows RLU updaters being 2-5 times slower than RCU updaters. That said, this figure shows a benchmark that favors RCU rather heavily. With or without the point-in-time snapshots, I believe that their realization of the importance of explicitly marking read-only operations is a great step forward. Updates to shared variables are also explicitly marked, providing performance benefits over pure STM similar to those of SwissTM [PDF].

Quick Quiz 3: If RCU does not provide readers a guaranteed consistent snapshot of the data structure, how can anyone successfully use it?
Answer
Their technique scales reasonably well up to 16 CPUs, however, this is a very small system for modern non-mobile workloads. They do have one graph (uppermost graph in Figure 8) that goes up to 80 CPUs, but this shows poor scalability. My first thought was that this poor scalability was due to their single global counter that is atomically incremented on each update, but this did not make sense because RLU is outperforming RCU. Instead, the culprit seems to be the need to hold locks across grace periods. Because RCU optimizes for low per-update overhead at the expense of grace-period latency, and because synchronize_rcu() was used (instead of call_rcu() or synchronize_rcu_expedited()), holding locks across grace periods hurts RCU even more than it hurts RLU. Once again, I recommend either releasing locks before waiting for grace periods or using the asynchronous call_rcu() primitive: Both approaches avoid degraded scalability. In (thankfully rare) Linux-kernel cases where it is absolutely necessary to wait for grace periods while holding a mutex, the synchronize_rcu_expedited() APIs can be used, though these are not particularly good for realtime applications (with the exception of synchronize_srcu_expedited()).

Their performance testing includes both user-space and Linux-kernel scenarios. In the Linux-kernel scenarios shown in Figure 9, their list-traversal code beat that of the Linux kernel by a surprisingly large margin. In an impressive display of good sportsmanship, one of the authors (Marlier) located the Linux-kernel performance bottleneck and submitted a fix that causes the Linux kernel's lists to outperform those of the paper. The problem was a single non-atomic store and load to an unshared location in the running task's stack, with no memory barriers. It appears that current microprocessors' pipelines can be a bit slow to handle a load from a location that the current CPU just stored to. Patrick eliminated this store and load, and his patch was accepted during the v4.4 merge window.

As far as I know, this is the first academic use of the rcutorture test suite to test an alternative RCU-like implementation, which is a nice milestone. Those wanting some more detailed discussion on RLU, including graphics showing scalability issues on larger systems, can find it on this page.

At the end of the paper, the authors express hope that RLU will be used both in kernel and in user-space programs. This of course raises the question of what situations would be best suited for an RLU solution. Two possibilities come to mind:

Quick Quiz 4: Shouldn't RLU be tried on complex RCU uses such as the Linux kernel's VFS dentry cache-walk code?
Answer
  • Situations where RCU readers are used in conjunction with sequence locking. These situations are already paying the complexity and performance costs of retries, so these RLU disadvantages might be less of a problem in this case.

  • Situations where a problematic reader-writer lock has proven difficult to convert to RCU. Perhaps RLU's snapshotted readers might better handle some of these situations.

That said, I strongly suspect that successful application of RLU will require the authors to carefully separate those semantics that are actually required from those semantics that are merely fashionable.

It is easy to get irritated at academics' insistence on linearizability, given the large performance and scalability penalties they pay to achieve it. On the other hand, they do use deferral to improve performance of RLU, and perhaps further work along these lines will persuade them to let go of linearizability.

Frans Kaashoek presented on the history of parallelism and operating systems [PDF] during the SOSP 2015 History Day Workshop to mark SOSP's 50th anniversary. Frans devoted a full slide of a 33-slide deck to RCU, which should be a point of pride for the many developers who have applied RCU within the Linux kernel. (Yes, I am happy on behalf of my work on the RCU infrastructure, but let's face it, the infrastructure is profoundly uninteresting without its many uses.)

Peter Denning also presented in SOSP 2015 History Day, but on OS Foundations [PDF]. Those who know me will not be surprised to hear that Peter's last bullet on his slide 39 resonated with me: “Theory follows practice”.

So what have I been doing? For my part, I have continued my work enabling complex atomic updates to RCU-protected data structures with minimal copying, which I recently presented [PDF] at linux.conf.au. This round dealt with some bottlenecks in user-mode memory allocators, relearning the lesson that Glibc malloc() is not at all scalable. I have also been working to repair C11's and C++11's memory_order_consume feature, which just might be nearly done. I rewrote the Linux kernel's synchronize_rcu_expedited() and synchronize_sched_expedited() to reduce OS jitter and, for good measure, added kernel parameters to suppress expedited grace periods entirely. I also started work on design documentation for the Linux kernel's RCU implementation, starting with its requirements. Finally, I have upgraded rcutorture in an attempt to keep up with the Linux kernel's huge installed base.

Conclusions

It is very good to see continued academic interest in read-mostly techniques such as RCU. I very much hope that the mutual learning process continues, and that it benefits Linux developers and their users!

Acknowledgments

We all owe thanks to Srivatsa Bhat, K. Gopinath, Orran Krieger, Pedro Ramalhete, Mike Ash, Derek Dreyer, Joe Tassarotti, Iftekhar Ahmed, Adam Morrison, and Hagit Attiya for helping to make this human-readable. I am grateful to Jim Wasko for his support of this effort.

Answers to Quick Quizzes

Quick Quiz 1: Wait a minute!!! How can you possibly create a logic expression that represents all executions of a parallel program?

Answer: CBMC converts the parallel program into single static assignment (SSA) form, which results in each variable having a separate instance for each assignment to it. Each read from that variable is then wired up to one of the instances that it might have read its value from, and all combinations are represented in the resulting logic expression.

Of course the resulting logic expression might be quite large, but modern computers and modern SAT solvers have grown quite capable. For example, in 1990, a world-class SAT solver might be able to handle 100 variables, that is, three 32-bit variables with four bits left over. In contrast, in 2015, I have solved a 1.8 million variable SAT problem on my laptop.

The solution took a full ten seconds.

Back to Quick Quiz 1.

Quick Quiz 2: Given the performance penalties, shouldn't someone stop researchers from holding locks across grace periods?

Answer: No.

First, please note that holding locks (or, in the Linux kernel, mutexes) across grace periods makes perfect sense in some cases, for example, in the synchronize_net() example given earlier. In addition, in some cases, holding locks across grace periods on rarely executed slow paths can greatly reduce complexity. Second, even though I recommend strongly against holding locks across grace periods on fast paths, it is quite possible that researchers exploring this technique will nevertheless come up with something useful. That said, I do indeed suspect that they would make better progress if they moved their grace periods outside of locks. Third, waiting for highly optimized grace periods is not likely to be a big problem on small systems. (Pretty amazing that a 64-CPU system can now be considered “small”, isn't it?) Fourth and finally, it is their job to figure out what they work on. I would no more wish to dictate what they do than I would wish them to dictate what I do.

Back to Quick Quiz 2.

Quick Quiz 3: If RCU does not provide readers a guaranteed consistent snapshot of the data structure, how can anyone successfully use it???

Answer: It turns out that RCU does in fact guarantee a consistent snapshot—at zero cost—in some important special cases. Perhaps the most common case is a data structure where updaters are restricted to adding new elements or removing old ones, in other words, where in-place updates are prohibited. If each reader only ever looks up a single element, then readers will automatically see a consistent snapshot of that single element—even if a given reader looks up a different element each time it executes.

There are many other use cases where RCU provides consistent snapshots for free, and quite a few of them may be found in the Linux kernel. However, it is also the case that consistency guarantees are overrated. After all, the finite speed of light sharply limits the degree of consistency that a given data structure can usefully maintain with its corresponding external real-world state. Given that the whole point of many data structures is to track external state, internal consistency all too often becomes nothing more than an expensive fiction.

Back to Quick Quiz 3.

Quick Quiz 4: Shouldn't RLU be tried on complex RCU uses such as the Linux kernel's VFS dentry cache-walk code?

Answer: That might well be the case. I therefore have already pointed one of the authors (Matveev) at Neil Brown's excellent LWN series here, here, and here. Matveev's initial response was as follows: “The dcache/dentry + RCU + various locks is really a complex structure... ” I take this as a good sign, in that Matveev should not be blinded by overconfidence.

Back to Quick Quiz 4.

Comments (10 posted)

Patches and updates

Kernel trees

Linus Torvalds Linux 4.4-rc5 ?
Greg KH Linux 4.3.3 ?
Greg KH Linux 4.3.2 ?
Greg KH Linux 4.2.8 ?
Greg KH Linux 4.1.15 ?
Luis Henriques Linux 3.16.7-ckt21 ?

Architecture-specific

Core kernel code

Frederic Weisbecker nohz: Tick dependency mask v4 ?

Device drivers

Device driver infrastructure

Documentation

Filesystems and block I/O

Memory management

Networking

Security-related

Virtualization and containers

Miscellaneous

Page editor: Jonathan Corbet

Distributions

Ubuntu Touch, three years later

By Jonathan Corbet
December 16, 2015
Back in early 2013, your editor dedicated a sacrificial handset to the testing of the then-new Ubuntu Touch distribution. At that time, things were so unbaked that the distribution came with mocked-up data for unready apps; it even came with a set of fake tweets. Nearly three years later, it seemed time to give Ubuntu Touch another try on another sacrificial device. This distribution has certainly made some progress in those years, but, sadly, it still seems far from being a competitive offering in this space.

In particular, your editor tested version 16.04r3 from the testing channel on a Nexus 4 handset. The Nexus 4 is certainly past its prime at the end of 2015, but it still functions as a credible Android device. It is, in any case, the only phone handset on the list of supported devices other than the three that were sold (in locations far from your editor's home) with Ubuntu Touch pre-installed. It is a bit discouraging that Ubuntu Touch is not supported on a more recent device; the Nexus 4 was discontinued over two years ago.

People who are accustomed to putting strange systems on Nexus devices know the drill fairly well: unlock the bootloader, install a new recovery image if necessary, then use the fastboot tool to flash a new image. Ubuntu Touch does not work that way; instead, one must use a set of tools available only on the Ubuntu desktop distribution. Your editor's current menagerie of systems does not include any of those, but, fortunately, running the Ubuntu 15.10 distribution off a USB drive works just fine. It must be said, though, that Ubuntu appears not to have gotten the memo regarding high-DPI laptop displays; 15.10 is an exercise in eyestrain on such a device.

Once the requisite packages have been installed, the ubuntu-device-flash command can be used to install Ubuntu Touch on the phone. It finds the installation image wherever Canonical hides them (it's not obvious where that is) and puts it onto the phone; the process, on the Nexus 4, took about three hours — a surprisingly long time. Among other things, it installs a Ubuntu-specific recovery image, regardless of whether that should be necessary or not. The installation takes up about 4.5GB of space on the device. At the end, the phone reboots and comes up with the Ubuntu Touch lock screen, which has changed little in the last three years. The first boot takes a discouragingly long time, but subsequent reboots are faster, perhaps faster than Android on the same device.

Alas, that's about the only thing that is faster than Android. The phone starts sluggish and gets worse as time goes on. At one point it took a solid minute to get the dialer screen up on the running device. Scrolling can be jerky and unpleasant to work with. At least once, the phone bogged down to the point that there was little alternative to shutting it down and starting over.

Logging into the device over the USB connection offers some clues as to why that might be. There were no less than 258 processes running on the system. A number of them have "evolution" in their name, which is never a good sign even on a heftier system. Daemons like NetworkManager and pulseaudio are running. In general, Ubuntu Touch seems to have a large number of relatively large moving parts, leading, seemingly, to memory pressure and a certain amount of thrashing.

Three years ago, Ubuntu Touch was built on an Android chassis. There are still bits of Android that show up here and there (it uses binder, for example), but a number of those components have been replaced. This release runs an Android-derived kernel that identifies itself as "3.4.0-7 #39-Ubuntu". 3.4.0 was released in May 2012, so it is getting a bit long in the tooth; the 3.4.0 number suggests this kernel hasn't even gotten the stable updates that followed that release. Finding the source for the kernel in this distribution is not easy; it must almost certainly be hidden somewhere in this Gerrit repository, but your editor ran out of time while trying to find it. The SurfaceFlinger display manager has been replaced by Ubuntu's own Mir, with Unity providing the interface. Upstart is the init system, despite the fact that Ubuntu has moved to systemd on desktop systems.

When one moves beyond the command-line interface and starts playing with the touchscreen, one finds that the basics of the interface resemble what was demonstrated three years ago. Swiping from the left edge brings the [Overview screen] Unity icon bar (but no longer switches to a home screen; the "home screen" concept doesn't really seem to exist anymore). Swiping from the right will either switch to another application or produce an overview of running applications; it's not clear how it decides which. The overview provides a cute oblique view of the running applications; it's sufficient to choose one, but seems somewhat wasteful of screen space. Swiping up from the bottom produces an application-specific menu — usually.

The swipe gestures work well enough once one gets used to them, but there is scope for confusion. The camera app, for example, will instruct the user to "swipe left for photo roll," but, unless one is careful to avoid [Swipe left] the right edge of the screen, that gesture will yield the overview screen instead. One can learn subtleties like "swipes involving the edge" and "swipes avoiding the edge," but one could argue that such an interface is more difficult than it needs to be and less discoverable than it could be.

Speaking of the camera app, it takes pictures as one might expect, and it has gained a high-dynamic-range mode in recent years. It still has no support for stitching together photos in a panorama or "photo sphere" mode, though.

The base distribution comes with a fairly basic set of apps. Many of them appear to be interfaces to an associated web page; the Amazon, GMail, and Facebook apps, for example. Something called "Shorts" appears to be an RSS reader, though it seems impervious to the addition of arbitrary feeds. There is a terminal app, but it prompts for a password — a bit surprising [Terminal emulator] given that no password had ever been supplied for the device (it turns out that one should use the screen-lock PIN here). It's not clear that this extra level of "security" is helpful, given that the user involved is already able to install, launch, and run applications on the device, but so it goes.

Despite the presence of all those evolution processes, there is no IMAP-capable email app; there are also no mapping apps. There is a rudimentary web browser with Ubuntu branding; it appears that this browser is based on Chromium. The weather app is limited to a few dozen hardwired locations worldwide; the closest supported location to LWN headquarters was Houston, which, one assumes, is unlikely to be dealing with the foot of snow your editor had to shovel while partway through this article. One suspects we would have heard about that.

Inevitably, there is a store from which one can obtain other apps. There are, for example, a couple of seemingly capable, OpenStreetMap-based mapping apps there, including one that claims turn-by-turn navigation, but nothing requiring GPS access worked in your editor's tests. Games abound, of course, but [Maps] there is little in the way of apps that are well known in the Android or iOS worlds. The store will refuse to allow the installation of apps until one creates a "Ubuntu One" account; that is unfortunate, but most Android users never get anywhere near that far before having to create or supply a Google account.

Canonical puts a fair amount of energy into promoting its "scopes," which are said to be better than apps for the aggregation of content. In truth, they seem to just be another type of app with a focus on gathering information from more than one source. Although, with "branded scopes," the "more than one source" part is often deliberately put by the wayside. Your editor played around with scopes for a while, but, in truth, could not find what was supposed to make them special.

Permissions management in Ubuntu Touch resembles that found in recent Android releases: the user will be prompted the first time an application tries to exercise a specific privilege. As with Android, the number of [Permissions request] actions requiring privilege is relatively small, and "connect to any arbitrary site on the Internet" is not among them. Access to location information or the camera, though, will generate a prompt. There is also, again as with Android, a way to control which applications are allowed to place notifications on the screen.

Ubuntu Touch still seems to drain the battery far more quickly than Android does on the same device. Indeed, it is barely able to get through the night while sitting idle. There is a cute battery app that offers a couple of "ways to reduce battery use," but it lacks Android's ability to say which apps are actually draining the battery (though, it must be said, that information from Android is often less helpful than one might hope).

The keyboard now has proper multi-lingual support (though there is no visual indication of which language is currently in effect) and, as with Android, one can switch between languages on the fly. It offers word suggestions, does [Keyboard] spelling correction, and all the usual things. One missing feature, though, is "swipe" typing which, your editor has found, can speed the process of inputting text on a small keyboard considerably. There is also no voice input; no major loss from your editor's point of view, but others will probably see that differently.

There is a lot to like in Ubuntu Touch. There is some appeal to running something that looks like a proper Linux system, even if it still has a number of Ubuntu-specific components. One does not get the sense that the device is watching quite as closely as Android devices do, though it's not entirely clear, for example, what happens with location data or where it might be stored. In any case, a Ubuntu device clearly has more free software on it than most alternatives do; there is no proprietary "play services" layer maintaining control over the system.

Sadly, though, this distribution still is not up to the capabilities and the performance of the big alternatives. Switching to Ubuntu Touch means settling for a much slower system, running on a severely limited set of devices, with a relative scarcity of apps to choose from. Your editor would very much like to see a handset distribution that is more free and more open than the alternatives, but that distribution must also be competitive with those alternatives, and that does not seem to be the case here. Unless Canonical can find a way to close the performance and feature gaps with Android, it seems unlikely to have much hope of achieving uptake that is within a few orders of magnitude of Android's.

Comments (34 posted)

Brief items

Distribution quote of the week

openSUSE is a voluntary based effort, with the help of some commercial entities. (Read it as : people are offered by their employer to spend some of their paid time, to help on openSUSE project)

I'm one of those. But it doesn't mean none of my free time is used to do the same thing. By passion ? Perhaps, but my main motivation is to have tools that works.

-- Bruno Friedmann

Comments (none posted)

Release for CentOS Linux 7 (1511)

The CentOS project has announced the release of CentOS Linux 7 (1511), derived from Red Hat Enterprise Linux 7.2. "This release supersedes all previously released content for CentOS Linux 7, and therefore we highly encourage all users to upgrade their machines. Information on different upgrade strategies and how to handle stale content is included in the Release Notes."

Full Story (comments: none)

SUSE Linux Enterprise 12 Service Pack 1 released

The SUSE Studio blog looks at the release of SUSE Linux Enterprise 12 SP1. This service pack includes updates to OpenJDK, PostgreSQL, Python, and more. See the release notes for details.

Comments (none posted)

Distribution News

Debian GNU/Linux

AppStream / DEP-11 support now available in the Debian archive

DEP-11 is a Debian extension proposal to enhance the metadata provided by the Debian archive. "AppStream is a metadata specification, describing software components and which packages they are contained in. A software component can be anything, from a desktop-application over a font to a driver or firmware. DEP-11 is a YAML-based version of the XML AppStream specification. On Debian, we generate the DEP-11 metadata (currently mainly for desktop-applications, other components will follow), and make it available in the archive, for APT to download."

Full Story (comments: none)

Bits from the Debian Continuous Integration project

The Debian Continuous Integration project was launched almost two years ago. This is an update on the latest developments. "The effort of transforming debci in a distributed system was started by Martin Pitt, who did an huge amount of work. In the latest months I was able to complete that work, to a point where I am confident in letting it run (mostly) [unattended]. We also had lots of contributions to the web UI from Brandon Fairchild, who was a GSOC intern in 2014, and continues to contribute to this date. All this work culminated in the migration from a single-worker model to a master/workers setup, currently with 10 worker nodes. On busy periods all of those worker nodes will go on for days with full utilization, but even then the turnaround between package upload and a test run is now _a lot_ faster than it used to."

Full Story (comments: none)

Fedora

Fedora elections

Fedora elections have concluded and the results are available. There were 7 seats open for the FAmSCo election. The winners are Christoph Wickert, Sirko Kemter, Truong Anh Tuan, Abdel G. Martínez L., Gabriele Trombini, Luis Bazan, and Giannis Konstantinidis. Robert Mayr is the winner of the single open seat on the Council. FESCo had five open seats that went to Kevin Fenzi, Adam Miller, Jared Smith, Kalev Lember, and Parag Nemade.

Comments (none posted)

Newsletters and articles of interest

Distribution newsletters

Comments (none posted)

Klumpp: What’s up in Tanglu?

Matthias Klumpp has an update on Tanglu. Version 4 of the Debian-based distribution was planned for this month, but the release has been postponed until February/March 2016. "Reason for this change in schedule is the GCC 5 transition (and more importantly the huge amount of follow-up transitions) as well as some other major infrastructure tasks, which we would like to complete and give them a good amount of testing before releasing. Also, some issues with our build system, and generally less build power than in previous releases is a problem (At least the Debile build-system issues could be worked around or solved). The hard disk crash in the forum and bugtracking server also delayed the start of the Tanglu 4 development process a lot. In all of these tasks, manpower is of course the main problem 😉"

Comments (2 posted)

GeckoLinux: This Baby Knows What It's Doing (LinuxInsider)

LinuxInsider reviews GeckoLinux. "GeckoLinux is a newcomer. I mean very new. Its first release was last week. You shouldn't view this distro as a wailing infant, however. It's based on openSuse Leap 42.1 and was leapfrogged into near-instant maturity from Suse Studio, a Web application for building and testing software applications in a Web browser. No, it's not a Chromebook-like operating system. Rather, it's a fully functional Linux distro that taps into the Suse Linux infrastructure. It is a marked improvement over traditional Suse-based distros. That is what led its developer to create a better Linux mousetrap with GeckoLinux."

Comments (none posted)

Page editor: Rebecca Sobol

Development

A preview of Android Studio 2.0

December 16, 2015

This article was contributed by Adam Saunders

The official development tools for Android apps the have gone through some significant changes over the past few years. Originally, a version of Eclipse with a plugin for Android development (which is typically done in Java), called Android Developer Tools (ADT), was Google's official choice for an integrated development environment (IDE). However, that option will be abandoned by the end of this year. In May 2013, a new Java IDE, Android Studio, was announced at the Google I/O developer conference. Android Studio has since become the recommended option for Android developers. With a 2.0 preview unveiled in November, and given that the Eclipse-based alternative will soon cease to be a feasible alternative, it is a good time for an overview of the tool.

[Editor]

As with other sophisticated IDEs, Android Studio comes with many features to simplify the process of writing code. There's syntax highlighting for better readability. Another feature is smart rendering, which checks for certain rendering errors, such as a failure to specify dimensional attributes in graphical layouts, and provides a button to press that automatically fixes the error. There is also message filtering, which helps developers locate error messages in build results.

Developers can also annotate sections of source code to flag them for code inspection tools, which is great aid to help catch errors. Those familiar with using the open-source IntelliJ IDEA IDE to write Java code will find themselves right at home; Android Studio is based on IntelliJ IDEA, and inherits the keybindings for coding shortcuts, like pressing Ctrl + D to copy source code quickly.

In general, working with Android Studio gives a developer a feel of a "one-stop-shop" for getting Android development done. It is fast, with visual and other tools that one couldn't find in a text editor or another Java IDE that is not geared toward Android development. For example, a developer can drag and drop "widgets", such as buttons or a progress bar, to a virtual Android device, and the necessary changes will appear in the appropriate XML file.

To facilitate making consistent user interfaces for different devices, which have considerable variance in screen size and resolution, Android Studio uses "density-independent pixel" ("dp") as a unit of measurement. One dp is equivalent to one pixel on a 160-dpi screen, like the 3.5 inch screen with 480 x 320 resolution on older phones. So if a developer were to specify in an XML file that the width of a form field is 100 dp, it would be 100 pixels long on the older phone, but 300 pixels long on the 480 dpi Nexus 5. This built-in support for density independence is a crucial feature for Android developers.

There's a number of APIs that developers can work with to make use of all of the features of a mobile Android device. Extensive documentation of them is available online; simply clicking on a line of code and pressing Ctrl + Q will pop-up relevant documentation within the IDE. Additional APIs are available through the SDK Manager and some, like Google Play Services, are essential to publishing apps on proprietary Google Play Store.

Android has sophisticated APIs for working with OpenGL, which include methods and classes for essential elements like defining and drawing shapes, applying projection, and adding motion. Developers can get started quickly by adding a view container, which serves as the foundation for working with graphics in Android app development.

Being able to write code is only one part of a good development environment; an IDE must also be able to account for the testing and debugging needs of developers. This is where the built-in Android Device Monitor fits in. The monitor is full of testing features, like the Dalvik Debug Monitor Server "which provides port-forwarding services, screen capture on the device, thread and heap information on the device, logcat, process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more". The monitor also has a GPU monitor to see how demanding an app is on a device's GPU, and a network monitor to analyze the network activity of the device while it is running the app.

After installing the IDE (builds for Linux, Windows, and Mac OS X can be downloaded here) one begins a project by clicking "Start a new Android Studio project". Then the developer chooses a name for the application and a "Company Domain" name. The domain is used as a fingerprint to distinguish an app from another app with the same name on an app store, like the proprietary Google Play App Store. One can also publish Android applications in other ways, such as via the free-and-open-source software only F-Droid repository. The Company Domain appears as the inverse of a domain name. The package name will then be the Company Domain with the application name appended; for example, com.johndoe.dinnerrecipes.

[Form factors]

Before writing a single line of code, a developer must choose which platform to target: "Phone and Tablet" for the traditional Android market; "Wear" for wearable devices such as the Motorola Moto 360 smart watch; "TV" for smart televisions; "Android Auto" for mobile devices connecting to the head unit of an officially compatible automobile; and "Glass" for the head-mounted Google Glass display. While production on Glass has been halted for almost a year, Google does plan to release another version of the product in the future.

For the first three options, the developer must pick a minimum API level to target. Picking a more recent API will allow access to more features, but will prevent running the application on older version of Android. The default minimum for "Phone and Tablet", targeting Android 4.0.3 and later, "will run on approximately 96.2% of the devices that are active on the Google Play Store", according to the program (see screen shot at right).

After the target platform, one chooses whether or not to add an "Activity", which is an application section that will "provide a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map". Adding an Activity inserts the relevant base source code into the new project, simplifying initial work. This leads to the project itself where coding is done. After adding some code, a developer can compile it into an .apk file and load it onto an Android device to test it out, or use the built-in emulator to see how it runs.

The formerly sluggish emulator, which used to be one of the pain points of using Android Studio, is now much faster in 2.0 thanks to optimizations made by Google's developers. It's also full of new features, like being able to resize the emulated Android device on the fly, rotate the screen, as well as to spoof GPS locations, text messages, battery energy levels, and more.

The other major improvements in Android Studio 2.0 are: Instant Run, a GPU Profiler, and improved build times. Instant Run allows editing a project's source code or media assets while the application is running in the Studio emulator and to see the changes immediately with the push of a button. The GPU Profiler, which is still in an early stage, lets one optimize OpenGL ES development to make the best use of an Android device's GPU. Finally, the first build of a project's source code will be at least twice as fast as before, thanks to Google's focus on speed improvements in its Gradle-based build system. These changes will be welcome to Android developers looking to speed up their workflow. More technical details can be found by watching the keynote video announcement [YouTube].

While the project does encourage outside contributions, the only ones with commit privileges are Google employees; Android Studio, as with the wider Android Open Source Project (AOSP), remains very much a Google project. Those wanting to contribute can find instructions on the "Contributing" page, and can submit bug reports at this link. A somewhat active discussion for those working with Android Studio and other official Google Android development tools can be found at a Google Groups forum. Extensive training documentation on how to use Android Studio can be found on an official web page that includes links to articles on how to learn to develop Android applications, as well as links to free online courses from the online educational company Udacity. Android Studio is licensed under the Apache 2.0 license.

There are some open-source competitors to Android Studio for writing Android applications. For example, PhoneGap is an open-source program, based on Node.js, that allows developers to write cross-platform mobile applications in HTML, CSS, and JavaScript. Ruboto enables Android app development in Ruby. However, these projects remain suboptimal for a large number of use cases; graphic-intensive apps written in PhoneGap, for instance, can feel slow and less responsive to user interaction than Android Studio apps, as the overhead of translating from JavaScript to Android code leads to inefficiencies. However, it can be easier to write simpler applications in languages like JavaScript or Ruby than Android Studio's Java, which may make third-party choices more attractive to some developers than Google's official offering.

Nonetheless, with major overall improvements in its speed of developing, building, and testing high-quality applications, Android Studio appears to be the standard for high-quality Android app development for the foreseeable future.

Comments (none posted)

Brief items

Quotes of the week

We would like more people to use Emacs, but we should never think that we _need_ more users. When developers of a free software package think they _need_ more users, it is a lever that can be used to push them into bad decisions.
— Richard Stallman

Prepare for Git on-disk repository representation to undergo backward incompatible changes by introducing a new repository format version "1", with an extension mechanism.
— Junio Hamano preparing for interesting Git changes

Comments (36 posted)

Collabora and ownCloud release CODE for LibreOffice Online developers

Collabora and ownCloud have announced a partnership, and, as an opening move, have released the "Collabora Online Development Edition." This is a combined distribution consisting of LibreOffice Online and ownCloud Server. "The purpose of CODE is to give interested developers from any field an easy way to get early access to the very latest untested feature additions and updates to LibreOffice Online, in order to enable them to develop, test, and contribute." See this page for more information and screenshots.

Full Story (comments: 5)

Firefox 43 released

Mozilla has released Firefox 43. This version features improvements to Private Browsing and Tracking Protection, search suggestions, improved API support for m4v video playback, and more. The release notes contain more information.

Comments (54 posted)

Newsletters and articles

Development newsletters from the last week

Comments (none posted)

Linux video editing in real time with Open Broadcast Studio (Opensource.com)

Over at Opensource.com, Seth Kenlon looks at realtime video editing with Open Broadcast Studio (OBS). The article describes OBS sources and scenes, compositing, filters, output options, and more. "It may be a relatively niche market, but not all video editing is done in post production. There are use cases for live, on-the-fly video editing and basic compositing. You've seen it done yourself, whether you realize it or not—news broadcasts, live webcasts, and live TV events usually use multiple-camera setups controlled by one central software suite. Open Broadcast Studio (formerly Open Broadcaster Software) is an open source central control room for live, realtime video editing. It features instant encoding using x264 (an open source h.264 encoder) and AAC and streams to services like YouTube, DailyMotion, Twitch, your own streaming server, or just to a file."

Comments (4 posted)

Page editor: Jake Edge

Announcements

Brief items

Mozilla Open Source Support: First Awards Made

Mozilla has announced the first round of projects to receive support from the organization's new “Foundational Technology” grant program. The program offers funding to open-source projects outside of Mozilla that are regarded as important building blocks for work done within Mozilla. The recipients announced are Buildbot, CodeMirror, Discourse, Read The Docs, Mercurial, Django, and Bro. The post contains further details on the specific development goals associated with each grant. More selections are yet to come, and applications are open.

Comments (53 posted)

Libreboot T400 laptop now FSF-certified to respect your freedom

The Free Software Foundation has awarded Respects Your Freedom (RYF) certification to the Libreboot T400 laptop as sold by Minifree. "The Libreboot T400 is a refurbished and updated laptop based on the Lenovo ThinkPad T400. Just as with the Libreboot X200, in order to achieve the Free Software Foundation's RYF certification guidelines, Minifree had to replace the low-level firmware as well as the operating system. Microsoft Windows was replaced with the FSF-endorsed Trisquel GNU/Linux operating system, which includes the GNOME 3 desktop environment. The free software boot system of Libreboot and the GNU GRUB 2 bootloader were adapted to replace the stock proprietary firmware, which included a BIOS and Intel's Management Engine firmware."

Full Story (comments: none)

Articles of interest

Qubes OS will ship pre-installed on Purism’s security-focused Librem 13 laptop (ars technica)

Ars technica reports that the Purism Librem 13 laptop will be available with the virtualization-based Qubes distribution. "Qubes wants to lower the barrier of entry for new users, including security-conscious enterprise users who might want to buy a number of laptops for their staff. In addition to the Librem 13, Qubes plans to certify the larger Librem 15, plus other laptops that are 'as diverse as possible in terms of geography, cost, and availability.'" LWN looked at Qubes 3.0 back in May.

Comments (1 posted)

Calls for Presentations

CFP Deadlines: December 17, 2015 to February 15, 2016

The following listing of CFP deadlines is taken from the LWN.net CFP Calendar.

DeadlineEvent Dates EventLocation
December 20 February 10
February 12
netdev 1.1 Seville, Spain
December 31 April 26
April 28
Open Source Data Center Conference Berlin, Germany
January 3 May 28
June 5
PyCon 2016 Portland, OR, USA
January 8 March 19
March 20
Chemnitzer Linux Tage 2016 Chemnitz, Germany
January 10 April 15
April 17
PyCon Italia Sette Firenze, Italia
January 11 March 23 Make Open Source Software 2016 Bucharest, Romania
January 15 March 14
March 17
Open Networking Summit Santa Clara, CA, USA
January 15 March 10
March 12
Studencki Festiwal Informatyczny (Students' Computer Science Festival) Cracow, Poland
January 16 April 1 DevOps Italia Bologna, Italy
January 18 March 18
March 20
FOSSASIA 2016 Singapore Singapore, Singapore
January 19 May 17
May 21
PGCon - PostgreSQL Conference for Users and Developers Ottawa, Canada
January 22 May 2
May 5
FOSS4G North America Raleigh, NC, USA
January 22 January 22
January 23
XenProject - Cloud Innovators Forum Pasadena, CA, USA
January 24 March 14
March 18
CeBIT 2016 Open Source Forum Hannover, Germany
January 24 March 11
March 13
PyCon SK 2016 Bratislava, Slovakia
January 29 April 20
April 21
Vault 2016 Raleigh, NC, USA
February 1 April 25
April 29
OpenStack Summit Austin, TX, USA
February 1 June 22
June 24
USENIX Annual Technical Conference Denver, CO, USA
February 1 April 4
April 8
OpenFabrics Alliance Workshop Monterey, CA, USA
February 2 March 29
March 31
Collaboration Summit Lake Tahoe, CA, USA
February 5 April 4
April 6
Embedded Linux Conference San Diego, CA, USA
February 5 April 4
April 6
OpenIoT Summit San Diego, CA, USA
February 6 February 12
February 14
Linux Vacation / Eastern Europe Winter Edition 2016 Minsk, Belarus
February 8 April 7
April 8
SRECon16 Santa Clara, CA, USA
February 10 April 23
April 24
LinuxFest Northwest Bellingham, WA, USA
February 12 May 9
May 13
ApacheCon North America Vancouver, Canada

If the CFP deadline for your event does not appear here, please tell us about it.

Upcoming Events

WAC 2016 - registration now open

Registration is open for the Web Audio Conference, which will take place April 4-6 in Atlanta, Georgia. "The keynote speakers for WAC 2016 are Helen Thorington and Frank Melchior. The conference will feature over 75 papers, posters, talks, demos, artworks, and musical performances, a plenary session with the W3C working group on the Web Audio API, a hack session, tutorials, and related activities."

Full Story (comments: none)

Events: December 17, 2015 to February 15, 2016

The following event listing is taken from the LWN.net Calendar.

Date(s)EventLocation
December 27
December 30
32. Chaos Communication Congress Hamburg, Germany
January 8 Fairphone Workshop Amsterdam, Netherlands
January 16 Bangalore Linux Kernel Meetup Bangalore, India
January 20
January 22
O'Reilly Design Conference 2016 San Francisco, CA, USA
January 21
January 22
Ubuntu Summit Pasadena, CA, USA
January 21
January 24
SCALE 14x - Southern California Linux Expo Pasadena, CA, USA
January 22
January 23
XenProject - Cloud Innovators Forum Pasadena, CA, USA
January 25 Richard Stallman - "A Free Digital Society" Stockholm, Sweden
January 30
January 31
Free and Open Source Developers Meeting Brussels, Belgium
February 1 MINIXCon 2016 Amsterdam, Netherlands
February 1 Sysadmin Miniconf Geelong, Australia
February 1
February 5
linux.conf.au Geelong, Australia
February 5
February 7
DevConf.cz 2016 Brno, Czech Republic
February 10 The Block Chain Conference San Francisco, CA, USA
February 10
February 12
netdev 1.1 Seville, Spain
February 12
February 14
Linux Vacation / Eastern Europe Winter Edition 2016 Minsk, Belarus

If your event does not appear here, please tell us about it.

Page editor: Rebecca Sobol


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds