|
|
Log in / Subscribe / Register

LWN.net Weekly Edition for February 19, 2015

Transparency, donations, and elementary OS

By Jake Edge
February 18, 2015

A very public spat between the founder of the elementary OS Linux distribution and one of the board members for Software in the Public Interest (SPI) in early February got kind of ugly. As with any dispute of this nature, there were various claims and counter-claims that make it difficult to determine all of what transpired. But, based on what can be discerned, there are some wider issues to consider.

The public part of the disagreement began when elementary OS founder Daniel Foré posted on Google+ about a telephone conversation he had with Joshua Drake, who is a member of SPI's board. Foré felt that he got a "really aggressive sales call" from Drake about having elementary OS join SPI. Foré suggested that Drake wanted the project to join so that SPI could get a cut of the money that the distribution brings in. As noted in an LWN review of the first elementary OS "Freya" beta back in August, the distribution strongly encourages $10 contributions for downloading. SPI does take a 5% cut of donations for member projects for its services.

Foré obviously did not like the perceived pressure to join SPI. He pointed out that the distribution already has a legal entity behind it, but that Drake was adamant that elementary OS needed to be associated with a non-profit. Foré went on to note that because he was not interested in joining, Drake planned a "blog about how poor your product is". He concluded by saying that what Drake was doing amounted to extortion.

For his part, Drake did post on his blog about elementary OS, though that post has since been taken down. It can still be found, however, but it doesn't come off quite the way Foré predicted. Drake does criticize the project for its web presentation, in particular he was concerned that site visitors get no indication of the for-profit structure of the limited liability corporation (LLC) behind elementary OS. While Drake was certainly critical of the project/company, it's hard to say to say that he went completely overboard.

But elementary OS press lead Cassidy James Blaede was not at all happy with Drake's post. He rebutted each of the main points Drake made, though, of course, it largely boils down to a difference of opinion. Elementary OS is not shy about asking downloaders for money, but there is not much information on the web site about the corporate structure or its for-profit nature. Essentially, that is most of what Drake was complaining about in his original post. In a replacement post that was clearly intended to tamp down the flames, Drake reiterated that more concisely.

As is often the case in these kinds of conflicts, though, the toothpaste is pretty hard to get back into the tube once it gets out. Drake's original blog post, coupled with Foré's and Blaede's Google+ postings (and the inevitable comment stream accompanying them), quickly spread to reddit and Phoronix. A post from Alberto Ruiz calling SPI "despicable" probably helped fan the flames.

But, at its heart, the dispute is about transparency. Drake may have made a ham-handed approach to Foré—at best he was misunderstood, at worst he was well out-of-bounds—and his withdrawn blog post was fairly confrontational, but what he was after was not completely unreasonable. The elementary OS web site is still not clear about where donations to the project go, or that it is a for-profit organization.

There is also the question of where the money that is donated actually goes. Blaede mentioned "servers, merch to resell, and occasionally conference/travel costs and development hardware" as expenses for the project. Elsewhere, the bounties offered at Bountysource have been noted as another project expense. All of that seems perfectly reasonable, but the project/company could be more open about how it spends its money, especially when it is more aggressive than most open-source projects in soliciting donations.

Just prior to Drake and Foré's telephone conversation—presumably part of what sparked it—elementary OS had gotten a lot of flak for its posting (since revised, original here) that downloaders who choose to not pay are "pretty much cheating the system". Those words were poorly chosen, though the project clearly does feel that users should pay for its work. The revised text now reads: "We want users to understand that paying for software is important and not paying for it is an active choice." That is, at least, a less antagonistic way to put it.

There are other revisions to that post, mostly toning down some of the rhetoric, but elementary OS does have a bit of a point. While the distribution is based on Ubuntu (which is based on Debian, of course) and builds atop all of the work those projects do, elementary OS does add value that some find useful and/or compelling from a design standpoint. Traditionally, open-source projects have been fairly passive about donations, but elementary OS appears to be bucking that tradition. So far, that has led to a lot of noise in various locations, but is it really so wrong for a project to try to get enough revenue to fund its activities?

Many of the criticisms about the distribution's funding stance are that it hasn't done "enough" to deserve the level of donations it is seeking. That may well be true, but there is nothing inherently wrong with trying. There are lots of projects that are struggling due to lack of funding, along with various efforts to find funding for them (including organizations like Snowdrift.coop that we covered back in December). One could argue that elementary OS is just trying a different approach. It remains to be seen whether it will be successful or not.

On the transparency side, elementary OS could certainly do more to make it clear that it is a for-profit entity. It is not obliged to share its finances—it is far from the only company in our community with closely held financial information—but doing so might help with donations. In the final analysis, it is a company trying to find its way in the (crowded) Linux distribution space; if it isn't doing "enough" to attract funding to keep it going, perhaps it will transform into something more like what its critics would like to see. Or it may die on the vine. But its code is free, which is pretty hard to criticize.

Comments (11 posted)

A look at LibreOffice 4.4

By Nathan Willis
February 18, 2015

Version 4.4 of the LibreOffice office suite was released in January. The 4.4 development cycle placed a significant emphasis on improving the user experience (UX) and polishing the user interface (UI), both of which are aspects of LibreOffice that have been the target of criticism in the past. Indeed, the new release does present a cleaner and more organized UI in many places—improvements that can make or break an office suite. But there are other noteworthy changes to be found in version 4.4, from improved interoperability with Microsoft Office to the results of a massive code-clean-up effort.

The latest release can be downloaded from the LibreOffice site. Linux builds are provided for 32-bit and 64-bit Intel systems, in RPM and Debian packages as well as in tar archives. There is a lengthy release notes page on the project's wiki that outlines the changes to each component (Writer, Calc, Impress, and so on).

Some of the most prominent new features, though, extend across all of LibreOffice's constituent parts—such as the UI enhancements. During Google Summer of Code (GSoC) 2014, two students worked on converting all of LibreOffice's dialog boxes to the latest GtkBuilder format, which is both smaller and easier to work with than the older Glade format. Similarly, the drop-down toolbars and sidebars have been reworked, and many (if not all) right-click context menus have been reorganized.

[Numbering menu in LibreOffice
4.4]

The tricky aspect of this sort of development work is that it can easily go unnoticed, because it is largely about removing awkwardness: fixed-sized dialog boxes, drop-down menus that require a lot of scrolling, context menus that contain unnecessary (and rarely used) items. But if one knows where to look for them, the improvements are there to see. Take the "Bullets" and "Numbers" toolbar menus in Writer, for example. Clicking on the new menu items displays a rather large preview of each available style, which makes the alternatives instantly easy to distinguish from one another—something that was not so clear in older releases. But quantifying whether this change makes writing a little easier or much easier is hard to do.

Similarly, it is easy to point out that Cut, Copy, and Paste are now in the same position in every right-click context menu, but the practical impact it has is difficult to measure. Suffice it to say, then, that LibreOffice 4.4 incorporates a wealth of such changes that, when taken together, make the office suite far less frustrating to work in.

Of particular note on the UX front, the sidebar in Writer now provides access to the Styles and Gallery functions, which were previously hidden in separate dialog boxes. Styles allows the user to apply a pre-defined formatting style to selected text (e.g., footnotes, quotations, or various headers); Gallery offers drag-and-drop access to images that the user can place into a document. Both of these are functions that a typical user may need to drop into repeatedly during an editing session, so not having to open up a new window that steals focus from the main document is a big improvement.

[Toolbars in LibreOffice
4.4]

The content of the toolbars has been significantly rearranged as well, with an eye toward making the most-common entries the easiest to reach. For those who read left-to-right languages, that means that the common entries are the furthest to the left, and the least likely to be hidden off screen. In retrospect, this seems like a rather obvious change to make, but in earlier versions of LibreOffice, the emphasis was evidently on grouping related toolbar items together. It is hard to be objective about which approach is universally better but, at the very least, not having important tools lost off-screen is certainly an improvement.

Users of a typographic bent will notice several improvements to the way fonts and special characters are treated. The character-selection widget (which is used to insert characters not found on the current locale's keyboard) has been simplified. There are also several interesting substitutions that are now automatically inserted by the spellchecker: typing (c) will insert the © sign; (tm) will insert ™, and so on. Version 4.4 also adds a new set of open-licensed fonts (Caladea and Carlito) designed to serve as drop-in replacements for Microsoft's Cambria and Calibri—which are, essentially, the modern equivalent of the so-called "core fonts" Times New Roman and Arial.

Among the many other application-specific improvements found in the 4.4 release, Writer now supports placing text into geometric shapes (and having the text confined to the outline of the shape) and the status bar at the bottom of the window now more clearly presents information about the current page. Calc's "Statistics Wizard," which automatically analyzes a set of cells, gained several new functions (like Quartiles and the Chi-square test). Draw finally gained a zoom tool, while Impress gained improved support for using OpenGL slide transitions. All applications can now export digitally signed PDFs; users must manually load their signing certificate into LibreOffice's certificate storage in order to take advantage of the feature.

There are quite a few additional file types now readable by LibreOffice 4.4. Much of the work involved in this area comes from the Document Liberation Project, a spin-off of LibreOffice that focuses on building file-format conversion libraries. Among the newly supported formats are Adobe PageMaker, MacDraw, RealAudio, Sony's LRF e-book format, Ogg Opus multimedia, and MPEG Audio.

Perhaps of more importance at a practical level, though, is that LibreOffice 4.4 updates its support of Microsoft's OOXML format to the latest revision. A sad fact of life is that the majority of LibreOffice users still need to exchange files with Microsoft Office users on a regular basis. LibreOffice may always lag somewhat behind Microsoft when it comes to OOXML file support (indeed, it is in Microsoft's interest to make competing office suites play catch-up), but there is no denying that it is a necessary feature.

The LibreOffice project reports that it undertook a major effort during the 4.4 development cycle to perform code reviews with the Coverity scanning service. The Coverity scans reportedly turned up more than 6,000 defects—all of which were fixed. That number included more than 1700 null pointer dereferences and 1100 uninitialized members. For a project of LibreOffice's size, it is impressive to see that much ground covered in such a relatively short time.

In some ways, LibreOffice 4.4 is not an exciting release: there is no banner-worthy new feature, but a great many small improvements instead. Then again, office suites might not ever need to trade on a reputation for excitement; steady progress and stability are more important. The UI and UX improvements offer a nicer visual design and an improved workflow, respectively; that might be enough to attract some more users to the project, but if their main impact is simply to make the editing experience smoother or more pleasing for existing users, that is a worthwhile end of its own.

Comments (7 posted)

Scalar typing in the PHP world

By Jonathan Corbet
February 13, 2015
When one thinks about the PHP language, terms like "strong typing" and "strict checking" do not normally come to mind. But, as the project works toward its next major release (to be called PHP 7), it has become embroiled in a fierce debate over the proposed addition of some simple typing features to the language. To some, PHP is growing up into a safer, better-defined language, while others see the changes as possibly destroying the character of a historically freewheeling language.

Some history

PHP has traditionally taken a loose approach to types, trying to make things "just work" in almost all circumstances. A simple session in the interpreter's interactive mode shows how accommodating it can be:

    $ php -a
    php > echo 1 + "1";
    2
    php > echo 1 + true;
    2
    php > echo 1 + "1with_extra_junk";
    2

This flexibility undoubtedly makes PHP fun for some programmers to use; there is little of the messing around required by some other languages to keep the interpreter happy. Among other things, it allows the creation of library functions that can take a wide variety of types as parameters and do something (maybe even the right thing) with them.

But others would like to see things tightened down a bit. It would be nice, they argue, if a PHP function could count on the types of the arguments passed to it. That would enable certain kinds of errors to be caught by the interpreter; it would also make it easier to write static analyzers for the language that could be used for both correctness checking and performance improvements. These developers have made their case well enough that there is little controversy about adding some type checking; the problem arises when one tries to determine how much checking makes sense.

The specific issue at hand has to do with the passing of simple, scalar parameter types to functions — types like integers, floating-point numbers, strings, and booleans. The first attempt to add type hints for these parameter types was posted by Anthony Ferrara in 2012. It changed the function-definition syntax to look like this:

    function f ((int) arg) {
	// "arg" is guaranteed to be int here
    }

This version implemented what has been termed "weak" typing, in that a non-integer argument passed to f() would be converted to the int type if possible. So floating-point numbers would be truncated, strings would be converted, etc. This proposal generated a lot of discussion that eventually bogged down; a year later, Anthony loudly bailed out of PHP development, strongly criticizing the environment found on the php-internals mailing list.

PHP voting

The discussion of a vote may be surprising to those who are not familiar with how the PHP community works. Perhaps uniquely among language-development communities, PHP decides issues of language design via a vote of the developers. Issues involving an actual change to the language are deliberately hard to pass; they require a ⅔ supermajority.

Two years later (July, 2014), Andrea Faulds restarted the conversation with a new scalar type-hinting proposal. It was still a weakly typed mechanism; this time the bulk of the discussion centered on whether conversion of bogus strings ("1with_extra_junk", say) to integers should succeed or not. Yes, there are core PHP developers who believe that integer conversions should silently "succeed" in the presence of random junk. The proposal returned in September, with a request for a vote that was withdrawn shortly thereafter; yet another version came out in December.

Weak or strong?

As the various versions of the proposal went by, the real point of contention became clear. Nobody seems to object to the idea of adding scalar type hints to function definitions; the real problem had to do with how strictly they would be enforced. The "strict typing" camp wants the interpreter to disallow all implicit type conversions; if f() is defined to require an integer argument, calls like f(1.0) or f("1") should generate an error. In this view of the world, if an API developer puts type declarations onto a function, that function must be called with parameters of exactly the specified type.

The arguments for strict checking are fairly straightforward. It can catch errors that weak (or no) type checking will miss — the sort of nasty error that never happens on a developer's test system but which certain types of users can provoke easily. Strict checking lets API developers design their code with the knowledge that it will be called with the correct types. It also expands the range of static analysis options available, again turning up errors but also, it is said, opening the door to new optimization techniques.

On the other side, opponents of strong typing feel that it would drastically change the nature of the language. PHP has always allowed a high level of freedom in the mixing of types. Changing that for PHP 7 would create a language that, in their view, is not PHP. Among these folks, many of whom are core developers of the language, adding strong typing would seemingly be like trying to get Python developers to add braces or Perl developers to restrict themselves to "one way to do it." Opponents also worry that strict typing may just lead developers to write lots of casts, effectively taking away the benefits that strict typing is supposed to provide.

An attempt at compromise

Andrea appears to have despaired of ever bridging the gap between these two factions; instead, she put together a new proposal that tried to please everybody, then called for a vote. In the call, she optimistically said "I don’t think there needs to be, or will be, much further discussion"; that is not how things turned out.

The new scalar typing mechanism is still weakly typed, but with a twist. A PHP developer can add a line like this to their code:

    declare(strict_types=1);

The effect of this line will be to turn on strict scalar type checking for the rest of the source file in which it is found. Library authors can add types to their function definitions; they can even turn on strict checking within the library with the above option. But it will be the author of the calling code who decides whether or not to add that line to their own code and turn on strict checking for their program.

In theory, this mechanism gives everybody what they want; developers who want to work in a strict-checking environment can have it, while those who want weak typing get it by default. In practice, this approach appears to have pleased almost nobody. Proponents of strong typing would rather see it enabled as a mandatory thing; they want callers of their functions to be required to pass the correct types. Opponents, instead, see it as a way of sneaking an alien concept into the language. PHP creator Rasmus Lerdorf also worries that it could end up breaking a lot of code and generally leading to surprising results.

To top it off, almost nobody seems to like the use of declare() which, among other things, can make it hard to tell which rules apply to a given segment of code. As Zeev Suraski put it:

If there's one thing that's worse than introducing an alien concept like strict typing into PHP, it's introducing it as a feature that will include all the negatives of this alien concept, PLUS have the ability to radically change how it behaves based on a runtime option.

Even the declare() option has proponents, though; Anthony returned to the fray to argue in its favor:

This is where the current proposal comes in. Many call it a compromise. Many call it a "worst-of-both-worlds". I call it the only way to do strict typing in PHP that won't utterly suck.

The genius of this proposal is that your code controls how you call other functions. So if you want your code to be strict, any function you call will be treated strictly. But if you don't want to be strict, then the functions you call will accept weakly.

The current vote is scheduled to end on February 19. As of this writing, the results suggest that proposal might just pass with something very close to the required supermajority. In theory, that should put this long-lived debate to rest; long experience suggests, though, that an issue this contentious will not be resolved quite so easily.

Comments (148 posted)

On moderation

By Jonathan Corbet
February 18, 2015
Back in the early days, there were no user-posted comments on LWN; that feature was added, after a great deal of thought, in 2002. This was not universally regarded as a good move, but, over time, comments have become an integral part of the LWN experience. Most of the time, the comment area is interesting, respectful, and polite. But there are always exceptions.

Those exceptions lead some people to ask for more "moderation" of the comment stream.

Those of us who work on LWN have put a great deal of ourselves into it for many years. LWN is, in many ways, a labor of love. When somebody posts a comment that is offensive, abusive, spammy, or just a troll, it feels like they have painted obscene graffiti onto our houses. But we remain highly reluctant to "moderate" (or "delete," or "censor") those comments for a number of reasons. At the top of the list is the simple fact that we believe that "freedom" means more than the ability to share software with each other. To silence a voice with editorial force feels like an attack on freedom; it is not something to be done lightly.

Let there be no mistake: we do not support those who post abusive, bigoted, or demeaning comments, and we feel that there is no place for them on LWN. Our desire and goal is to run a site where that kind of comment is simply not present. But chances are that we will continue to use the heavy hand of "moderation" toward that goal rather less frequently than some would like.

Trying to control the direction of a comment stream is a slippery slope in a number of ways. In a heavily controlled environment, it is hard to tell whether the opinions on offer reflect the community, or whether they simply reflect what the moderator thinks is OK to be said. We want LWN to reflect our community, not our view of what that community should be.

What are the objective criteria by which moderation would be performed? If we try to rid the stream of anything that might be offensive to anybody, we will have a bland discussion indeed. And why stop at limiting offense? Consider that the recent call for more moderation quickly led to a request to cut off a discussion that, while admittedly long and repetitive, was focused on an area of great concern to many developers. The desire to see moderation used in such a situation shows how slippery this slope can be.

Also relevant are the facts that moderation is simply expensive and a source of legal liability. Putting together an edition every week is a serious grind; we have nobody with spare time on their hands to patrol the comments. The only way to make that kind of time available would be to reduce the number of articles we write for the site. That would be a heavy cost, and it still doesn't address the fact that unpleasant personalities feel free to post outside of LWN's business hours.

It is not surprising that a number of publications have recently taken the step of eliminating comments altogether. That is not a step we would like to take, but we will if that appears to be necessary.

But such an extreme step should not be necessary. We as a community are better than that.

Experience shows that simple requests to tone down or close off a discussion are often successful. We may well be making more such requests in the future. But the success of LWN's comment areas depends mostly on the commenters; we do not have the time, energy, or desire to play "comment nanny" all the time. If we could all make an effort to recognize when a discussion has run its course, avoid repeating ourselves, and refrain from feeding trolls, things would work better for all of us.

At the same time, we can respond to overtly offensive comments by stating, politely, that they are not welcome in our community. That, in your editor's opinion, is more likely to lead to a more respectful community in the long run than trying to moderate our way into a world where such people just do not seem to exist.

As a last resort, we may implement the ability to close down specific threads if the need arises — but we will endeavor to almost never use it. We already have the ability to block comments from specific accounts; we almost never use that either. The use of such tools is indicative of a failure at a higher level; it is a sad day when they must be put into action.

This is not the position that some people would like us to take, but it is what we feel that we are able, morally and economically, to do. And please bear in mind that comments here have gotten somewhat better over the years, even if they are still not where we would like them to be. Those with strong stomachs can look at some previous discussions for evidence of that. "Things used to be worse" is no justification for an unacceptable state of affairs now, but it does show that progress can be made. We are a community of adults, and we are certainly capable of behaving that way.

Comments (66 posted)

Page editor: Jonathan Corbet

Security

Mandatory Firefox extension signing

By Nathan Willis
February 18, 2015

Mozilla recently announced a plan to roll out a cryptographic signature framework for Firefox extensions in the coming months. The system is designed to clamp down on so-called "gray area" extensions that, while far from falling under the traditional definition of malware, make dubious and shady changes to the way a user's browser functions. The change will mark a significant shift for Mozilla, which, in the past, has taken a wide-open approach to extension development and installation. But the new system will be mandatory: after a transition period, Firefox will not run extensions that have not been signed by Mozilla, and all extension developers will need to submit their extensions for a test that checks for bad behavior. Naturally, not all extension developers are happy about how that will affect their workflow, but Mozilla insists it is the option that best balances protecting users and encouraging extension development.

The announcement was posted by Mozilla's Add-ons Developer Relations Lead, Jorge Villalobos. He listed several types of malicious behavior commonly found in the gray-area extensions: altering the user's homepage, changing the browser search behavior, injecting ads into pages, and injecting scripts into social media sites. The extensions in question typically make these changes in secret, often under the guise of doing something else. Many present themselves as toolbars of one form or another; others get side-loaded, surreptitiously, when the user runs an installer or updater for some unrelated piece of desktop software.

In the past, Mozilla attempted to curtail such extensions by publishing a set of public guidelines for acceptable add-on behavior, and blocking extensions that violate the rules. That strategy may have scaled as far as it can, though—the blocklist is quite long, and developers have taken to new strategies to evade it, such as randomly generating a different extension ID for every copy.

The plan

Preventing bad behavior in extensions is more difficult in Firefox than in other browsers like Chrome or Apple's Safari, Villalobos said, for two reasons: first, Mozilla intentionally allows its add-ons to alter more browser functionality than the competing browsers do, and second, because Mozilla does not act as the central distribution point for add-ons. Anyone can publish and distribute a Firefox extension from any site.

Finding a way to curb gray-area extensions without acting as the final gatekeeper for extension publication was the issue. As Villalobos explained, the plan that emerged after many months of discussion was to run all extensions through an automated test that checked for the blocked, gray-area behaviors, then to sign those extensions that pass using a key that only Mozilla holds. Firefox has long supported signed extensions, but the feature has rarely been used by developers. Mozilla will add a compile-time switch that makes Firefox to check for the Mozilla signature on every extension. Extensions that do not pass the signature check will be deactivated. Future Firefox releases will then be built with the signature-checking switch enabled.

That part of the plan is relatively straightforward; where things get more complicated is how the extension-signing process will be implemented. First, there will be new steps required for developers whose extensions are not hosted at Mozilla's official add-on site, addons.mozilla.org (AMO). Since AMO-hosted extensions are already required to pass a review step, the good-behavior test and signature will simply be rolled into that same process. But developers who provide extensions on their own site will have to create an AMO account and submit each build for the test-and-signature process.

The extension IDs used by each account will be logged, so that Mozilla can note suspicious behavior (like submitting a different user's extension ID, or submitting thousands of IDs). These third-party developers' AMO accounts and extensions will never be visible to the public, though, and they can continue to distribute their code at their own sites. Villalobos also mentioned that there will be yet a third process for use by developers who create extensions designed only to be used on an internal (e.g., enterprise) network—but the nature of that internal-extension-development process has yet to be announced.

The second issue is that not all well-behaved extensions will pass an automated test. But the precise nature of the automated test has not yet been made public. Villalobos said that any extension that fails can be submitted for a manual review, which Mozilla hopes will take at most a couple of days. Furthermore, he expressed Mozilla's willingness to work with known extension developers who have special needs on a case-by-case basis. The vast majority of extensions are expected to pass the automated test, since very few of them have any reason to use the functionality exploited by the problematic gray-area extensions.

Finally, although the plan hinges on not providing a run-time switch to disable signature checking (because any run-time preference or switch could be exploited by a malicious extension or installer), Mozilla will release the Developer Edition and Nightly builds of Firefox with signature-checking turned off, so that developers can test their code without waiting on signatures. Mozilla will also provide special "unbranded" Firefox builds with signature-checking disabled, via a separate download site. The unbranded builds are something of a last resort: extension developers can point users toward those builds if they cannot or will not get their extensions signed.

The signature-checking system will be rolled out in a transitional state for two full Firefox release cycles (i.e., 12 weeks), perhaps beginning as soon as Firefox 39 (currently scheduled for late June). During the transition phase, extensions that fail the signature check will prompt a warning, but will continue to run. As of now, no other add-on types (such as themes, dictionaries, plug-ins, or search engines) will be signature-checked, and there are no plans to roll out signature checking for Thunderbird or for Seamonkey (although either of those projects could independently decide to deploy the same scheme).

Feedback

As might be expected, the announcement drew plenty of vitriolic criticism; quite a few commenters on the blog post accused Mozilla of "Apple-like" or "Google-like" behavior by exerting central control over extension distribution, for example. Others likened the plan to censorship, arguing (for instance) that once the process was in place, the US government or the entertainment industry would begin pressuring Mozilla not to sign extensions they disliked. The debate was also carried over to the mozilla.addons.user-experience discussion group, where the deliberations certainly had their own share of name-calling—although participants in that forum focused primarily on how the new system would impact the process of developing extensions.

In both discussions, however, some common questions recurred. Several asked why the signature-checking scheme relied only on a signing key from Mozilla—as opposed to, say, per-developer keys, or reusing some existing trust mechanism. Villalobos replied that per-developer keys are too easily compromised by malicious developers. Similarly, Adam Novak argued that trying to implement similar safeguards through the SSL Certificate Authority (CA) system would also be easily undermined by malware developers.

Since Mozilla is intent on being the only entity that can sign an extension as passing the good-behavior test, others complained about the fact that there will be no run-time mechanism to disable signature checking. At his blog, Jeff Lyon called the plan a violation of the core principles in the Mozilla manifesto and of the spirit of free software. Subsequently, he posted his own alternative proposal to the discussion forum, in which users would be able to switch off signature-checking by visiting a Mozilla-hosted site that would generate a cryptographic token (signed by Mozilla) for each user. The token, he said, would ensure that the user had expressed their consent to switch off signature-checking, and it could be hidden behind a CAPTCHA-like "human test" to prevent abuse by malware authors.

But Lyon's suggestion, like the other run-time switch proposals, was rejected. Essentially, the Mozilla team argued, there is no run-time mechanism that cannot be exploited: CAPTCHAs are easily broken, web page interaction can be scripted and run without the user's knowledge, and settings can be altered. Mike Connor replied that there is no way to allow unsigned non-malware extensions to run that would not be exploited. "It's unlocking a door to let in a friend, then leaving it unlocked forever." In addition, he said, the goal is to dramatically reduce the amount of gray-area malware in the wild, as a "herd immunity" goal.

Forward progress

Ultimately, most of the extension developers' concerns boil down to the fact that they like to push out test builds for their extension's users—sometimes even making a special build to be sent directly to a single bug reporter. Villalobos and the other Mozilla employees continued to insist that the automated extension test would not introduce a significant slow-down to that process. But it seems like many extension developers find that hard to believe.

Perhaps it would be easier to make that case if there were more details available. After all, it is easy for skeptics to imagine that the extension-checking process will be slow and work poorly when there is no evidence to the contrary. That puts Mozilla in an unenviable position, to be sure.

Similarly, there is a lot of confusion about some parts of the plan that have yet to be rolled out—such as the "unbranded" Firefox builds that will have signature-checking disabled. As Villalobos described it, users will have to seek out the unbranded Firefox builds and install them intentionally (perhaps through the Mozilla Developer Network, rather than the usual download site). Once installed, the lack of "Firefox" branding should make it obvious that a different browser is in use, so it will be hard for a malware author to trick a user into installing the vulnerable build. But that, too, is a mechanism that it is all too easy to imagine not working as expected. Mozilla will still have to show it functioning in the wild to win over some developers.

It is also unclear how the signature scheme will affect Linux distributions. Some might be interested in making Firefox builds available that have the signature-checking code compiled out. Whether or not that change would be enough to trigger a trademark dispute of the sort that led Debian to rebrand its Firefox builds as "Iceweasel" has not been explored.

In the meantime, Connor reminded those in the thread that the real goal was to improve users' security:

There's no easy answer here that doesn't weaken the user security model or introduce overhead for developers, which is unfortunate. We're trying to minimize that pain for developers, but ultimately we have to do what's best for users, even if it adds some overhead for developers.

Villalobos, too, pointed out that the problem Mozilla is attempting to solve is that the status quo offers essentially no mechanism to block bad actors:

It's true that we can't create a completely effective solution for this, but we don't need to. One of the important changes this brings in is a level of accountability that we don't have now. There are many add-on IDs in the wild that we have no idea what they are. There's plenty of evidence of randomized add-on IDs (different ID per install), and malware using add-on IDs of known add-ons. With this system we will at least be able to track the origin of a malicious ID and deal with it and all IDs created with that cert. This will also significantly increase the difficulty of creating and distributing new add-on IDs, and allow developers to really own their IDs to prevent abuse.

Connor also took issue with the suggestion that the plan violates free-software principles, noting that anyone who objects to it can still install one of the Nightly or Developer Edition builds—or even recompile Firefox themselves.

Tyler Downer estimated that the number of gray-area Firefox extensions in the wild was in the millions. That is surely a problem that needs to be addressed. How onerous extension developers and users ultimately find the new signature-checking scheme remains to be seen. It may make a significant dent in this long-standing problem—although it will surely not be the end of the Firefox malware story.

Comments (23 posted)

Brief items

Security quotes of the week

It's rather peculiar how people's mindset has changed from the time when "feeding an invalid file leads to a crash" was just considered garbage-in, garbage-out — to the present time, when a crasher on invalid data is "OMG a government agency surely is going to write malicious vector images to pwn you every way it can".
Federico Mena-Quintero

Roses are red, violets are blue, #NSA loves privacy rights and you.
— The US National Security Agency (NSA) on Valentine's Day — evidently without irony

UEFI Secure Boot as a specification is still unbroken, which makes attacking the underlying firmware much more attractive. We've seen several presentations at security conferences lately that have demonstrated vulnerabilities that permit modification of the firmware itself. Once you can insert arbitrary code in the firmware, Secure Boot doesn't do a great deal to protect you - the firmware could be modified to boot unsigned code, or even to modify your signed bootloader such that it backdoors the kernel on the fly.

But that's not all. Someone with physical access to your system could reflash your system. Even if you're paranoid enough that you X-ray your machine after every border crossing and verify that no additional components have been inserted, modified firmware could still be grabbing your disk encryption passphrase and stashing it somewhere for later examination.

Matthew Garrett

For if the EU [European Union] can do this (and keep in mind we're likely on the cusp of vast new demands for Internet censorship from politically pandering European and other leaders promising to control the Net to ostensibly "stop terrorists") -- then what's to stop Putin, or Kim Jong-un, or the leaders who imprison citizens for decades for the "crime" of blasphemy or speaking negatively about their leaders -- from making exactly the same kinds of demands for global censorship? There is no "gentle" path in this realm. All routes leading from the EU RTBF [right to be forgotten] lead to kicking free speech off the cliff, to the delight and enrichment of the leaders who view information control as their permanent meal ticket to political control.
Lauren Weinstein

Comments (36 posted)

deb.haskell.org compromised

The Haskell.org site is currently reporting that its Debian package repository, deb.haskell.org, has been compromised. "`deb.haskell.org` was already offline and suspended shortly after these traffic changes were detected by the host monitoring system, meaning the window for package compromise was very very small. We're continuing to investigate the breach and the extent to which it might have spread."

Comments (27 posted)

FreeBSD random number generator broken for last 4 months

As several LWN readers have pointed out, John-Mark Gurney posted a message to the freebsd-current mailing list on February 17 noting that the random number generator (RNG) in the FreeBSD "current" kernel has been broken for the last four months. "If you are running a current kernel r273872 or later, please upgrade your kernel to r278907 or later immediately and regenerate keys. I discovered an issue where the new framework code was not calling randomdev_init_reader, which means that read_random(9) was not returning good random data. read_random(9) is used by arc4random(9) which is the primary method that arc4random(3) is seeded from. This means most/all keys generated may be predictable and must be regenerated. This includes, but not limited to, ssh keys and keys generated by openssl. This is purely a kernel issue, and a simple kernel upgrade w/ the patch is sufficient to fix the issue."

Comments (28 posted)

New vulnerabilities

chromium: multiple vulnerabilities

Package(s):chromium CVE #(s):CVE-2014-9646 CVE-2014-9647 CVE-2014-9648 CVE-2015-1359 CVE-2015-1360 CVE-2015-1361
Created:February 18, 2015 Updated:February 18, 2015
Description: From the CVE entries:

Unquoted Windows search path vulnerability in the GoogleChromeDistribution::DoPostUninstallOperations function in installer/util/google_chrome_distribution.cc in the uninstall-survey feature in Google Chrome before 40.0.2214.91 allows local users to gain privileges via a Trojan horse program in the %SYSTEMDRIVE% directory, as demonstrated by program.exe, a different vulnerability than CVE-2015-1205. (CVE-2014-9646)

Use-after-free vulnerability in PDFium, as used in Google Chrome before 40.0.2214.91, allows remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted PDF document, related to fpdfsdk/src/fpdfview.cpp and fpdfsdk/src/fsdk_mgr.cpp, a different vulnerability than CVE-2015-1205. (CVE-2014-9647)

components/navigation_interception/intercept_navigation_resource_throttle.cc in Google Chrome before 40.0.2214.91 on Android does not properly restrict use of intent: URLs to open an application after navigation to a web site, which allows remote attackers to cause a denial of service (loss of browser access to that site) via crafted JavaScript code, as demonstrated by pandora.com and the Pandora application, a different vulnerability than CVE-2015-1205. (CVE-2014-9648)

Multiple off-by-one errors in fpdfapi/fpdf_font/font_int.h in PDFium, as used in Google Chrome before 40.0.2214.91, allow remote attackers to cause a denial of service (buffer overflow) or possibly have unspecified other impact via a crafted PDF document, related to an "intra-object-overflow" issue, a different vulnerability than CVE-2015-1205. (CVE-2015-1359)

Skia, as used in Google Chrome before 40.0.2214.91, allows remote attackers to cause a denial of service (buffer over-read) or possibly have unspecified other impact via crafted data that is improperly handled during text drawing, related to gpu/GrBitmapTextContext.cpp and gpu/GrDistanceFieldTextContext.cpp, a different vulnerability than CVE-2015-1205. (CVE-2015-1360)

platform/image-decoders/ImageFrame.h in Blink, as used in Google Chrome before 40.0.2214.91, does not initialize a variable that is used in calls to the Skia SkBitmap::setAlphaType function, which might allow remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted HTML document, a different vulnerability than CVE-2015-1205. (CVE-2015-1361)

Alerts:
Gentoo 201502-13 chromium 2015-02-17

Comments (none posted)

clamav: multiple vulnerabilities

Package(s):clamav CVE #(s):CVE-2015-1461 CVE-2015-1462 CVE-2015-1463
Created:February 13, 2015 Updated:February 18, 2015
Description:

From the CVE entries:

CVE-2015-1461: ClamAV before 0.98.6 allows remote attackers to have unspecified impact via a crafted (1) Yoda's crypter or (2) mew packer file, related to a "heap out of bounds condition."

CVE-2015-1462: ClamAV before 0.98.6 allows remote attackers to have unspecified impact via a crafted upx packer file, related to a "heap out of bounds condition."

CVE-2015-1463: ClamAV before 0.98.6 allows remote attackers to cause a denial of service (crash) via a crafted petite packer file, related to an "incorrect compiler optimization."

Alerts:
Gentoo 201512-08 clamav 2015-12-30
Debian-LTS DLA-233-1 clamav 2015-05-28
SUSE SUSE-SU-2015:0298-1 clamav 2015-02-17
openSUSE openSUSE-SU-2015:0285-1 clamav 2015-02-13

Comments (none posted)

cpio: directory traversal

Package(s):cpio CVE #(s):CVE-2015-1197
Created:February 16, 2015 Updated:March 29, 2015
Description: From the Gentoo advisory:

A directory traversal vulnerability has been found in GNU cpio

A remote attacker may be able to entice a user to open a specially crafted archive using GNU cpio, possibly resulting in execution of arbitrary code, a Denial of Service condition, or overwriting arbitrary files.

Alerts:
Ubuntu USN-2906-1 cpio 2016-02-22
Arch Linux ASA-201503-22 cpio 2015-03-23
Mandriva MDVSA-2015:066 cpio 2015-03-27
Mandriva MDVSA-2015:065 cpio 2015-03-27
Mageia MGASA-2015-0080 cpio 2015-02-19
Gentoo 201502-11 cpio 2015-02-15

Comments (none posted)

cups: buffer overflow

Package(s):cups CVE #(s):CVE-2014-9679
Created:February 16, 2015 Updated:July 18, 2016
Description: From the Mageia advisory:

A malformed file with an invalid page header and compressed raster data can trigger a buffer overflow in cupsRasterReadPixels.

Alerts:
Gentoo 201607-06 cups 2016-07-16
Oracle ELSA-2015-1123 cups 2015-06-17
Scientific Linux SLSA-2015:1123-1 cups 2015-06-17
Oracle ELSA-2015-1123 cups 2015-06-17
CentOS CESA-2015:1123 cups 2015-06-18
Mandriva MDVSA-2015:108 cups 2015-03-29
CentOS CESA-2015:1123 cups 2015-06-18
Red Hat RHSA-2015:1123-01 cups 2015-06-17
Ubuntu USN-2520-1 cups 2015-02-26
openSUSE openSUSE-SU-2015:0381-1 cups 2015-02-26
Debian DSA-3172-1 cups 2015-02-25
Fedora FEDORA-2015-2127 cups 2015-02-21
Debian-LTS DLA-159-1 cups 2015-02-27
Fedora FEDORA-2015-2152 cups 2015-02-20
Mageia MGASA-2015-0067 cups 2015-02-15
Mandriva MDVSA-2015:049 cups 2015-03-02

Comments (none posted)

dbus: denial of service

Package(s):dbus CVE #(s):CVE-2015-0245
Created:February 12, 2015 Updated:January 11, 2017
Description: From the Debian advisory:

Simon McVittie discovered a local denial of service flaw in dbus, an asynchronous inter-process communication system. On systems with systemd-style service activation, dbus-daemon does not prevent forged ActivationFailure messages from non-root processes. A malicious local user could use this flaw to trick dbus-daemon into thinking that systemd failed to activate a system service, resulting in an error reply back to the requester.

Alerts:
openSUSE openSUSE-SU-2016:2736-1 dbus-1 2016-11-05
Ubuntu USN-3116-1 dbus 2016-11-01
Gentoo 201701-20 dbus 2017-01-11
Mandriva MDVSA-2015:176 dbus 2015-03-30
Gentoo 201503-02 dbus 2015-03-07
Fedora FEDORA-2015-2060 dbus 2015-02-19
Mageia MGASA-2015-0071 dbus 2015-02-17
openSUSE openSUSE-SU-2015:0300-1 dbus-1, 2015-02-17
Fedora FEDORA-2015-2007 dbus 2015-02-16
Debian DSA-3161-1 dbus 2015-02-11

Comments (none posted)

file: memory leak

Package(s):file CVE #(s):CVE-2014-9653
Created:February 18, 2015 Updated:April 20, 2015
Description: From the Red Hat bugzilla:

It was reported that a malformed elf file can cause file urility to access invalid memory.

Alerts:
Gentoo 201701-42 file 2017-01-17
Scientific Linux SLSA-2016:0760-1 file 2016-06-08
Oracle ELSA-2016-0760 file 2016-05-13
Red Hat RHSA-2016:0760-01 file 2016-05-10
Scientific Linux SLSA-2015:2155-7 file 2015-12-21
Oracle ELSA-2015-2155 file 2015-11-23
Red Hat RHSA-2015:2155-07 file 2015-11-19
Debian-LTS DLA-204-1 file 2015-04-19
Debian DSA-3196-1 file 2015-03-18
Fedora FEDORA-2015-2020 file 2015-02-18

Comments (none posted)

glibc: two vulnerabilities

Package(s):glibc CVE #(s):CVE-2015-1472 CVE-2015-1473
Created:February 18, 2015 Updated:February 18, 2015
Description: From the Mageia advisory:

Under certain conditions wscanf can allocate too little memory for the to-be-scanned arguments and overflow the allocated buffer (CVE-2015-1472).

The incorrect use of "__libc_use_alloca (newsize)" caused a different (and weaker) policy to be enforced which could allow a denial of service attack (CVE-2015-1473).

Alerts:
Gentoo 201602-02 glibc 2016-02-17
Scientific Linux SLSA-2015:2199-7 glibc 2015-12-21
Red Hat RHSA-2015:2589-01 glibc 2015-12-09
Oracle ELSA-2015-2199 glibc 2015-11-25
Red Hat RHSA-2015:2199-07 glibc 2015-11-19
Mandriva MDVSA-2015:168 glibc 2015-03-30
openSUSE openSUSE-SU-2015:0351-1 glibc 2015-02-23
Debian DSA-3169-1 eglibc 2015-02-23
Debian-LTS DLA-165-1 eglibc 2015-03-06
Mageia MGASA-2015-0072 glibc 2015-02-17
Fedora FEDORA-2015-2837 glibc 2015-03-04
Ubuntu USN-2519-1 eglibc, glibc 2015-02-26

Comments (none posted)

jython: code execution

Package(s):jython CVE #(s):CVE-2013-2027
Created:February 12, 2015 Updated:March 30, 2015
Description: From the SUSE bugzilla entry:

There are [several] problems with the way Jython creates class cache files, potentially leading to arbitrary code execution or information disclosure.

# (umask 000; jython -c 'import xmllib')
# ls -l '/usr/share/jython/Lib/xmllib$py.class'
-rw-rw-rw-. 1 root root 52874 Apr  3 17:24 /usr/share/jython/Lib/xmllib$py.class
Jython does not explicitly set permissions of the class files; therefore with weak umask it creates world-writable files, or discloses sensitive data that would be in a non-world-readable package file.

Also, the package writes to /usr/share, which it shouldn't; /var/cache would be more appropriate, but would still lead to a possibility of a content disclosure.

The only really portable and secure way to cache class files would be a directory in user's home with 0700 permissions.

Alerts:
Mandriva MDVSA-2015:158 jython 2015-03-29
Mageia MGASA-2015-0096 jython 2015-03-06
openSUSE openSUSE-SU-2015:0269-1 jython 2015-02-12

Comments (none posted)

kernel: multiple vulnerabilities

Package(s):kernel CVE #(s):CVE-2013-7421 CVE-2014-9644 CVE-2015-1421
Created:February 18, 2015 Updated:May 27, 2015
Description: From the Mageia advisory:

Linux Kernel 2.6.38 through 3.18 are affected by a flaw in the Crypto API that allows any local user to load any installed kernel module on systems where CONFIG_CRYPTO_USER_API=y by abusing the request_module() call (CVE-2013-7421, CVE-2014-9644).

When hitting an sctp INIT collision case during the 4WHS with AUTH enabled, it can create a local denial of service by triggerinf a panic on server side (CVE-2015-1421).

Alerts:
openSUSE openSUSE-SU-2016:0301-1 kernel 2016-02-01
Oracle ELSA-2016-3503 kernel 2.6.32 2016-01-09
Oracle ELSA-2016-3503 kernel 2.6.32 2016-01-09
Oracle ELSA-2016-3502 kernel 2.6.39 2016-01-09
Oracle ELSA-2016-3502 kernel 2.6.39 2016-01-09
Scientific Linux SLSA-2015:2152-2 kernel 2015-12-21
Oracle ELSA-2015-2152 kernel 2015-11-25
Red Hat RHSA-2015:2411-01 kernel-rt 2015-11-19
Red Hat RHSA-2015:2152-02 kernel 2015-11-19
SUSE SUSE-SU-2015:1376-1 kernel-rt 2015-08-12
Oracle ELSA-2015-3064 kernel 3.8.13 2015-07-31
Oracle ELSA-2015-3064 kernel 3.8.13 2015-07-31
SUSE SUSE-SU-2015:1478-1 kernel 2015-09-02
Red Hat RHSA-2015:1082-01 kernel 2015-06-09
Oracle ELSA-2015-3036 kernel 2015-05-13
Oracle ELSA-2015-3036 kernel 2015-05-13
SUSE SUSE-SU-2015:0832-1 kernel 2015-05-07
Scientific Linux SLSA-2015:0864-1 kernel 2015-04-21
Oracle ELSA-2015-0864 kernel 2015-04-21
CentOS CESA-2015:0864 kernel 2015-04-22
Red Hat RHSA-2015:0864-01 kernel 2015-04-21
openSUSE openSUSE-SU-2015:0713-1 kernel 2015-04-13
Ubuntu USN-2562-1 linux-lts-trusty 2015-04-08
Ubuntu USN-2563-1 kernel 2015-04-08
Red Hat RHSA-2015:0782-01 kernel 2015-04-07
CentOS CESA-2015:0726 kernel 2015-04-01
Red Hat RHSA-2015:0751-01 kernel-rt 2015-03-30
Scientific Linux SLSA-2015:0726-1 kernel 2015-03-26
Oracle ELSA-2015-0726 kernel 2015-03-26
Red Hat RHSA-2015:1030-01 kernel 2015-05-27
Red Hat RHSA-2015:0727-01 kernel-rt 2015-03-26
Red Hat RHSA-2015:0726-01 kernel 2015-03-26
Ubuntu USN-2542-1 linux-ti-omap4 2015-03-24
Ubuntu USN-2545-1 linux-lts-utopic 2015-03-24
Ubuntu USN-2543-1 linux-lts-trusty 2015-03-24
Ubuntu USN-2541-1 kernel 2015-03-24
Ubuntu USN-2544-1 kernel 2015-03-24
Ubuntu USN-2546-1 kernel 2015-03-24
Oracle ELSA-2015-3012 kernel 2015-03-19
Oracle ELSA-2015-3012 kernel 2015-03-19
Mandriva MDVSA-2015:058 kernel 2015-03-13
Fedora FEDORA-2015-3011 kernel 2015-03-09
Ubuntu USN-2514-1 linux-ti-omap4 2015-02-26
Ubuntu USN-2513-1 kernel 2015-02-26
Debian DSA-3160-1 kernel 2015-02-23
Fedora FEDORA-2015-3594 kernel 2015-03-14
Mageia MGASA-2015-0078 kernel-vserver 2015-02-19
Mageia MGASA-2015-0076 kernel-tmb 2015-02-19
Mageia MGASA-2015-0077 kernel-rt 2015-02-19
Mageia MGASA-2015-0075 kernel-linus 2015-02-19
Debian-LTS DLA-155-1 linux-2.6 2015-02-18
Mageia MGASA-2015-0070 kernel 2015-02-17
Mandriva MDVSA-2015:057 kernel 2015-03-10

Comments (none posted)

mdadm: command injection

Package(s):mdadm CVE #(s):CVE-2014-5220
Created:February 18, 2015 Updated:February 18, 2015
Description: From the openSUSE advisory:

mdcheck doesn't validate the input of mdadm --detail --export, possible command injection

Alerts:
openSUSE openSUSE-SU-2015:0308-1 mdadm 2015-02-18

Comments (none posted)

moodle: cross-site scripting

Package(s):moodle CVE #(s):CVE-2015-0216
Created:February 16, 2015 Updated:February 18, 2015
Description: From the Red Hat bugzilla:

MSA-15-0006: Capability to grade Lesson module is missing XSS bitmask

Description: Users with capability to grade in Lesson module were not reported as users with XSS risk but their feedback was displayed without cleaning

Issue summary: mod/lesson:grade capability missing RISK_XSS but essay feedback is displayed with noclean=true

Severity/Risk: Minor
Versions affected: 2.8 to 2.8.1
Versions fixed: 2.8.2
Reported by: Damyon Wiese
Issue no.: MDL-48034

Alerts:
Fedora FEDORA-2015-1751 moodle 2015-02-15

Comments (none posted)

oracle-jre-bin: multiple unspecified vulnerabilities

Package(s):oracle-jre-bin CVE #(s):CVE-2014-0463 CVE-2014-0464 CVE-2014-2410 CVE-2014-4247 CVE-2014-6466 CVE-2014-6485
Created:February 16, 2015 Updated:February 18, 2015
Description: From the CVE entries

Unspecified vulnerability in Oracle Java SE 8 allows remote attackers to affect confidentiality via unknown vectors related to Scripting, a different vulnerability than CVE-2014-0464. (CVE-2014-0463)

Unspecified vulnerability in Oracle Java SE 8 allows remote attackers to affect confidentiality via unknown vectors related to Scripting, a different vulnerability than CVE-2014-0463. (CVE-2014-0464)

Unspecified vulnerability in Oracle Java SE 8 allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors related to JavaFX. (CVE-2014-2410)

Unspecified vulnerability in Oracle Java SE 8u5 allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors related to JavaFX. (CVE-2014-4247)

Unspecified vulnerability in Oracle Java SE 6u81, 7u67, and 8u20, when running on Internet Explorer, allows local users to affect confidentiality, integrity, and availability via unknown vectors related to Deployment. (CVE-2014-6466)

Unspecified vulnerability in Oracle Java SE 8u20 and JavaFX 2.2.65 allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors. (CVE-2014-6485)

Alerts:
Gentoo 201502-12 oracle-jre-bin 2015-02-15
SUSE SUSE-SU-2015:0392-1 java-1_6_0-ibm 2015-02-27

Comments (none posted)

perl-Gtk2: code execution

Package(s):perl-Gtk2 CVE #(s):
Created:February 12, 2015 Updated:March 2, 2015
Description: From the Mageia advisory:

Incorrect memory management in Gtk2::Gdk::Display::list_devices in perl-Gtk2 before 1.2495, where, the code was freeing memory that gtk+ still holds onto and might access later.

Alerts:
Debian DSA-3173-1 libgtk2-perl 2015-02-25
Fedora FEDORA-2015-1762 perl-Gtk2 2015-02-15
Fedora FEDORA-2015-1733 perl-Gtk2 2015-02-15
Mandriva MDVSA-2015:044 perl-Gtk2 2015-02-12
Mageia MGASA-2015-0059 perl-Gtk2 2015-02-11
Debian-LTS DLA-161-1 libgtk2-perl 2015-02-28

Comments (none posted)

php5: multiple vulnerabilities

Package(s):php5 CVE #(s):CVE-2014-9652 CVE-2015-1351 CVE-2015-1352
Created:February 18, 2015 Updated:April 27, 2015
Description: From the Ubuntu advisory:

It was discovered that PHP incorrectly handled certain pascal strings in the fileinfo extension. A remote attacker could possibly use this issue to cause PHP to crash, resulting in a denial of service. This issue only affected Ubuntu 14.04 LTS and Ubuntu 14.10. (CVE-2014-9652)

It was discovered that the PHP opcache component incorrectly handled memory. A remote attacker could possibly use this issue to cause PHP to crash, resulting in a denial of service, or possibly execute arbitrary code. This issue only affected Ubuntu 14.04 LTS and Ubuntu 14.10. (CVE-2015-1351)

It was discovered that the PHP PostgreSQL database extension incorrectly handled certain pointers. A remote attacker could possibly use this issue to cause PHP to crash, resulting in a denial of service, or possibly execute arbitrary code. This issue only affected Ubuntu 14.04 LTS and Ubuntu 14.10. (CVE-2015-1352)

Alerts:
Gentoo 201701-42 file 2017-01-17
SUSE SUSE-SU-2016:1638-1 php53 2016-06-21
Gentoo 201606-10 php 2016-06-19
Scientific Linux SLSA-2015:2155-7 file 2015-12-21
Oracle ELSA-2015-2155 file 2015-11-23
Red Hat RHSA-2015:2155-07 file 2015-11-19
Scientific Linux SLSA-2015:1135-1 php 2015-06-24
Oracle ELSA-2015-1135 php 2015-06-23
CentOS CESA-2015:1135 php 2015-06-24
Red Hat RHSA-2015:1135-01 php 2015-06-23
Red Hat RHSA-2015:1053-01 php55 2015-06-04
Fedora FEDORA-2015-6399 php 2015-04-27
Fedora FEDORA-2015-6407 php 2015-04-23
Slackware SSA:2015-111-10 php 2015-04-21
Arch Linux ASA-201504-14 php 2015-04-17
Red Hat RHSA-2015:1066-01 php54 2015-06-04
Mandriva MDVSA-2015:080 php 2015-03-28
Mandriva MDVSA-2015:079 php 2015-03-28
openSUSE openSUSE-SU-2015:0440-1 php5 2015-03-06
SUSE SUSE-SU-2015:0436-1 PHP 5.3 2015-03-05
Ubuntu USN-2501-1 php5 2015-02-17
SUSE SUSE-SU-2015:0424-1 php5 2015-03-04
Mageia MGASA-2015-0090 php 2015-03-03

Comments (none posted)

pigz: directory traversal

Package(s):pigz CVE #(s):CVE-2015-1191
Created:February 16, 2015 Updated:March 7, 2016
Description: From the CVE entry:

Multiple directory traversal vulnerabilities in pigz 2.3.1 allow remote attackers to write to arbitrary files via a (1) full pathname or (2) .. (dot dot) in an archive.

Alerts:
Mageia MGASA-2016-0104 pigz 2016-03-09
openSUSE openSUSE-SU-2016:0662-1 pigz 2016-03-06
openSUSE openSUSE-SU-2016:0650-1 pigz 2016-03-04
Fedora FEDORA-2015-1510 pigz 2015-02-15
Fedora FEDORA-2015-1488 pigz 2015-02-15

Comments (none posted)

puppetlabs-stdlib: privilege escalation

Package(s):puppetlabs-stdlib CVE #(s):CVE-2015-1029
Created:February 16, 2015 Updated:February 18, 2015
Description: From the CVE entry:

The puppetlabs-stdlib module 2.1 through 3.0 and 4.1.0 through 4.5.x before 4.5.1 for Puppet 2.8.8 and earlier allows remote authenticated users to gain privileges or obtain sensitive information by prepopulating the fact cache.

Alerts:
Fedora FEDORA-2015-1700 puppetlabs-stdlib 2015-02-15
Fedora FEDORA-2015-1708 puppetlabs-stdlib 2015-02-15

Comments (none posted)

roundcubemail: cross-site scripting

Package(s):roundcubemail CVE #(s):CVE-2015-1433
Created:February 13, 2015 Updated:February 18, 2015
Description:

From the openSUSE advisory:

program/lib/Roundcube/rcube_washtml.php in Roundcube before 1.0.5 did not properly quote strings, which allowed remote attackers to conduct cross-site scripting (XSS) attacks via the style attribute in an email.

Alerts:
Debian-LTS DLA-613-1 roundcube 2016-09-08
Fedora FEDORA-2015-1761 roundcubemail 2015-02-15
Fedora FEDORA-2015-1772 roundcubemail 2015-02-15
openSUSE openSUSE-SU-2015:0286-1 roundcubemail 2015-02-13

Comments (none posted)

sudo: information disclosure

Package(s):sudo CVE #(s):CVE-2014-9680
Created:February 17, 2015 Updated:November 4, 2015
Description: From the sudo advisory:

Prior to sudo 1.8.12, the TZ environment variable was passed through unchecked. Most libc tzset() implementations support passing an absolute pathname in the time zone to point to an arbitrary, user-controlled file. This may be used to exploit bugs in the C library's TZ parser or open files the user would not otherwise have access to. Arbitrary file access via TZ could also be used in a denial of service attack by reading from a file or fifo that will block.

Alerts:
openSUSE openSUSE-SU-2016:3004-1 sudo 2016-12-05
openSUSE openSUSE-SU-2016:2983-1 sudo 2016-12-02
openSUSE openSUSE-SU-2015:1913-1 sudo 2015-11-04
openSUSE openSUSE-SU-2015:1849-1 sudo 2015-10-30
Scientific Linux SLSA-2015:1409-1 sudo 2015-08-03
Oracle ELSA-2015-1409 sudo 2015-07-29
Red Hat RHSA-2015:1409-01 sudo 2015-07-22
Gentoo 201504-02 sudo 2015-04-11
Mandriva MDVSA-2015:126 sudo 2015-03-29
Ubuntu USN-2533-1 sudo 2015-03-16
Fedora FEDORA-2015-2247 sudo 2015-02-23
Fedora FEDORA-2015-2281 sudo 2015-02-22
Debian DSA-3167-1 sudo 2015-02-22
Mageia MGASA-2015-0079 sudo 2015-02-19
Slackware SSA:2015-047-03 sudo 2015-02-16
Debian-LTS DLA-160-1 sudo 2015-02-27

Comments (none posted)

unzip: code execution

Package(s):unzip CVE #(s):CVE-2015-1315
Created:February 18, 2015 Updated:February 18, 2015
Description: From the Ubuntu advisory:

William Robinet discovered that unzip incorrectly handled certain malformed zip archives. If a user or automated system were tricked into processing a specially crafted zip archive, an attacker could possibly execute arbitrary code.

Alerts:
Ubuntu USN-2502-1 unzip 2015-02-17

Comments (none posted)

virt-who: information leak

Package(s):virt-who CVE #(s):CVE-2014-0189
Created:February 16, 2015 Updated:March 6, 2015
Description: From the CVE entry:

virt-who uses world-readable permissions for /etc/sysconfig/virt-who, which allows local users to obtain password for hypervisors by reading the file.

Alerts:
Scientific Linux SLSA-2015:0430-1 virt-who 2015-03-25
Red Hat RHSA-2015:0430-01 virt-who 2015-03-05
Fedora FEDORA-2015-1632 virt-who 2015-02-15

Comments (none posted)

xorg-server: information leak/denial of service

Package(s):xorg-server CVE #(s):CVE-2015-0255
Created:February 12, 2015 Updated:May 1, 2015
Description: From the X.Org advisory:

Olivier Fourdan from Red Hat has discovered a protocol handling issue in the way the X server code base handles the XkbSetGeometry request.

The issue stems from the server trusting the client to send valid string lengths in the request data. A malicious client with string lengths exceeding the request length can cause the server to copy adjacent memory data into the XKB structs. This data is then available to the client via the XkbGetGeometry request. The data length is at least up to 64k, it is possible to obtain more data by chaining strings, each string length is then determined by whatever happens to be in that 16-bit region of memory.

A similarly crafted request can likely cause the X server to crash.

Alerts:
Debian-LTS DLA-218-1 xorg-server 2015-05-01
Gentoo 201504-06 xorg-server 2015-04-17
Scientific Linux SLSA-2015:0797-1 xorg-x11-server 2015-04-13
CentOS CESA-2015:0797 xorg-x11-server 2015-04-10
Oracle ELSA-2015-0797 xorg-x11-server 2015-04-09
Oracle ELSA-2015-0797 xorg-x11-server 2015-04-09
CentOS CESA-2015:0797 xorg-x11-server 2015-04-10
Red Hat RHSA-2015:0797-01 xorg-x11-server 2015-04-10
Mandriva MDVSA-2015:119 x11-server 2015-03-29
Fedora FEDORA-2015-3948 nx-libs 2015-03-26
Fedora FEDORA-2015-3964 nx-libs 2015-03-26
openSUSE openSUSE-SU-2015:0337-1 xorg-x11-server 2015-02-20
openSUSE openSUSE-SU-2015:0338-1 tigervnc 2015-02-20
Mageia MGASA-2015-0073 x11-server 2015-02-17
Ubuntu USN-2500-1 xorg-server, xorg-server-lts-trusty, xorg-server-lts-utopic 2015-02-17
Debian DSA-3160-1 xorg-server 2015-02-11

Comments (none posted)

Page editor: Jake Edge

Kernel development

Brief items

Kernel release status

The 3.20/4.0 merge window remains open, so there is no current development kernel. The flow of patches into the mainline repository continues; see the separate article below for details.

Stable updates: none have been released in the last week.

Comments (none posted)

Quotes of the week

It's coding style robot code nothing more. Like some forgotten corridor cleaned relentlessly by a lost Roomba but where no user has trodden in years.
Alan Cox

SMP always cracks a few rotten eggs in the RT omelet.
Steven Rostedt

Comments (1 posted)

Kernel development news

3.20 merge window part 2

By Jonathan Corbet
February 18, 2015
As of this writing, 7,849 non-merge changesets have been pulled into the mainline repository for this development cycle; about 4,200 of those have come in since last week's summary was written. Some of the more interesting user-visible changes found in those 4,200 patches include:

  • The parallel NFS (pNFS) subsystem has gained support for the under-development FlexFile layout. This layout allows file metadata to be stored in a different location from the file contents.

  • The persistent storage subsystem can optionally provide a new special file (/dev/pmsg0) allowing user-space programs to log data into the store.

  • The Smack security module can now interface with the netfilter system, using security labels to filter packets.

  • The ubifs filesystem now has multiqueue block layer support (increasing its performance) and support for security.* extended attributes (making security module support possible).

  • The Android binder code has been equipped with security hooks allowing it to be brought under SELinux (or any other security module) policies.

  • The I2O bus subsystem has been moved into the staging directory with the idea of removing it from the kernel entirely in the near future. As far as the developers can tell, nobody is using this code; if that impression is mistaken, now would be a good time to say something.

  • See this posting for a description of the changes to the Intel graphics driver in this development cycle.

  • The nonvolatile memory support patches have been merged, making it possible to host filesystems in persistent memory with good performance.

  • The PA-RISC architecture is no longer able to run 32-bit HP-UX binaries. The number of users upset by this change is expected to be small.

  • The lazytime filesystem option (with support in ext4, initially) has been merged. Lazytime allows accurate tracking of file access times without creating lots of write I/O to the filesystem.

  • New hardware support includes:

    • Systems and processors: IBM s/390 z13 processors, Artesyn MVME2500 single board computers, Conexant Digicolor SoCs, NVIDIA Tegra132 SoCs, Freescale LS2085A SoCs, and Mediatek MT65xx & MT81xx ARMv8 SoCs,

    • Graphics: ATMEL HLCDC display controllers and Samsung Exynos7 SoC display controllers. Also, the "fbtfb" subsystem has been added to the staging tree; it provides support for a wide range of small TFT LCD display modules.

    • Industrial I/O: Solteam Opto JSA1212 proximity and ambient light sensors, Kionix KMX61 6-axis accelerometer/magnetometers, Freescale MMA9551L intelligent motion sensors, Freescale MMA9553L intelligent pedometers, Semtech SX9500 proximity sensors, Capella Microsystems cm3232 ambient light sensors, Qualcomm SPMI PMIC voltage analog-to-digital converters (ADCs), Cosmic Circuits 10001 ADCs, and Samsung Sensorhub microcontroller units.

    • Miscellaneous: APM X-Gene GPIO standby controllers, Fujitsu MB86S7x GPIO controllers, Altera mailbox units, Version 2.0 Trusted Platform Modules (TPMs), Abracon AB-RTCMC-32.768kHz-B5ZE-S3 realtime clocks, Armada 38x Marvell SoC realtime clocks, ETRAX FS serial ports, Alphascale ASM9260 timers, Rockchip rk3288 timers, Conexant Digicolor timers, and Dallas/Maxim DS1685 realtime clocks.

    • Pin control: Allwinner A31s SoC pin controllers, Amlogic Meson SoC pin controllers, and Xilinx Zynq pin controllers, Qualcomm 8916 pin controllers.

    • USB: Rockchip USB2 PHYs and NXP ISP1761 USB device controllers.

Changes visible to kernel developers include:

  • The ARM I/O memory-management unit (IOMMU) layer has a new, generic page-table management API. See drivers/iomu/io-pgtable.c and io-pgtable.h for an overview of this API.

  • The LED subsystem now has a new device class for LEDs operating in the "flash" (as in camera flash) mode.

  • The kernel address sanitizer (KASan) has been merged. KASan monitors kernel memory references in an attempt to catch code reaching into memory it has no business touching. For now, KASan only works on the x86_64 architecture, and memory hotplug must be disabled.

  • Developers working with the GDB debugger may want to look at the new set of helper scripts added under scripts/gdb.

  • The printk() family of functions has a new format type (%pb) for the printing of bitmaps. The number of bits in the bitmap must be specified as the field width in the format string.

So far, this development cycle seems to be a relatively slow one, as was suggested before the merge window opened. Still, the emphasis should be on "relatively"; nearly 8,000 patches is not a small number.

The version number for this kernel is yet to be determined. Linus ran a poll on Google+ that came out in favor of calling it 4.0, but he has not said what he will actually do. Tune in next week for the final changes that come in for this cycle and, presumably, an answer to the naming question.

Comments (1 posted)

Epoll evolving

By Jonathan Corbet
February 16, 2015
Epoll is a set of Linux-specific system calls intended to provide fast polling for large numbers of file descriptors. The API has been in use since it was merged during the 2.5 development series but, like many interfaces, there is always room for improvement. There are currently two patch sets making the rounds that would add functionality to this set of system calls.

An epoll overview

Epoll is designed to function somewhat like select() or poll(), but with more options and with higher performance when large numbers of file descriptors are in use. Each call to select() or poll() can involve an entirely new set of file descriptors, so the kernel must go through the process of validating each one, checking for I/O readiness, and adding the polling process to the appropriate wait queue. But the actual list of file descriptors tends not to change much between calls, so much of that work is unnecessary duplicated effort. The epoll calls get around this problem by separating that setup work from the act of waiting for a file descriptor to become ready.

A process using this API must begin by creating a special file descriptor to use with polling; that is done with a call to one of:

    #include <sys/epoll.h>

    int epoll_create(int size);
    int epoll_create1(int flags);

Either call will return a file descriptor to be used with the remaining epoll functions. The size parameter to epoll_create() is no longer used; the flags argument added for epoll_create1() can be used to set the close-on-exec flag for the resulting file descriptor.

The next step is to add all of the file descriptors that are to be monitored, using:

    int epoll_ctl(int efd, int op, int fd, struct epoll_event *event);

If op is EPOLL_CTL_ADD, the given fd will be added to the set. The event parameter is used to describe which events will be polled for; see the man page for details. epoll_ctl() can also be used to remove file descriptors or to modify how the polling is done.

Finally, actually waiting for one of the file descriptors in the set to become ready is done with:

    int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
    int epoll_pwait(int epfd, struct epoll_event *events, int maxevents, int timeout,
                    const sigset_t *sigmask);

The events that cause epoll_wait() to return (up to maxevents) will be stored in the events array; the timeout parameter is specified in milliseconds. The epoll_pwait() version also allows the specification of a set of signals to be blocked (or unblocked) during the call. Again, see the man page for details.

epoll_ctl_batch() and epoll_pwait1()

This patch set from Fam Zheng introduces two new system calls to the epoll family. The first of these addresses a performance problem that comes up in situations where it is often necessary to make changes to the file descriptors in the epoll set. A call to epoll_ctl() can only add, modify, or delete a single file descriptor; if a lot of descriptors need to be changed, there will need to be a lot of epoll_ctl() calls to get that work done. The proposed epoll_ctl_batch() system call gets around that problem by processing multiple file descriptors in a single call:

    int epoll_ctl_batch(int epfd, int flags, int ncmds, struct epoll_ctl_cmd *cmds);

The cmds structure essentially duplicates all of the arguments that would have been passed to an epoll_ctl() call. By passing an array of these structures, a program can perform operations on multiple file descriptors with a single system call.

Fam's other change is to add a new system call to perform the actual polling:

    struct epoll_wait_params {
	int clockid;
	struct timespec timeout;
	sigset_t *sigmask;
	size_t sigsetsize;
    };

    int epoll_pwait1(int epfd, int flags,
                     struct epoll_event *events, int maxevents,
                     struct epoll_wait_params *params);

This version of epoll_wait() adds a new flags parameter, but does not define any flag values, so flags must be zero. The parameters shuffled off into the params structure are mainly intended to give the application more control over timeout processing. The millisecond-resolution timeout understood by epoll_wait() has proved to be too coarse for a number of use cases. The new system call defines a timeout with nanosecond resolution, getting around that problem.

Better multi-threaded behavior

Jason Baron (of Akamai) has run into a different problem that only comes up with a relatively uncommon usage pattern. Normally, there will only be one process using a polling function to monitor a given file descriptor. But, in Jason's use case, there can be multiple threads, each of which is using epoll to track the same set of file descriptors. In this setting, an event on any given file descriptor will cause all of the waiting processes to wake up, even though only one of them will be able to actually handle the event. This thundering-herd problem is something that Jason would like to avoid.

His response is this patch adding a couple of new flags to be attached to file descriptors via epoll_ctl(). The first of these, EPOLLEXCLUSIVE, requests that only one process be woken up to handle an event on the associated file descriptor. Internally, the change is a simple matter of using add_wait_queue_exclusive() instead of add_wait_queue() when setting up the polling. Obviously, all processes polling the same file descriptor would have to use the exclusive mode to get down to a single wakeup per event.

That change did not entirely solve Jason's problem, though, in that it ended up with the same process waking up in response to each event. Since one of the reasons for epoll's existence is to allow processes to be left on all of the file-descriptor-specific wait queues between calls to epoll_wait(), the process that is at the head of any given queue will remain there. It will thus be the one to receive all of the exclusive wakeups. But the whole point of having multiple processes polling the same file descriptor is to spread the work around; waking the same process every time thwarts that objective. To deal with that, Jason added another flag, called EPOLLROUNDROBIN, that causes the kernel to work through each of the polling processes in turn.

Support for this mode was added to the scheduler in the form of a new wait queue function:

    void add_wait_queue_rr(wait_queue_head_t *q, wait_queue_t *wait);

When waiting is done using add_wait_queue_rr(), only a single process will wake, just like with add_wait_queue_exclusive(). But, in addition, the process at the head of the wait queue will be moved to the tail, so it will not see another wakeup until all of the other processes have had their turn.

Jason's patch posting includes results from a little benchmark program showing a nearly 50% reduction in execution time when the exclusive mode is used. When there are a lot of wakeups happening (as can be the case for many network-oriented workloads), the extra overhead caused by thundering herds can be crippling.

Both patches have received a fair number of review comments, and Fam's patches in particular have evolved quite a bit since the first posting in January. Your editor's unscientific impression is that API-related patches are getting more attention than they once did. That, of course, would be a good thing; APIs live forever, so it's better to get them right before shipping them to users and being committed to supporting them forever. These patches seem close to being ready, though; they might make an appearance in the next merge window.

Comments (9 posted)

Creating scalable APIs

February 17, 2015

This article was contributed by Paul McKenney

Non-scaling APIs—those that perform poorly on systems with large numbers of CPUs—are a painful fact of life, an unavoidable consequence of many of these APIs having been created on uniprocessors by people with little or no experience with parallelism. However, designing scalable APIs can be a challenge even for those of us with significant parallel-programming experience.

Therefore, it should come as no surprise that Austin T. Clements's Ph.D. dissertation [PDF] entitled “The Scalable Commutativity Rule: Designing Scalable Software for Multicore Processors” received a well-deserved SIGOPS Dennis M. Ritchie award in 2014. The most important points are covered in the corresponding 2013 Symposium on Operating System Principles (SOSP) paper [PDF] and ACM Transactions on Computer Systems (TOCS) article (both co-authored by M. Frans Kaashoek, Nickolai Zeldovich, Robert T. Morris, and Eddie Kohler), which are further summarized here. This work resembles the Laws of Order paper covered by an LWN article back in 2011. However, as you might guess from the name, the scalable commutativity rule is concerned with scalability, in contrast with the memory-barrier focus of Laws of Order.

Overview of the scalable commutativity rule

We all learned about the commutative law of addition, which states that X + Y gives the same value as Y + X, for all possible values of X and Y. The scalable commutativity rule uses a more general definition of commutativity that encompasses the order of execution of concurrent operations as well as the order of arguments to a single operator or function. For example, suppose that one CPU atomically adds the value X to variable A at about the same time that another CPU atomically adds the value Y to this same variable. Because addition is commutative in this more concurrent sense, we know that regardless of the order of execution, the overall effect will be to add X + Y to A.

The key insight behind the scalable commutativity rule is that if the ordering of a pair of operations is irrelevant according to the API, then it should be possible to implement those operations so as to avoid scalability bottlenecks. In contrast, if the ordering of the two operations is critically important, then it is most likely impossible to avoid the bottlenecks between these operations.

For example, suppose that the two operations are inserting two objects, each with its own key, into a search data structure not already containing elements with those keys. Suppose further that this structure does not allow duplicate keys. No matter which of the two operations executes first, the result is the same: both objects are successfully inserted. Therefore, the scalable commutativity rule holds that a scalable implementation is possible, and there is, in fact, a wealth of scalable implementations of search structures, ranging from hash tables to radix trees to dense arrays.

In contrast, suppose that the two operations are inserting two objects with the same key into a search data structure that does not already contain an object with that key. Now the order is critically important, because the first operation will succeed and the second will fail. That operation is unlikely to be scalable. For example, in a hash table with per-bucket locking, both operations would attempt to acquire the same lock, thus preventing them from executing concurrently.

Quick Quiz 1: Why bother with commutativity? Why not just partition the problem and get on with life?
Answer

But pure mathematical commutativity requires that a given pair of concurrent operations always give the same result, regardless of not only execution order, but also initial state and argument values. This means that pure mathematical commutativity is too restrictive to be useful for predicting scalability in practice. For example, conditional lock acquisition is non-commutative from a pure mathematical viewpoint because if two CPUs attempt to conditionally acquire a given lock at the same time, one of the CPUs will acquire the lock and the other will get a failure indication. Which CPU acquires and which gets a failure indication depends on the order of execution, hence the non-commutativity from a pure mathematical viewpoint.

Of course, in practice, we usually work hard to make sure that different CPUs are attempting to acquire different locks, and in this case, conditional lock acquisition is independent of execution order. In other words, from a pure mathematical viewpoint, conditional lock acquisition is not commutative, but for common use cases in practice, it commutes—and scales—just fine. The authors therefore define a alternative notion of commutativity that is state-dependent, interface-dependent, and monotonic, which they abbreviate as “SIM commutativity”. Because this type of commutativity depends on the values of the arguments of the function in question (unlike mathematical commutativity), conditional locking is SIM commutative because if the two CPUs are acquiring different locks, the results will be independent of the order of acquisition. This definition is, therefore, compatible with the long-standing parallel-programming advice to “lock data, not code.”

API analysis and the Linux kernel

As with the Laws of Order, a key strength of the scalable commutativity rule is that it can be applied to an API, even before the implementation is written. In fact, the authors have constructed a tool named Commuter that can analyze whether or not a given API is SIM commutative. They applied this tool to a subset of 18 POSIX system calls, which produced no fewer than 13,664 test cases exercising commutative pairs of operations.

Of course, the fact that an API is commutative does not necessarily mean that a given implementation scales. For example, a kernel that relied solely on a Big Kernel Lock for synchronization would not scale well regardless of the API. Therefore, the authors also created a tool named mtrace that, in conjunction with other tools described in Section 5 of the SOSP paper, analyzes the Linux kernel to find bottlenecks that the scalable commutativity rule indicates could be avoided. This set of tools uses a modified version of QEMU to carry out this analysis, and take the test cases mentioned earlier as input.

Quick Quiz 2: That is quite an improvement, when will these changes be applied to the Linux kernel?
Answer

The Linux kernel did surprisingly well, avoiding violations of the scalable commutativity rule for 9,389 of the 13,664 test cases, or almost 70% of them. But the authors figured that it was possible to do better. Unfortunately, their time budget did not permit them to rewrite the Linux kernel, so they instead created a research OS kernel named sv6. This kernel avoided violations of the scalable commutativity rule for 13,528 of the 13,664 test cases, or more than 99% of them.

API analysis and POSIX

Quick Quiz 3: Isn't posix_spawn() perfectly commutable with everything?
Answer

The authors' tool also identifies POSIX operations that do not commute, which thus might be harder to implement scalably. One example is fork(), which copies an entire process, thus failing to commute with pretty much anything that process might do. This is, of course, especially painful when invoking fork() from a multithreaded process. This can be particularly annoying if the child immediately does an exec(), thus rendering almost all fork()-based non-commutativity irrelevant. They suggest using the obscure posix_spawn() in place of fork()/exec() because posix_spawn() is equivalent to those two calls but is much more commutable.

The authors also call out the non-commutativity inherent in the POSIX rule requiring that open() return the lowest-numbered available file descriptor. They point out that this non-commutativity could be eliminated via an O_ANYFD flag to open(). These and other suggestions are described in the next section.

Design and implementation guidance

Sections 4 and 6.3 of the SOSP paper provide some design and implementation guidance.

Decompose compound operations. The paper gives two examples of commutativity-challenged compound operations: fork() and stat(). As noted above, the fork() system call copies a process, and most of the time most of this work is discarded by a subsequent exec(). However, all this copying causes fork() to be non-commutative with everything from memory writes to open() and close() system calls. Decomposing the fork() system call to eliminate most of the doomed copy operations, and then combining it with exec() results in something called posix_spawn(), which avoids much of the fork() system call's non-commutativity. In theory, then, posix_spawn() should be much more scalable than is fork().

Similarly, the stat() system call returns so much information on the specified file that it becomes non-commutative with almost any access to that same file—and most of the information is ignored by any particular caller. Providing a way to return only the information of interest would greatly increase commutativity, and should, in theory, increase scalability.

In practice, it is not clear that the non-commutativity of fork() and stat() are the most urgent bottlenecks in the Linux kernel. On the other hand, Figure 7 of the SOSP paper does show some benchmark results that indicate that the Linux kernel does have some potential room for improvement.

Embrace specification non-determinism. Interestingly enough, this was one of the loopholes to the Laws of Order, which reappears here as a way to improve the commutativity of APIs in order to permit more highly scalable implementations. Here, the authors take aim at the POSIX standard's insistence that open() and friends return the lowest-numbered available file descriptor, which was mentioned above. Although this restriction was helpful back in the days of 16-bit Unix systems that lacked the dup2() system call, for almost all of us, those days are thankfully long gone. This requirement makes a pair of concurrent open() calls non-commutative, thus imposing a limit on scalability. In contrast, if open() and friends were permitted to return an arbitrarily selected file descriptor, then file descriptor allocation would not necessarily impose a scalability bottleneck.

Permit weak ordering. This was another of the loopholes to the Laws of Order, which reappears here as another way to improve the commutativity of APIs in order to permit more highly scalable implementations. The paper gives the example of strict ordering of messages sent on Unix-domain sockets, especially for the SOCK_DGRAM sockets where the user might have neither need nor desire for any sort of ordering. Presumably, weak ordering would also help in the case of the stat() system call.

Release resources asynchronously. Asynchronous freeing of memory is, of course, used heavily by read-copy update (RCU), but the authors note that it also applies in many other cases. For example, an munmap() system call executed in a multithreaded process requires synchronous TLB shootdowns in order to prevent other threads from doing “doomed” writes to memory that is in the process of being unmapped. This, in turn, means that the munmap() system call cannot commute with a memory write to the unmapped region, again imposing a limit on scalability. The authors suggest that an madvise() flag be provided to allow asynchronous munmap(), increasing commutativity and, in turn, potentially increasing performance and scalability.

Layer scalability. The authors note that their research operating system's filesystem uses scalable data structures with naturally commutative operations. Doing this at each layer of the software stack would clearly make it easier to get good results further up the stack.

Defer work. To the best of my knowledge, this good advice was first stated in Alexia Massalin's dissertation [.ps.gz]. However, the advice bears repeating, and the authors describe its application to generating unique identifiers (specifically inode numbers). Their approach uses a per-CPU counter concatenated with the ID of the CPU generating the identifier. This approach ensures that these identifiers never repeat, and thus that each CPU can safely generate inode numbers without any sort of synchronization with the other CPUs. Deferring the synchronization ensures that identifier generation need never be a scalability bottleneck.

Compatibility considerations might make this approach to identifier generation difficult to apply in some cases, but the general approach of deferring work can be quite useful. For but one example, work deferral is used heavily by RCU.

Precede pessimism with optimism. The idea here is to have a highly scalable optimistic stage followed by a less scalable, more general, and hopefully rarely used pessimistic stage. The paper gives double-checked locking as one example, and handling of special cases of the rename() system call as another. However, many other examples of this approach come to mind, for example, the per-CPU-cached memory allocators within the Linux kernel. This design approach has also been called “parallel fastpath”, for example here and in Section 6.4 of my book, Is Parallel Programming Hard, And, If So, What Can You Do About It?.

Quick Quiz 4: But if the point of avoiding the read is to avoid acquiring a lock, aren't we really avoiding writes, not reads?
Answer

Don't read unless necessary. Most kernel hackers avoid unnecessary writes in order to avoid the resulting cache misses, but the authors point out that unnecessary reads can also limit scalability, especially if safely carrying out the read requires acquiring locks. They give pathname lookup as an example, pointing out that a typical implementation of the old-school Unix namei() function (lookup_fast() and lookup_slow() in the Linux kernel, though still living in namei.c) returns the inode in addition to checking whether the pathname exists. The fact that it returns the inode makes it non-commutative with a number of other operations, including rename(). The sv6 research OS's ScaleFS therefore provides a separate internal interface that checks for the pathname without accessing the inode in order to avoid this potential scalability bottleneck.

This is a good list of scalability techniques, and most of them focus on promoting commutativity, at least in the common case. However, embrace specification non-determinism, permit weak ordering, and defer work represent a different approach that is discussed in the next section.

Scaling despite non-commutativity

The scalable commutativity rule states that whenever interface operations commute, they can be implemented in a way that scales. It is tempting to assume that the inverse rule also applies, namely, that whenever interface operations fail to commute, there can be no scalable implementation. However, the inverse does not always apply, as evidenced by the following exceptions:

  1. If the hardware provides a register containing a fine-grained, strictly increasing time, objects could be scalably “updated” by using a timestamped per-thread log.
  2. If the hardware allows certain communications patterns to scale, then non-commutative operations using those patterns might scale. In our search-structure example, a hardware content-addressable memory might allow a search structure to be constructed that scaled well even with concurrent operations on the same key.
  3. If the algorithm can tolerate weak ordering, then permit weak ordering in order to decouple mechanisms that would otherwise impose a non-commutativity scalability bottleneck on the system.
  4. If the algorithm can tolerate non-determinism, then embrace specification non-determinism in order to decouple mechanisms that would otherwise impose a non-commutativity scalability bottleneck on the system.
  5. If the algorithm can tolerate latency, then defer work in order to avoid scalability bottlenecks by delaying potentially conflicting operations until there is no longer the potential for contention.

Quick Quiz 5: But the first two exceptions depend on hardware features that are not universally available, so why would anyone want their software to depend on such features?
Answer

There have been any number of efforts to provide hardware acceleration in order to take advantage of the first and second exceptions. RCU and some forms of scalable counters take full advantage of the third, fourth, and fifth exceptions. The first and second exceptions to the inverse are also exceptions to the scalable commutativity rule itself because they invalidate hardware assumptions underpinning the formal proof of that rule.

Given that both RCU read-side critical sections and counter addition are commutative, it is quite reasonable to ask why they would need to take advantage of any of these exceptions.

For RCU, the problem is that although RCU readers commute with each other, they do not commute with grace periods: If a given rcu_read_lock() executes just before a given synchronize_rcu() begins, then that synchronize_rcu() must wait on the RCU read-side critical section started by that rcu_read_lock(). If the order of these two operations is reversed, then synchronize_rcu() need not wait. RCU can nevertheless avoid scalability bottlenecks by delaying both the beginnings and the ends of grace periods. This permits batching, which allows the overhead of a given grace-period operation to be amortized over an arbitrarily large number of updates, thus providing excellent scalability despite the non-commutativity.

Similarly, although a pair of additions to a given counter are commutative, additions to a counter do not commute with reads from that counter. Also, if you run a “scalable” counter on a large system with (say) 50% updates and 50% reads, the results probably will not be pretty and definitely will not be scalable. However, this scalability bottleneck can be avoided by allowing counter reads to return outdated values for the counter, in effect adding a delay between the time an update happens and the time it is visible to readers. This added delay allows readers to fetch the value of a single counter that is periodically updated at a rate low enough to avoid scalability problems, as described in Section 5.2.4 of Is Parallel Programming Hard, And, If So, What Can You Do About It?.

Conclusions

This does raise a question as to how severe non-commutativity problems really are and, of course, one ready answer is: “Clearly not severe enough to have been addressed yet”. That said, one great benefit of this work is that it allows developers to more easily determine whether a bottleneck is inherent in the API, or whether it is the fault of the implementation. Another welcome aspect of this paper is the discussion of ways to avoid non-commutativity bottlenecks, as is the demonstration of the benefits of avoiding these bottlenecks in the guise of the sv6 research OS. Finally, this paper has the virtue of making it quite clear exactly what is and is not commutative.

If I was to identify a shortcoming of this paper, it would be that the existence of non-commutativity (or perhaps non-scalable non-commutativity?) does not necessarily translate into a serious bottleneck. For example, a given instance of non-commutativity might only become a bottleneck for 1,000,000-CPU shared-memory systems, which currently face other types of bottlenecks so severe that to the best of my knowledge, no such system exists. It might therefore make no sense to eliminate this instance of non-commutativity. However, this is by no means a fatal flaw. It instead indicates that it is necessary to consider commutativity to be but one of many inputs to the task of creating a good API design, rather than blindly doing whatever the Commuter tool says to do. And perhaps this will be addressed in future work.

I nevertheless expect this important work to inform future API design, allowing future implementations to avoid a great many scalability bottlenecks. Or, at least, to avoid those bottlenecks that are not mandated by standards.

Acknowledgments

I owe thanks to Robert Morris and Austin Clements for their careful review and thoughtful comments. I am grateful to Jim Wasko for his support of this effort.

Answers to Quick Quizzes

Quick Quiz 1: Why bother with commutativity? Why not just partition the problem and get on with life?

Answer: It turns out that partitioning is in fact one way to promote commutativity. After all, when you partition the problem, operations acting on different partitions can happen in any order without changing the result. So partitioning is one way to achieve commutativity, but there are also other valuable techniques.

Back to Quick Quiz 1.

Quick Quiz 2: That is quite an improvement, when will these changes be applied to the Linux kernel?

Answer: Hopefully sooner rather than later.

That said, the authors did use some implementation techniques that might not be unanimously welcomed by Linux users. For one example, they completely dispensed with mass storage in favor of RAM-based filesystems (which might well be addressed in future work). In addition, some of the bottlenecks identified in Linux will be more important than others.

Back to Quick Quiz 2.

Quick Quiz 3: Isn't posix_spawn() perfectly commutable with everything?

Answer: Close, but not quite. The list of things that can fail to commute with posix_spawn() includes: exit(), fatal signals, writes to the memory containing the pathname of the executable, open(), and close(), among many others. Nevertheless, posix_spawn() is considerably more commutable than is fork().

Too bad about those software-engineering code-compatibility concerns.

Back to Quick Quiz 3.

Quick Quiz 4: But if the point of avoiding the read is to avoid acquiring a lock, aren't we really avoiding writes, not reads?

Answer: You can certainly look at it that way. Without the locks, namei() would make use of the permit weak ordering exception called out above, at least assuming that it avoided crashing in the process. However, the fact remains that names like lookup_fast() do not connote “write” to most people.

Interestingly enough, Linux's lookup_fast() can avoid most writing if it is able to stay on the fastpath. However, pathname coherence is guaranteed by a read-seqlock operation, which could, in theory, inflict a scalability bottleneck on lookup_fast() in the face of frequent path rearrangements. Such rearrangements could (again, in theory) cause the read-seqlock to always fail, limiting lookup_fast() even without considering any lookup_fast() writes.

So reads can result in scalability problems. Admittedly indirectly, and caused by someone else's writes, but the point still stands: reads really can harm your scalability and performance.

Back to Quick Quiz 4.

Quick Quiz 5: But the first two exceptions depend on hardware features that are not universally available, so why would anyone want their software to depend on such features?

Answer: Theory, meet portable practice.

That said, it all depends on the situation. The more you need the additional scalability, the more willing you will be to depend on specific hardware. And perhaps now that multicore hardware has well and truly arrived, additional hardware scalability optimizations will become available. Stranger things have happened.

Back to Quick Quiz 5.

Comments (29 posted)

Patches and updates

Kernel trees

Sebastian Andrzej Siewior 3.18.7-rt1 ?

Architecture-specific

Core kernel code

Device drivers

Device driver infrastructure

Filesystems and block I/O

Memory management

Joonsoo Kim Introduce ZONE_CMA ?
Kirill A. Shutemov THP refcounting redesign ?

Networking

Joe Stringer OVS conntrack support ?

Virtualization and containers

Miscellaneous

Page editor: Jonathan Corbet

Distributions

Reproducible Android app builds

By Nathan Willis
February 18, 2015

The subject of reproducible builds is a popular topic of late in the free-software world, with major projects—such as Debian and Tor—making it a high priority. Although compiling verifiable, reproducible binaries on desktop and server systems is a significant engineering problem, there is even more complexity to the problem on mobile platforms, where a single vendor can act as gatekeeper and can impose rules on the app-distribution model that get in the way. Nevertheless, F-Droid and the Guardian Project have undertaken an effort to make reproducible builds feasible for Android apps, so that users can independently establish that the packages they install correspond to the source code that is published.

The Guardian Project develops security- and privacy-enhanced mobile apps: encrypted text chat, encrypted voice calling, Tor-based web browsing, and so forth. Although there are a few Guardian Project applications that run on other platforms, most of its apps target Android. All of the source code is available, but—naturally enough—the users for whom security and privacy are most critical may also have cause to be suspicious that an app installed via the Google or Amazon app store has been compromised.

This is where F-Droid, an entirely free-software Android app repository, comes into the picture. Every app package published in the F-Droid repository can be built from source, because only apps under free-software licenses are allowed. Thus, choosing apps from F-Droid does make it theoretically possible for users to verify not just that the package has not been tampered with since it was built, but that the app's binary corresponds to a specific source code release. Of course, a similar guarantee would accompany having users compile apps locally themselves, but that defeats the purpose of having an app repository altogether.

Furthermore, Android apps are supposed to carry a signature from the developer, not from the repository. Historically, F-Droid has used per-app signing keys to sign the .apk packages that it distributes—but those signatures are, in a sense, weaker than a signature from the upstream app developer, since some sort of alteration could have been made to the code by the repository. If it could be shown that the upstream source release compiles into a binary that is bit-for-bit identical to the one served up by the repository, though, that would also allow the user to rest assured that no malicious code has been inserted and nothing important has been removed or altered.

This is essentially the approach under development. The F-Droid publication framework downloads a signed binary app from the upstream developer, then builds a new .apk itself from the upstream source bundle and build recipe. The publication system then compares its (unsigned) .apk to the payload portion of the .apk bearing the upstream signature. If the two match, then users can see that the code was not tampered with during the F-Droid's build process. There are several tools available for checking the signature of an Android app, though the feature is not exposed during normal installation.

For this process to work, of course, both the upstream app developer and the F-Droid build system must use the same reproducible build process to create the .apk file in question. The Guardian Project has been working on this task since early 2014. In June of that year, the first reproducible build was released: Lil'Debi version 0.4.7.

Lil'Debi is a developers' tool, not an end-user application; it bootstraps a chroot-ed Debian environment on an Android phone. But the exercise proved that the deterministic build process was possible, with a few caveats—namely, that compatible versions of the JDK and other build tools be used on each system. The build process requires a few additional precautions to produce bit-for-bit identical builds. Specifically, the contents of the .apk file must be sorted into the same order for each build, and faketime must be used to ensure that the timestamps match. After Lil'Debi's 0.4.7 release, the Guardian Project released a shell script for users to compare two .apk files with.

On February 11, the F-Droid published its first verifiable, reproducible Guardian Project app: Checkey, a tool for checking Android app signatures. At present, the Checkey .apk provided through the F-Droid repository is the binary built and signed by the Guardian Project; the package has just been verified to generate the same hash as the binary built by F-Droid. The long-term plan, however, is to deliver the F-Droid binary with the upstream project's signature extracted and then re-attached, then signed a second time with the F-Droid signing key. GnuPG supports checking multiple signatures in a single file, so long as the same cipher preferences are used for both signatures.

Moving forward, the Guardian Project's LocationPrivacy app and the LEAP Encryption Access Project's BitMask app are the next two apps to be built using the reproducible build process. Ultimately, the F-Droid project hopes to make its reproducible build system available to users at large, so that anyone can independently verify that an .apk package has not been altered between its upstream release and when it was downloaded by the user.

Android users who are concerned about app integrity may not amount to a majority in the mobile application space, but the special cases of today often have a way of becoming the widespread concerns of tomorrow. Even if F-Droid remains the only mobile-app distributor to offer verifiable app packages, users stand to benefit from having somewhere to turn for increased security.

Comments (none posted)

Brief items

Distribution quotes of the week

Alas, the resulting distribution is still hopelessly compromised by the NSA, who might be even worse than Lennart Poettering. To see how deep the tendrils of US government infiltration go, just try removing libselinux1, and marvel at how much concerted malevolent effort has gone into destroying your freedom.
-- Russ Allbery

Unfortunately cryptography is [as] strong as the weakest link, and in the WoT [web of trust] the weakest link is weaker than not having the key signed at all because a signature that doesn't exist doesn't introduce noise. Debian tries to get around this by insisting your key is signed by somebody it does "know" (ie, DD). Sadly, not all DD's are complete pains in the arse, and Debian security ends up being as weak as the weakest of them.
-- Russell Stuart

Makulu is, in my opinion, an unusual creation. It is a distribution which bucks current trends in visual themes, in default applications and in focus. It is a platform that is both fairly stable (thanks to its Debian base) and experimental. I am a little surprised a 64-bit build is not available, but for now a 32-bit build with PAE will probably suit the needs of most people. Makulu is, in my opinion, worth trying just because it is marching to the beat of its own drum and doing a pretty good job of being a general purpose desktop operating system too.
-- Jesse Smith (DistroWatch review)

Comments (none posted)

End of the m0n0wall project

The first version of m0n0wall, a FreeBSD-based firewall distribution, was released 12 years ago. Now Henri Salo has announced an end to the project. "m0n0wall has served as the seed for several other well known open source projects, like pfSense, FreeNAS and AskoziaPBX. The newest offspring, OPNsense, aims to continue the open source spirit of m0n0wall while updating the technology to be ready for the future. In my view, it is the perfect way to bring the m0n0wall idea into 2015, and I encourage all current m0n0wall users to check out OPNsense and contribute if they can."

Full Story (comments: none)

Distribution News

Debian GNU/Linux

DebConf15: Call for Sprints

The DebConf15 team has issued a call for sprints. The team will be hosting sprints (providing logistics for working space, food and accommodation) during the week of DebCamp (August 10-14). There may also be sprints during DebConf (August 15-22). Both DebCamp and DebConf will be held in Heidelberg, Germany.

Full Story (comments: none)

Debian Trademark Team

Debian project leader Lucas Nussbaum has announced that, after nearly 2 years of activity, the Debian Trademark Team is now official. Richard Hartmann, one of the delegated members of the team, has posted an introduction to the team. Other members include Brian Gupta and Joe Healy.

Comments (none posted)

Newsletters and articles of interest

Distribution newsletters

Comments (none posted)

Linux for Astronomers (Linux Journal)

Over at Linux Journal, Joey Bernard looks at Distro Astro, which is a Linux distribution for astronomy. It collects programs of interest to those running telescopes and planetariums, including various image collection and processing applications. "After aiming your telescope, you need to collect some images or do some astrophotography. While you can do some of this with software like KStars, you have software specifically designed to do image capture. Some, like wxAstroCapture, are specifically written for use in astronomy. With it, you can set up automatic guiding and batch image collection. You then can go have a nice hot cup of coffee while your telescope collects your data. To help you keep track of all of these observations, you can use the Observation Manager, a logging program to maintain your records."

Comments (9 posted)

Page editor: Rebecca Sobol

Development

Scanning Python programs with Bandit

By Jake Edge
February 18, 2015

Using a program written in a particular language to search for problems in another program written in that same language has a certain amount of charm. High-level languages, such as Python, can actually give programmers easy access to the data structures built by the parser, so that these analysis programs can see the program exactly as the interpreter does. An OpenStack sub-project called Bandit does exactly that. It uses the Python abstract syntax tree (ast) module to seek out potential security problems in Python code.

OpenStack is a free-software cloud platform that is written in Python—over a million lines of it—so it makes sense for the project to have tools to look for problems in its code. Bandit comes from the OpenStack Security Group and is specifically targeted at finding security flaws in the OpenStack—or any other Python—code base. It is structured as a framework that reads in and parses the source code, then runs through a battery of tests, implemented as plugins, to seek out the use of dubious Python modules and functions, potentially dangerous code constructs, and more.

The README file outlines how to clone and install Bandit into a Python virtual environment, though it can also be installed without the virtual environment in the usual fashion:

    $ python setup.py install
From there it is simple to run; just pass a bunch of Python files to the Bandit program:
    $ bandit examples/*.py
The examples directory contains a full set of programs that demonstrate each of the rules that Bandit is enforcing. In fact, new tests proposed for merging must be accompanied with an example file to demonstrate the dubious code that Bandit will be detecting.

Running Bandit on a moderately sized body of Python code—one that runs a nearby web site—produced an 800-line report that mostly contained false positives. That is not really a surprise for a couple of reasons. For one, the tool and tests are geared toward OpenStack and how it uses Python and its modules. For example, any strings that looked like SQL were flagged as SQL injection warnings—unless the SQLAlchemy module is imported (in which case the severity is reduced to informational). That may make sense for OpenStack, but other projects may have their own mechanisms to avoid SQL injection.

In addition, one totally unrelated string that happened to contain both "select" and "from" triggered the warning. The tests would need to be much more sophisticated to avoid that kind of false positive.

Beyond that, though, a tool of this nature needs to be pretty conservative about skipping over potential problems. That means it will alert on lots of things that aren't actually vulnerabilities, but require a human to determine that. Thus, false positives.

But the list of warnings definitely had some things to look into. For example, there are complaints about network services that may be binding to all interfaces on the system, which may be unexpected. Use of the os.popen() function is generally frowned upon and its use requires some investigation. Use of the random module "is not suitable for security/cryptographic purposes", which is probably not how it is being used, but it should be looked into. And so on.

Beyond the SQL injection complaints, the most common warning was for the use of the pickle module, which can have security (and maintenance) implications. Its use in this code base should be safe (though it is something we plan to replace for other reasons at some point). Disabling those top two warning types resulted in a much shorter report, with only 14 warnings to investigate.

While disabling the pickle test was easy to do, by commenting out some lines in the bandit.yaml configuration file, turning off the SQL injection tests was not quite as straightforward. Since many of the tests are plugins, moving the injection_sql.py file aside in the install plugins directory worked well enough to disable it, but was rather inelegant. A more proper solution was to set up a profile in the configuration file that excluded the hardcoded_sql_expressions test.

Another option is to go through the source and annotate any line that causes a false positive with a "# nosec" comment. One could also filter the results based on the level of the complaint (i.e. information, warning, or error) though, in this case, that would likely mask some problems. Those with an aversion to colored output will want to use the -o file option to send the output to a file (thankfully without the color escape sequences).

Taking a spin through the examples directory will give a good overview of the kinds of things Bandit is looking for. As noted earlier, much of it is advisory in nature, like complaints about calling eval() (which is a warning, though calling exec() is considered an error), use of os.exec() and os.spawn(), use of the MD5 hash function, or any strings from a list of often-used default passwords. Beyond that, there are warnings about urllib.urlopen() ("Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected."), yaml.load() (recommending yaml.safe_load() in its place), mark_safe() (a potential cross-site scripting vector), and so on. Any of those could be security problems or completely innocuous, but someone needs to look to be sure.

OpenStack plans to add Bandit into its continuous integration system, and eventually may have it actually reject patches that don't pass. That is still probably a ways off based on the kinds of warnings it is producing now. Those classified as errors might be suitable, however. As with most projects, though, there is a pretty long to-do list on the web page.

For other projects, Bandit will likely take some tweaking to reduce the false positive rate based on the project's coding style and typical Python usage. That should be pretty easy to do, as the framework provides much of what is needed to write these types of tests. Adding new tests (or modifying existing ones) is straightforward, with plenty of code to look at for ideas. Bandit is well worth a look for Python-based projects.

Comments (none posted)

Brief items

Quotes of the week

...and while I was playing with GNOME’s new Bugzilla instance trying to get rid of some upstream feature bloat, I looked at upstream’s Bugzilla front page and spend the next hours wondering where to add eight more Search buttons/links/forms so it’ll become a full dozen.
André Klapper

future CS grads, your destiny is to build a world where your only respite from its bleakness is moments of levity about how poorly it's made
Colin Bayer

Comments (2 posted)

Wayland 1.7.0

Bryce Harrington has announced the release of Wayland 1.7.0. "The Wayland protocol may be considered "done" but that doesn't mean there's not work to be done. This release focused on major improvements to Wayland's documentation, minor improvements to the testsuite, and some scattered bugfixes to the code itself."

Comments (34 posted)

PulseAudio 6.0 available

Version 6.0 of the PulseAudio framework has been released. New is support for several Bluetooth audio profiles under BlueZ 5, socket activation using systemd, and improved support for multi-channel audio profiles.

Full Story (comments: none)

cmocka 1.0 available

Version 1.0 of the cmocka unit-testing framework has been released. Notably, the 1.0 release features a new test runner that allows tests to be grouped, although there are many other updates and improvements to be found.

Full Story (comments: none)

SystemTap 2.7 available

Version 2.7 of the SystemTap instrumentation system has been released. New in this release are several changes to the tracepoint probe behavior, speed-ups when passing string data to and from functions, and a great many changed tapsets and scripts. The new release also happens to coincide with SystemTap's 10th anniversary as a project.

Full Story (comments: none)

Newsletters and articles

Development newsletters from the past week

Comments (none posted)

Routing on OpenStreetMap.org

The OpenStreetMap blog announced the roll-out of point-to-point direction routing on the main OSM site. Historically, OSM has encouraged other developers to build this sort of functionality on top of the OSM data set, but has presented a limited interface on its own site. "But we have a saying: “what gets rendered, gets mapped” – meaning that often you don’t notice a bit of data that needs tweaking unless it actually shows up on the map image. Lots of things aren’t shown on our default rendering, so the feedback loop offers less incentive for people to get them correct. And that goes doubly for things that you never “see” on the map – subtle things like “no left turn” at a particular junction, or “busses only” access on a tiny bit of road, or tricky data issues like when a footpath doesn’t quite join a road that it should join on to. Now that people can see a recommended route directly on the OSM homepage, they have an incentive to quickly pop in and fix little issues like that. The end effect will be OSM’s data going up one more level in terms of its quality for routing."

Comments (none posted)

Page editor: Nathan Willis

Announcements

Articles of interest

Where do we stand 30 years after the founding of the Free Software Foundation? (Opensource.com)

Opensource.com has an interview with John Sullivan, Executive Director of FSF. "I stay involved because I think it's one of the most important social movements in existence, and it needs help—a lot of help. As more and more of the world's social, cultural, economic, and political interactions are mediated by technology, control over the technology becomes incredibly important for the exercise of any basic individual freedoms. I love the people I meet in this work, and the enormity of the challenge."

Comments (7 posted)

Calls for Presentations

CFP Deadlines: February 19, 2015 to April 20, 2015

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

DeadlineEvent Dates EventLocation
February 20 March 26 Enlightenment Developers Day North America Mountain View, CA, USA
February 20 May 13
May 15
GeeCON 2015 Cracow, Poland
February 24 April 24 Puppet Camp Berlin 2015 Berlin, Germany
February 28 May 19
May 21
SAMBA eXPerience 2015 Goettingen, Germany
February 28 July 15
July 19
Wikimania Conference Mexico City, Mexico
February 28 June 26
June 27
Hong Kong Open Source Conference 2015 Hong Kong, Hong Kong
March 1 April 24
April 25
Grazer Linuxtage Graz, Austria
March 1 April 17
April 19
Dni Wolnego Oprogramowania / The Open Source Days Bielsko-Biała, Poland
March 2 May 12
May 14
Protocols Plugfest Europe 2015 Zaragoza, Spain
March 6 May 8
May 10
Open Source Developers' Conference Nordic Oslo, Norway
March 7 June 23
June 26
Open Source Bridge Portland, Oregon, USA
March 9 June 26
June 28
FUDCon Pune 2015 Pune, India
March 15 May 7
May 9
Linuxwochen Wien 2015 Wien, Austria
March 15 May 16
May 17
MiniDebConf Bucharest 2015 Bucharest, Romania
March 31 July 25
July 31
Akademy 2015 A Coruña, Spain
March 31 May 4
May 5
CoreOS Fest San Francisco, CA, USA
April 3 May 2
May 3
Kolab Summit 2015 The Hague, Netherlands
April 4 May 30
May 31
Linuxwochen Linz 2015 Linz, Austria
April 6 May 20
May 22
SciPy Latin America 2015 Posadas, Misiones, Argentina
April 14 April 14
April 15
Palmetto Open Source Software Conference Columbia, SC, USA
April 15 June 12
June 14
Southeast Linux Fest Charlotte, NC, USA
April 17 June 11
June 12
infoShare 2015 Gdańsk, Poland

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

Upcoming Events

Events: February 19, 2015 to April 20, 2015

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

Date(s)EventLocation
February 18
February 20
Linux Foundation Collaboration Summit Santa Rosa, CA, USA
February 19
February 22
Southern California Linux Expo Los Angeles, CA, USA
March 1
March 6
Circumvention Tech Festival Valencia, Spain
March 9
March 10
Linux Storage, Filesystem, and Memory Management Summit Boston, MA, USA
March 9
March 12
FOSS4G North America San Francisco, CA, USA
March 11
March 12
Vault Linux Storage and Filesystems Conference Boston, MA, USA
March 11 Nordic PostgreSQL Day 2015 Copenhagen, Denmark
March 12
March 14
Studencki Festiwal Informatyczny / Academic IT Festival Cracow, Poland
March 13
March 15
FOSSASIA Singapore
March 13
March 15
GStreamer Hackfest 2015 London, UK
March 16
March 17
SREcon15 Santa Clara, CA, USA
March 17
March 19
OpenPOWER Summit San Jose, CA, USA
March 21
March 22
LibrePlanet 2015 Cambridge, MA, USA
March 21
March 22
Kansas Linux Fest Lawrence, Kansas, USA
March 23
March 25
Android Builders Summit San Jose, CA, USA
March 23
March 25
Embedded Linux Conference San Jose, CA, USA
March 24
March 26
FLOSSUK DevOps Conference York, UK
March 25
March 27
PGConf US 2015 New York City, NY, USA
March 26 Enlightenment Developers Day North America Mountain View, CA, USA
March 28
March 29
Journées du Logiciel Libre Lyon, France
April 9
April 12
Linux Audio Conference Mainz, Germany
April 10
April 12
PyCon North America 2015 Montreal, Canada
April 11
April 12
Lyon mini-DebConf 2015 Lyon, France
April 13
April 17
SEA Conference Boulder, CO, USA
April 13
April 17
ApacheCon North America Austin, TX, USA
April 13
April 14
AdaCamp Montreal Montreal, Quebec, Canada
April 13
April 14
2015 European LLVM Conference London, UK
April 14
April 15
Palmetto Open Source Software Conference Columbia, SC, USA
April 16
April 17
Global Conference on Cyberspace The Hague, Netherlands
April 17
April 19
Dni Wolnego Oprogramowania / The Open Source Days Bielsko-Biała, Poland

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