|
|
Subscribe / Log in / New account

Security

Checkpoint and restore for seccomp filters

By Jake Edge
September 30, 2015

The checkpoint/restore (C/R) feature of the kernel has had a long and twisty path—with several rewrites from scratch along the way—before finally getting merged in the form of C/R in user space (CRIU). There are still some kernel resources that cannot be handled by CRIU, though, including secure computing (seccomp) filters. A patch set from Tycho Andersen seeks to change that.

Seccomp filters are written using the Berkeley Packet Filter (BPF) language, which targets an in-kernel virtual machine—and which has increasingly outgrown its name. In any case, for seccomp filters to be saved and restored, there needs to be a way to provide information about them, and about the BPF programs attached to them, to user space. Some of that depends on figuring out how to determine "equality" between BPF programs (i.e. which programs have been inherited or copied from another).

As with other in-kernel BPF users, seccomp filters are converted to extended BPF (eBPF) internally. But there are plans to allow filters written in eBPF (rather than "classic" BPF) directly, which means that the eBPF verifier needs to be aware of a new type of program: BPF_PROG_TYPE_SECCOMP. So the first patch adds that type. Right now, seccomp filter programs cannot use some of the more advanced features of eBPF (notably maps), but that may eventually change. Meanwhile, BPF_PROG_TYPE_SECCOMP can be used to restrict the types of BPF programs that can be dumped, since the patches do not add support for maps, at least yet.

Next, the patches add a mechanism to actually dump an eBPF program, along with a bit of metadata (the GPL status of the program). The bpf() system call, using the new BPF_PROG_DUMP command, is used to accomplish that. The caller must provide a file descriptor for the program and a buffer of sufficient length to hold the instructions. The buffer is filled in; the number of (fixed-width) instructions and the GPL status of the program are returned as well.

But, how does one get a file descriptor for a BPF program? A sufficiently privileged program (i.e. has CAP_SYS_ADMIN) can call ptrace() on a process using the PTRACE_SECCOMP_GET_FILTER_FD command to get a file descriptor for the first seccomp filter attached. Subsequent filters can be accessed with PTRACE_SECCOMP_NEXT_FILTER and each can be dumped with bpf(BPF_PROG_DUMP, ...).

That just leaves one last piece of the puzzle: reading a seccomp filter program out of a file descriptor and attaching it to processes, which is needed for the restore operation. For that, Andersen has extended the seccomp() system call with a new operation: SECCOMP_MODE_FILTER_EBPF. In the patch set, that operation only handles a single new command, SECCOMP_EBPF_ADD_FD, but others will likely be added when seccomp filters can use more eBPF features. SECCOMP_EBPF_ADD_FD will add the filter associated with the file descriptor to the process's filter list.

It is all something of a complicated dance, but is similar in some ways to other CRIU save and restore dances. One unresolved issue is how to represent the hierarchy of filter programs, which can be inherited over fork() and clone() and shared in other ways. If that hierarchy is to be restored to the same state it had when a set of processes was checkpointed, some way to determine which programs are the same, thus are likely to have been inherited, needs to be provided. Restoring the hierarchy is needed so that changes to filter programs properly propagate throughout the hierarchy tree.

The kernel clearly knows which programs come from where as they get attached, but that information is not stored anywhere. An earlier version of the patch set added a "program ID" to the metadata that was dumped with the program, but there were complaints that it was leaking a kernel address into user space, which is a security hole. There was discussion about ways to either obfuscate the address or to maintain a simple counter for the ID, but Andersen dropped the ID from the second (and current) version of the patches.

Normally, kcmp() is used to determine if two kernel objects are the "same"; BPF maintainer Alexei Starovoitov believes that the KCMP_FILE comparison can be taught to do the right thing for BPF program file descriptors. But Andy Lutomirski would like to see the hierarchy be more explicit:

I think we want the actual hierarchy to be a well-defined thing, because I have plans to make the hierarchy actually do something. That means that we'll need to have a more exact way to dump the hierarchy than "these two filters are identical" or "these two filters are not identical".

Representing the hierarchy was further discussed by Andersen and Lutomirski in a thread on the second version of the patch set. Lutomirski's use case has requirements that are beyond those needed for C/R. It seems that tracking the parent of a seccomp filter and using kcmp() to determine equality may be sufficient for both needs, though.

Another round or two of patches would seem likely before this feature is ready to be merged—for one thing, man page changes are needed for bpf() and seccomp(). As seccomp filters get used by more programs, a way to save and restore them will certainly be needed. Further refinements, for more complicated eBPF programs with maps, for example, can be expected as well. While this patch set is targeted at seccomp filters, the more general eBPF dumping problem will eventually need to be addressed as well.

Comments (1 posted)

Brief items

Security quotes of the week

Now a separate team of researchers has constructed a new method for recovering the full private key used in a modern implementation of the widely used RSA crypto system. Like the 2009 work, the new research implements a CPU cache attack across two Amazon accounts that happen to be located on the same chip or chipset. They recently used their technique to allow one Amazon instance to recover the entire 2048-bit RSA key used by a separate instance, which they also happened to control. The newer technique works by probing the last level cache (LLC) of the Intel Xeon processor chipsets used by Amazon computers.
Dan Goodin in Ars Technica on a new side-channel attack

The Internet of Things is coming. Many industries are moving to add computers to their devices, and that will bring with it new opportunities for manufacturers to cheat. Light bulbs could fool regulators into appearing more energy efficient than they are. Temperature sensors could fool buyers into believing that food has been stored at safer temperatures than it has been. Voting machines could appear to work perfectly -- except during the first Tuesday of November, when it undetectably switches a few percent of votes from one party's candidates to another's.

My worry is that some corporate executives won't interpret the VW story as a cautionary tale involving just punishments for a bad mistake but will see it instead as a demonstration that you can get away with something like that for six years.

Bruce Schneier

Comments (17 posted)

New vulnerabilities

apport: privilege escalation

Package(s):apport CVE #(s):CVE-2015-1338
Created:September 24, 2015 Updated:September 30, 2015
Description: From the Ubuntu advisory:

Halfdog discovered that Apport incorrectly handled kernel crash dump files. A local attacker could use this issue to cause a denial of service, or possibly elevate privileges. The default symlink protections for affected releases should reduce the vulnerability to a denial of service.

Alerts:
Ubuntu USN-2744-1 apport 2015-09-24

Comments (none posted)

cacti: cross-site scripting

Package(s):cacti CVE #(s):CVE-2015-2967
Created:September 25, 2015 Updated:September 30, 2015
Description:

From the CVE entry:

Cross-site scripting (XSS) vulnerability in settings.php in Cacti before 0.8.8d allows remote attackers to inject arbitrary web script or HTML via unspecified vectors.

Alerts:
Gentoo 201509-03 cacti 2015-09-24

Comments (none posted)

chromium: information disclosure

Package(s):chromium CVE #(s):CVE-2015-1303 CVE-2015-1304
Created:September 28, 2015 Updated:November 2, 2015
Description: From the Arch Linux advisory:

- CVE-2015-1303:

Cross-origin bypass in DOM. Credit to Mariusz Mlynski.

- CVE-2015-1304:

Cross-origin bypass in V8. Credit to Mariusz Mlynski.

A remote attacker can bypass the cross-origin resource sharing policy, thus getting access to sensitive data.

Alerts:
Gentoo 201603-09 chromium 2016-03-12
openSUSE openSUSE-SU-2015:1876-1 Chromium 2015-11-02
Debian DSA-3376-1 chromium-browser 2015-10-20
openSUSE openSUSE-SU-2015:1719-1 Chromium 2015-10-11
Ubuntu USN-2757-1 oxide-qt 2015-10-05
Mageia MGASA-2015-0389 chromium-browser 2015-10-03
Red Hat RHSA-2015:1841-01 chromium-browser 2015-09-29
Arch Linux ASA-201509-11 chromium 2015-09-28

Comments (none posted)

cyrus-imapd: largely unspecified

Package(s):cyrus-imapd CVE #(s):CVE-2015-8076
Created:September 24, 2015 Updated:November 23, 2015
Description: From the openSUSE advisory:

Security fix: handle urlfetch range starting outside message range

See the Cyrus IMAP 2.4.18 Release Notes for additional information.

Alerts:
SUSE SUSE-SU-2016:1459-1 cyrus-imapd 2016-06-01
SUSE SUSE-SU-2016:1457-1 cyrus-imapd 2016-05-31
Fedora FEDORA-2015-d292a98f01 cyrus-imapd 2015-11-20
Fedora FEDORA-2015-8d4b507cb0 cyrus-imapd 2015-11-17
Fedora FEDORA-2015-e7712d6c32 cyrus-imapd 2015-11-17
Mageia MGASA-2015-0401 cyrus-imapd 2015-10-15
openSUSE openSUSE-SU-2015:1623-1 cyrus-imapd 2015-09-24
openSUSE openSUSE-SU-2015:1622-1 cyrus-imapd 2015-09-24

Comments (none posted)

libemail-address-perl: denial of service

Package(s):libemail-address-perl CVE #(s):CVE-2015-7686
Created:September 30, 2015 Updated:November 28, 2016
Description: From the Debian LTS advisory:

Pali Rohár discovered a possible DoS attack in any software which uses the Email::Address Perl module for parsing string input to a list of email addresses.

By default Email::Address module, version v1.907 (and all before) tries to understand nestable comments in an input string with depth level 2.

With specially crafted inputs, parsing nestable comments can become too slow and can cause high CPU load, freeze the application and end in Denial of Service.

Because input strings for Email::Address module come from external sources (e.g. from email sent by an attacker) it is a security problem impacting on all software applications which parse email messages using the Email::Address Perl module.

With this upload of libemail-address-perl, the default value of nestable comments has been set to depth level 1 (as proposed by upstream). Please note that this is not proper a fix, just a workaround for pathological inputs with nestable comments.

Alerts:
Mageia MGASA-2016-0397 perl-Email-Address 2016-11-25
Debian-LTS DLA-320-1 libemail-address-perl 2015-09-30

Comments (none posted)

lxc: apparmor policy bypass

Package(s):lxc CVE #(s):CVE-2015-1335
Created:September 30, 2015 Updated:November 12, 2015
Description: From the LXC mailing list:

When a container starts up, lxc sets up the container's initial fstree by doing a bunch of mounting, guided by the container configuration file. The container config is owned by the admin or user on the host, so we do not try to guard against bad entries. However, since the mount target is in the container, it's possible that the container admin could divert the mount with symbolic links. This could bypass proper container startup (i.e. confinement of a root-owned container by the restrictive apparmor policy, by diverting the required write to /proc/self/attr/current), or bypass the (path-based) apparmor policy by diverting, say, /proc to /mnt in the container.

Alerts:
Mageia MGASA-2016-0036 lxc 2016-01-29
Debian-LTS DLA-442-1 lxc 2016-02-29
Debian DSA-3400-1 lxc 2015-11-19
Fedora FEDORA-2015-211974138f lxc 2015-11-12
Fedora FEDORA-2015-ebfe46536f lxc 2015-11-12
Oracle ELSA-2015-3087 lxc 2015-10-16
Oracle ELSA-2015-3087 lxc 2015-10-16
openSUSE openSUSE-SU-2015:1717-1 lxc 2015-10-10
Ubuntu USN-2753-3 lxc 2015-10-05
Ubuntu USN-2753-2 lxc 2015-09-30
Ubuntu USN-2753-1 lxc 2015-09-29

Comments (none posted)

moodle: multiple vulnerabilities

Package(s):moodle CVE #(s):CVE-2015-5264 CVE-2015-5265 CVE-2015-5266 CVE-2015-5267 CVE-2015-5268 CVE-2015-5269
Created:September 24, 2015 Updated:September 30, 2015
Description: From the Mageia advisory:

In Moodle before 2.8.8, completed and graded lesson activity was not protected against making new attempts to answer some questions, so students could re-attempt answering questions in the lesson (CVE-2015-5264).

In Moodle before 2.8.8, users could delete files uploaded by other users in wiki (CVE-2015-5265).

In Moodle before 2.8.8, meta course synchronisation enrols suspended students as managers for a short period of time and causes large database growth. On large installations, when the sync script takes a long time, suspended students may get assigned a manager role in meta course for several minutes (CVE-2015-5266)

In Moodle before 2.8.8, password recovery tokens can be guessed because of php randomisation limitations (CVE-2015-5267).

In Moodle before 2.8.8, when viewing ratings, the group access was not properly checked, allowing users from other groups to view ratings (CVE-2015-5268).

In Moodle before 2.8.8, capability to manage groups does not have XSS risk, however it was possible to add XSS to the grouping description (CVE-2015-5269).

Alerts:
Fedora FEDORA-2015-2ebdd4ad8f moodle 2015-12-12
Fedora FEDORA-2015-98fc0d20ad moodle 2015-12-11
Mageia MGASA-2015-0381 moodle 2015-09-23

Comments (none posted)

NVIDIA graphics drivers: privilege escalation

Package(s):NVIDIA graphics drivers CVE #(s):CVE-2015-5950
Created:September 28, 2015 Updated:October 26, 2015
Description: From the Ubuntu advisory:

Dario Weisser discovered that the NVIDIA graphics drivers incorrectly handled certain IOCTL writes. A local attacker could use this issue to possibly gain root privileges.

Alerts:
Mageia MGASA-2015-0407 nvidia-driver 2015-10-25
Ubuntu USN-2747-1 NVIDIA graphics drivers 2015-09-28

Comments (none posted)

php5: multiple vulnerabilities

Package(s):php5 CVE #(s):CVE-2015-6831 CVE-2015-6832 CVE-2015-6833
Created:September 25, 2015 Updated:September 30, 2015
Description:

From the SUSE advisory:

CVE-2015-6831 - A use after free vulnerability in unserialize() has been fixed which could be used to crash php or potentially execute code.

CVE-2015-6832 - A dangling pointer in the unserialization of ArrayObject items could be used to crash php or potentially execute code.

CVE-2015-6833 - A directory traversal when extracting ZIP files could be used to overwrite files outside of intended area.

Alerts:
SUSE SUSE-SU-2016:1638-1 php53 2016-06-21
Gentoo 201606-10 php 2016-06-19
Red Hat RHSA-2016:0457-01 rh-php56-php 2016-03-15
Debian-LTS DLA-341-1 php5 2015-11-08
SUSE SUSE-SU-2015:1818-1 php53 2015-10-26
Ubuntu USN-2758-1 php5 2015-09-30
Mageia MGASA-2015-0318 php 2015-08-21
SUSE SUSE-SU-2015:1633-1 php5 2015-09-25
openSUSE openSUSE-SU-2015:1628-1 php5 2015-09-25

Comments (none posted)

php-ZendFramework2: code execution

Package(s):php-ZendFramework2 CVE #(s):
Created:September 25, 2015 Updated:September 30, 2015
Description:

From the Fedora advisory:

ZF2015-07: The filesystem storage adapter of Zend\Cache was creating directories with a liberal umask that could lead to local arbitrary code execution and/or local privilege escalation.

Alerts:
Fedora FEDORA-2015-16032 php-ZendFramework2 2015-09-25
Fedora FEDORA-2015-16034 php-ZendFramework2 2015-09-25

Comments (none posted)

pixman: buffer overflow

Package(s):pixman CVE #(s):
Created:September 28, 2015 Updated:December 13, 2016
Description: From the X.org advisory:

A new pixman release 0.32.8 is now available. This is a stable release that contains an important bug fix (buffer overflow), which can affect 32-bit systems.

Alerts:
Gentoo 201612-37 pixman 2016-12-13
Fedora FEDORA-2015-71973a6d71 pixman 2015-10-26
Fedora FEDORA-2015-00131 pixman 2015-10-05
Mageia MGASA-2015-0385 pixman 2015-09-25

Comments (none posted)

rolekit: information leak

Package(s):rolekit CVE #(s):
Created:September 28, 2015 Updated:September 30, 2015
Description: From the Fedora advisory:

rolekit-0.3.2-2.fc22 - Fix permissions on role JSON settings files to avoid leaking sensitive info

Alerts:
Fedora FEDORA-2015-15001 rolekit 2015-09-27

Comments (none posted)

shutter: code execution

Package(s):shutter CVE #(s):CVE-2015-0854
Created:September 24, 2015 Updated:January 2, 2017
Description: From the Mageia advisory:

In the "Shutter" screenshot application, it was discovered that using the "Show in folder" menu option while viewing a file with a specially-crafted path allows for arbitrary code execution with the permissions of the user running Shutter (CVE-2015-0854).

Alerts:
Arch Linux ASA-201611-13 shutter 2016-11-14
Debian-LTS DLA-769-1 shutter 2016-12-30
Mageia MGASA-2015-0380 shutter 2015-09-23

Comments (none posted)

simplestreams: denial of service

Package(s):simplestreams CVE #(s):CVE-2015-1337
Created:September 25, 2015 Updated:September 30, 2015
Description:

From the Ubuntu advisory:

It was discovered that Simple Streams did not properly perform gpg verification in some situations. A remote attacker could use this to perform a man-in-the-middle attack and inject malicious content into the stream.

Alerts:
Ubuntu USN-2746-2 simplestreams 2015-09-25
Ubuntu USN-2746-1 simplestreams 2015-09-24

Comments (none posted)

unity-firefox-extension, webapps-greasemonkey, webaccounts-browser-extension: denial of service

Package(s):unity-firefox-extension, webapps-greasemonkey, webaccounts-browser-extension CVE #(s):
Created:September 25, 2015 Updated:September 30, 2015
Description:

From the Ubuntu advisory:

Future Firefox updates will require all addons be signed and unity-firefox-extension, webapps-greasemonkey and webaccounts-browser-extension will not go through the signing process. Because these addons currently break search engine installations, this update permanently disables the addons by removing them from the system.

Alerts:
Ubuntu USN-2743-3 unity-firefox-extension, webapps-greasemonkey, webaccounts-browser-extension 2015-09-24

Comments (none posted)

virtualbox-ose: multiple vulnerabilities

Package(s):virtualbox-ose CVE #(s):CVE-2014-2486 CVE-2014-2488 CVE-2014-2489
Created:September 29, 2015 Updated:September 30, 2015
Description: From the CVE entries:

Unspecified vulnerability in the Oracle VM VirtualBox component in Oracle Virtualization VirtualBox before 3.2.24, 4.0.26, 4.1.34, 4.2.26, and 4.3.12 allows local users to affect integrity and availability via unknown vectors related to Core. (CVE-2014-2486)

Unspecified vulnerability in the Oracle VM VirtualBox component in Oracle Virtualization VirtualBox before 3.2.24, 4.0.26, 4.1.34, 4.2.26, and 4.3.12 allows local users to affect confidentiality via unknown vectors related to Core. (CVE-2014-2488)

Unspecified vulnerability in the Oracle VM VirtualBox component in Oracle Virtualization VirtualBox before 3.2.24, 4.0.26, 4.1.34, 4.2.26, and 4.3.12 allows local users to affect confidentiality, integrity, and availability via unknown vectors related to Core. (CVE-2014-2489)

Alerts:
Debian-LTS DLA-313-1 virtualbox-ose 2015-09-29

Comments (none posted)

wireshark: multiple vulnerabilities

Package(s):wireshark CVE #(s):CVE-2015-6241 CVE-2015-6242 CVE-2015-6243 CVE-2015-6244 CVE-2015-6245 CVE-2015-6246 CVE-2015-6247 CVE-2015-6248 CVE-2015-6249
Created:September 25, 2015 Updated:October 7, 2015
Description:

From the CVE entries:

CVE-2015-6241 - The proto_tree_add_bytes_item function in epan/proto.c in the protocol-tree implementation in Wireshark 1.12.x before 1.12.7 does not properly terminate a data structure after a failure to locate a number within a string, which allows remote attackers to cause a denial of service (application crash) via a crafted packet.

CVE-2015-6242 - The wmem_block_split_free_chunk function in epan/wmem/wmem_allocator_block.c in the wmem block allocator in the memory manager in Wireshark 1.12.x before 1.12.7 does not properly consider a certain case of multiple realloc operations that restore a memory chunk to its original size, which allows remote attackers to cause a denial of service (incorrect free operation and application crash) via a crafted packet.

CVE-2015-6243 - The dissector-table implementation in epan/packet.c in Wireshark 1.12.x before 1.12.7 mishandles table searches for empty strings, which allows remote attackers to cause a denial of service (application crash) via a crafted packet, related to the (1) dissector_get_string_handle and (2) dissector_get_default_string_handle functions.

CVE-2015-6244 - The dissect_zbee_secure function in epan/dissectors/packet-zbee-security.c in the ZigBee dissector in Wireshark 1.12.x before 1.12.7 improperly relies on length fields contained in packet data, which allows remote attackers to cause a denial of service (application crash) via a crafted packet.

CVE-2015-6245 - epan/dissectors/packet-gsm_rlcmac.c in the GSM RLC/MAC dissector in Wireshark 1.12.x before 1.12.7 uses incorrect integer data types, which allows remote attackers to cause a denial of service (infinite loop) via a crafted packet.

CVE-2015-6246 - The dissect_wa_payload function in epan/dissectors/packet-waveagent.c in the WaveAgent dissector in Wireshark 1.12.x before 1.12.7 mishandles large tag values, which allows remote attackers to cause a denial of service (application crash) via a crafted packet.

CVE-2015-6247 - The dissect_openflow_tablemod_v5 function in epan/dissectors/packet-openflow_v5.c in the OpenFlow dissector in Wireshark 1.12.x before 1.12.7 does not validate a certain offset value, which allows remote attackers to cause a denial of service (infinite loop) via a crafted packet.

CVE-2015-6248 - The ptvcursor_add function in the ptvcursor implementation in epan/proto.c in Wireshark 1.12.x before 1.12.7 does not check whether the expected amount of data is available, which allows remote attackers to cause a denial of service (application crash) via a crafted packet.

CVE-2015-6249 - The dissect_wccp2r1_address_table_info function in epan/dissectors/packet-wccp.c in the WCCP dissector in Wireshark 1.12.x before 1.12.7 does not prevent the conflicting use of a table for both IPv4 and IPv6 addresses, which allows remote attackers to cause a denial of service (application crash) via a crafted packet.

Alerts:
Scientific Linux SLSA-2015:2393-1 wireshark 2015-12-21
Debian-LTS DLA-497-1 wireshark 2016-05-31
Oracle ELSA-2015-2393 wireshark 2015-11-23
Red Hat RHSA-2015:2393-01 wireshark 2015-11-19
openSUSE openSUSE-SU-2015:1836-2 wireshark 2015-10-29
openSUSE openSUSE-SU-2015:1836-1 wireshark 2015-10-28
Fedora FEDORA-2015-13945 wireshark 2015-10-07
Mageia MGASA-2015-0323 wireshark 2015-08-25
openSUSE openSUSE-SU-2015:1428-1 wireshark 2015-08-24
Debian DSA-3367-1 wireshark 2015-09-24

Comments (none posted)

xpra: information disclosure

Package(s):xpra CVE #(s):
Created:September 28, 2015 Updated:September 30, 2015
Description: From the Fedora advisory:

This update fixes a critical bug with the Xdummy setup which allows local users to access the virtual display used for the xpra sessions. xpra-0.15.6-1.fc21 - Update to 0.15.6 xpra-0.15.6-1.fc22 - Update to 0.15.6 xpra-0.15.6-1.fc23 - Update to 0.15.6

Alerts:
Fedora FEDORA-2015-16024 xpra 2015-09-26
Fedora FEDORA-2015-16023 xpra 2015-09-27

Comments (none posted)

Page editor: Jake Edge
Next page: Kernel development>>


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