LWN.net Logo

Security

Talking Smack for Tizen security

By Nathan Willis
June 5, 2013
Tizen Dev Con 2013

At the 2013 Tizen Developer Conference (TDC) in San Francisco, several sessions dealt with the challenges of implementing security on mobile phones and other consumer electronics devices. Among the security sessions, Casey Schaufler and Michael Demeter described their work applying Smack to Tizen, including the effort required to develop a sensible set of security domains that are not too complicated to maintain.

Bringing the Smack down

Schaufler and Demeter presented a session that can only be described as part talk, part vaudeville act—complete with props, audience participation, and Three Stooges clips. They began with a brief overview of Smack itself, but quickly moved on to how it should be used; that is, how application developers should determine what sorts of Smack rules their code needs. They also discussed the difficulty of finding the right system-level policies for a platform like Tizen, and presented case studies comparing two approaches—including the one they officially adopted.

[Demeter and Schufler]

Smack implements mandatory access control, they explained, starting with the basic rule "what's mine is mine; what's yours is yours." That rule, of course, means that no processes can talk to each other, so working with Smack in practice is a matter of defining the right exceptions to that basic premise, which are known as Smack rules. Each Smack rule grants one "access mode" to an object to a particular outside party. To illustrate the key exceptions needed by applications, Schaufler and Demeter went through a series of Abbott and Costello–esque routines mimicking processes trying (usually unsuccessfully) to share data via a notebook, while arguing about what permissions were needed. They then pulled a volunteer from the audience on stage, and mimicked processes trying to exchange packets by tossing rubber balls from one side of the stage to the other.

For example, Schaufler would announce that he had write access to send a packet to the audience member on the other end of the stage, then throw the ball, at which point Demeter would shout "Smack!" and slap it to the crowd mid-flight, explaining that the audience member also needed read access in order for the packet to be delivered. With read and write permissions for files and network message-passing thus artfully explained, the two moved on to the problem of granularity in Smack rule sets, which they illustrated with an attempt to build a tower out of dice.

[Demeter lets a packet reach Schufler]

The issue is that the Smack identifiers used to distinguish "mine" and "yours" in Smack are simple text labels, and generally the identifier used is chosen to be the same as the name of the application's main process. In Tizen, they explained, installable HTML5 applications declare their Smack identifier in their .manifest file. The Tizen application installer is a privileged process, and sets up the Smack identifier when it installs the app. The manifest essentially allows each application to create its own unique Smack domain. But that approach quickly becomes unworkable because using a domain for every application means each application must specify Smack rules for every other application on the system—or, at least, the sheer number of Smack rules can grow that fast. Too many rules to manage means more mistakes, and more resources used up on the system.

However, Schaufler explained, there are about a dozen different definitions of what a "security domain" is, so trying to reduce the number of Smack rules by grouping applications and services into fewer domains is not trivial. They described a "case study" of an unnamed mobile OS that used the one-domain-per-app model (an approach which had previously been announced as the plan for Tizen). In that "naive" setup, just 600 applications generated more than 20,000 Smack rules. Furthermore, there were numerous rules in the rule set that were obviously bad (such as apps that wanted write access to the system clock). And, by and large, the huge corpus of rules simply sketched out an "everybody shares with everybody else" platform, which is functionally equivalent to not having the one-domain-per-app configuration, but is unmaintainable.

Less is more

Considering these results, eventually the Tizen security team decided to reducing the granularity of the Smack configuration problem as much as possible, primarily by putting all end-user apps into a single security domain—by default, though individual apps can still create a domain of their own if necessary.

The concept stratifies the system into three levels. The lowest is called the "floor" domain, which includes those filesystem locations that every process must have read access to: /, /dev/, /bin/sh, system libraries, and so on; read-only access is available to all applications. Above "floor" sits the "system" domain, which is reserved for system processes like systemd, D-Bus, and DNS, which need read/write access to platform resources. The "application" domain sits at level furthest from the floor; by default all apps belong to this domain and can exchange messages and files. It is possible that the team will add another domain specifically for telephony apps, they said, but they are being cautious about any such expansions. The three-tiered system still requires a set of Smack rules to define access to "system" domain items; there will just be fewer of them required.

Any application can still declare its own Smack domain, so those applications that need to protect data (such as a password storage app) can do so. The decision to lump all end-user apps into one domain shifts more of the responsibility for protecting the device onto the maintainers of the application store. Defining how any device vendor implements its store is out of scope for Tizen itself, although the project does discuss many of the angles in its documentation. The most common scenario is expected to be an app creating a domain of its own (and listing the access rules for other apps); related apps can share a single Smack domain, with reviewers at the vendor's application store testing submissions to find apps that ask for questionable access.

The upcoming Tizen 3.0 release will be the first implement the three-domain system, and will include a base set of Smack rules. The Tizen 2.1 release used much finer granularity; its rule set contains 41,000 access rules. At this point the focus is on making the default rule set "more correct," with "smaller" still to come, but it is already considerably smaller and easier to understand than the competition. Schaufler and Demeter said that while Tizen 2.1's Smack rule set contained 41,000 rules, the SELinux reference policy is over 900,000 lines.

[The author wishes to thank the Linux Foundation for travel assistance to Tizen Dev Con.]

Comments (21 posted)

Brief items

Security quotes of the week

One thing is pretty much certain, however. Passwords as we've traditionally known them are on the way out. They are doomed. The sooner we're rid of them, the better off we're all going to be.

Especially if your password is "12345" ...

Lauren Weinstein

There's another, more strategic reason why wholesale Internet disconnections are pretty unlikely in Turkey. Turkey's international telecommunications networks play a key role in interconnecting Syria, Iraq, Iran, Georgia, Azerbaijan, and the Gulf States to the greater Internet. Turkey's domestic Internet market is large, but the international market whose consumers could be reached by Turkish-hosted content is even larger. Turkey finds itself at a decision point today: take the necessary steps to encourage large content providers to host Middle Eastern content in Turkey, and reap the benefits of becoming the regional Internet hub, or let that opportunity pass.
Jim Cowie in the Renesys blog

Could Google tip an election by manipulating what comes up from search results on the candidates?

[...] Turns out that it could. And, it wouldn't even be illegal for Google to do it.

Bruce Schneier

To register their vote on-line, Parisians were supposed to make a credit-card payment of €3 and give the name and address of someone on the city's electoral roll. Metronews said that one of its journalists had managed to vote five times, paying with the same credit card, using names, including that of Nicolas Sarkozy.
The Independent

Comments (20 posted)

New vulnerabilities

kernel: code execution

Package(s):Linux kernel CVE #(s):CVE-2013-2850
Created:May 31, 2013 Updated:July 1, 2013
Description:

From the SUSE advisory:

CVE-2013-2850: Incorrect strncpy usage in the network listening part of the iscsi target driver could have been used by remote attackers to crash the kernel or execute code.

This required the iscsi target running on the machine and the attacker able to make a network connection to it (aka not filtered by firewalls).

Alerts:
SUSE SUSE-SU-2013:0845-1 2013-05-31
Ubuntu USN-1844-1 2013-05-30
Ubuntu USN-1845-1 2013-05-30
Ubuntu USN-1846-1 2013-05-30
Ubuntu USN-1847-1 2013-05-30
Fedora FEDORA-2013-10695 2013-06-13
openSUSE openSUSE-SU-2013:1005-1 2013-06-13
Ubuntu USN-1879-1 2013-06-14
Ubuntu USN-1882-1 2013-06-14
Ubuntu USN-1883-1 2013-06-14
openSUSE openSUSE-SU-2013:1043-1 2013-06-19
openSUSE openSUSE-SU-2013:1042-1 2013-06-19
openSUSE openSUSE-SU-2013:1045-1 2013-06-19
CentOS CESA-2013:0620 2013-06-21
Fedora FEDORA-2013-9123 2013-07-01
Mageia MGASA-2013-0203 2013-07-06
Mageia MGASA-2013-0204 2013-07-09
Mageia MGASA-2013-0210 2013-07-16
Mageia MGASA-2013-0214 2013-07-16
Mageia MGASA-2013-0211 2013-07-16
Mageia MGASA-2013-0215 2013-07-16
Mageia MGASA-2013-0209 2013-07-16
Mageia MGASA-2013-0213 2013-07-16
Mageia MGASA-2013-0212 2013-07-16
Mandriva MDVSA-2013:194 2013-07-11
Red Hat RHSA-2013:1264-01 2013-09-16

Comments (3 posted)

libtirpc: denial of service

Package(s):libtirpc CVE #(s):CVE-2013-1950
Created:May 31, 2013 Updated:June 5, 2013
Description:

From the Red Hat advisory:

A flaw was found in the way libtirpc decoded RPC requests. A specially-crafted RPC request could cause libtirpc to attempt to free a buffer provided by an application using the library, even when the buffer was not dynamically allocated. This could cause an application using libtirpc, such as rpcbind, to crash. (CVE-2013-1950)

Alerts:
Red Hat RHSA-2013:0884-01 2013-05-30
CentOS CESA-2013:0884 2013-05-30
Oracle ELSA-2013-0884 2013-05-30
Scientific Linux SL-libt-20130530 2013-05-30

Comments (none posted)

mesa: code execution

Package(s):mesa CVE #(s):CVE-2013-1872
Created:June 4, 2013 Updated:July 17, 2013
Description: From the Red Hat advisory:

An out-of-bounds access flaw was found in Mesa. If an application using Mesa exposed the Mesa API to untrusted inputs (Mozilla Firefox does this), an attacker could cause the application to crash or, potentially, execute arbitrary code with the privileges of the user running the application.

Alerts:
Red Hat RHSA-2013:0897-01 2013-06-03
Scientific Linux SL-mesa-20130603 2013-06-03
CentOS CESA-2013:0897 2013-06-03
Oracle ELSA-2013-0897 2013-06-03
Debian DSA-2704-1 2013-06-09
Ubuntu USN-1888-1 2013-06-20
Mageia MGASA-2013-0186 2013-06-26
Mageia MGASA-2013-0190 2013-06-26
Mandriva MDVSA-2013:182 2013-06-27
openSUSE openSUSE-SU-2013:1188-1 2013-07-12
SUSE SUSE-SU-2013:1175-1 2013-07-11

Comments (none posted)

nagios-plugins: should be built with PIE flags

Package(s):nagios-plugins CVE #(s):
Created:June 3, 2013 Updated:June 5, 2013
Description: From the Red Hat bugzilla:

http://fedoraproject.org/wiki/Packaging:Guidelines#PIE says that "you MUST enable the PIE compiler flags if your package has suid binaries...".

However, currently nagios-plugins is not being built with PIE flags. This is a clear violation of the packaging guidelines.

Alerts:
Fedora FEDORA-2013-8935 2013-06-01

Comments (none posted)

python-keystoneclient: PKI token expiration botch

Package(s):python-keystoneclient CVE #(s):CVE-2013-2104
Created:June 4, 2013 Updated:August 12, 2013
Description: From the Ubuntu advisory:

Eoghan Glynn and Alex Meade discovered that python-keystoneclient did not properly perform expiry checks for the PKI tokens used in Keystone. If Keystone were setup to use PKI tokens (the default in Ubuntu 13.04), a previously authenticated user could continue to use a PKI token for longer than intended.

Alerts:
Ubuntu USN-1851-1 2013-06-03
Red Hat RHSA-2013:0944-01 2013-06-12
Ubuntu USN-1875-1 2013-06-13
openSUSE openSUSE-SU-2013:1089-1 2013-06-27
Fedora FEDORA-2013-10713 2013-08-09
Fedora FEDORA-2013-14302 2013-08-15

Comments (none posted)

qemu-kvm: unauthorized file access

Package(s):qemu-kvm CVE #(s):CVE-2013-2007
Created:June 4, 2013 Updated:July 15, 2013
Description: From the CVE entry:

The qemu guest agent in Qemu 1.4.1 and earlier, as used by Xen, when started in daemon mode, uses weak permissions for certain files, which allows local users to read and write to these files.

Alerts:
Red Hat RHSA-2013:0896-01 2013-06-03
Scientific Linux SL-qemu-20130603 2013-06-03
CentOS CESA-2013:0896 2013-06-03
Oracle ELSA-2013-0896 2013-06-03
Mageia MGASA-2013-0169 2013-06-18
Fedora FEDORA-2013-11407 2013-07-01
openSUSE openSUSE-SU-2013:1202-1 2013-07-15
openSUSE openSUSE-SU-2013:1404-1 2013-09-04

Comments (none posted)

slock: should be built with PIE flags

Package(s):slock CVE #(s):
Created:June 5, 2013 Updated:June 5, 2013
Description: From the Red Hat bugzilla:

http://fedoraproject.org/wiki/Packaging:Guidelines#PIE says that "you MUST enable the PIE compiler flags if your package has suid binaries...".

However, currently slock is not being built with PIE flags. This is a clear violation of the packaging guidelines.

Alerts:
Fedora FEDORA-2013-9148 2013-06-04
Fedora FEDORA-2013-9170 2013-06-04

Comments (none posted)

telepathy-gabble: man-in-the-middle attack

Package(s):telepathy-gabble CVE #(s):CVE-2013-1431
Created:June 4, 2013 Updated:June 18, 2013
Description: From the Debian advisory:

Maksim Otstavnov discovered that the Wocky submodule used by telepathy-gabble, the Jabber/XMPP connection manager for the Telepathy framework, does not respect the tls-required flag on legacy Jabber servers. A network intermediary could use this vulnerability to bypass TLS verification and perform a man-in-the-middle attack.

Alerts:
Debian DSA-2702-1 2013-06-03
Fedora FEDORA-2013-9794 2013-06-09
Ubuntu USN-1873-1 2013-06-12
openSUSE openSUSE-SU-2013:1013-1 2013-06-14
Mageia MGASA-2013-0170 2013-06-18

Comments (none posted)

transifex-client: no HTTPS certificate validation

Package(s):transifex-client CVE #(s):CVE-2013-2073
Created:June 3, 2013 Updated:June 5, 2013
Description: From the Fedora advisory:

transifex-client does not validate HTTPS server certificate. Fixed in version 0.9.

Alerts:
Fedora FEDORA-2013-9119 2013-06-02
Fedora FEDORA-2013-9116 2013-06-02

Comments (none posted)

wireshark: multiple vulnerabilities

Package(s):wireshark CVE #(s):CVE-2013-3555 CVE-2013-3557 CVE-2013-3558 CVE-2013-3559 CVE-2013-3560 CVE-2013-3562
Created:June 3, 2013 Updated:September 30, 2013
Description: From the CVE entries:

epan/dissectors/packet-gtpv2.c in the GTPv2 dissector in Wireshark 1.8.x before 1.8.7 calls incorrect functions in certain contexts related to ciphers, which allows remote attackers to cause a denial of service (application crash) via a malformed packet. (CVE-2013-3555)

The dissect_ber_choice function in epan/dissectors/packet-ber.c in the ASN.1 BER dissector in Wireshark 1.6.x before 1.6.15 and 1.8.x before 1.8.7 does not properly initialize a certain variable, which allows remote attackers to cause a denial of service (application crash) via a malformed packet. (CVE-2013-3557)

The dissect_ccp_bsdcomp_opt function in epan/dissectors/packet-ppp.c in the PPP CCP dissector in Wireshark 1.8.x before 1.8.7 does not terminate a bit-field list, which allows remote attackers to cause a denial of service (application crash) via a malformed packet. (CVE-2013-3558)

epan/dissectors/packet-dcp-etsi.c in the DCP ETSI dissector in Wireshark 1.8.x before 1.8.7 uses incorrect integer data types, which allows remote attackers to cause a denial of service (integer overflow, and heap memory corruption or NULL pointer dereference, and application crash) via a malformed packet. (CVE-2013-3559)

The dissect_dsmcc_un_download function in epan/dissectors/packet-mpeg-dsmcc.c in the MPEG DSM-CC dissector in Wireshark 1.8.x before 1.8.7 uses an incorrect format string, which allows remote attackers to cause a denial of service (application crash) via a malformed packet. (CVE-2013-3560)

Multiple integer signedness errors in the tvb_unmasked function in epan/dissectors/packet-websocket.c in the Websocket dissector in Wireshark 1.8.x before 1.8.7 allow remote attackers to cause a denial of service (application crash) via a malformed packet. (CVE-2013-3562)

Alerts:
Debian DSA-2700-1 2013-06-02
Mageia MGASA-2013-0165 2013-06-06
Mageia MGASA-2013-0168 2013-06-06
Mandriva MDVSA-2013:172 2013-06-12
openSUSE openSUSE-SU-2013:1084-1 2013-06-26
openSUSE openSUSE-SU-2013:1086-1 2013-06-26
Gentoo 201308-05 2013-08-28
Gentoo GLSA 201308-05:02 2013-08-30
Fedora FEDORA-2013-17661 2013-09-28

Comments (none posted)

xmp: code execution

Package(s):xmp CVE #(s):CVE-2013-1980
Created:May 31, 2013 Updated:June 5, 2013
Description:

From the Red Hat bug report:

A heap-based buffer overflow flaw was found in the way xmp, the extended module player, a modplayer for Unix-like systems that plays over 90 mainstream and obscure module formats, loaded certain Music And Sound Interface (MASI) files. A remote attacker could provide a specially-crafted MASI media file that, when opened, would lead to xmp binary crash or, potentially, arbitrary code execution with the privileges of the user running the xmp executable.

Alerts:
Fedora FEDORA-2013-7144 2013-05-31
Fedora FEDORA-2013-7135 2013-05-31

Comments (none posted)

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

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