|
|
Log in / Subscribe / Register

Security

A kernel security hole

By Jake Edge
January 16, 2008

Security holes can sneak into code in surprising ways, even in highly scrutinized codebases. Perhaps even more surprising is how long they can persist in something as popular as the Linux kernel before someone notices. The release of stable kernels 2.6.22.16 and 2.6.23.14 this week are instructive for both of those reasons.

The bug that led to the releases is fixed by a two line patch, but might be exploitable to cause filesystem corruption. If it were a bug in a driver for an obscure piece of hardware, with relatively few users, it might have been less eye opening, but it was in the Virtual File System (VFS) layer of the kernel. VFS is the abstraction that allows all kernel filesystems to be used identically regardless of their underlying implementation. The open() system call is used to open any file on any type of filesystem; VFS is what makes that work.

In fact it is the open() path that is affected by the bug. Due to a faulty test, the bug allows directories to be opened for writing, which is generally a recipe for disaster. It could also allow a file on a read-only filesystem to be opened for writing – depending on the underlying filesystem implementation, that could lead to corruption. In both cases, they are only locally exploitable.

The bug was introduced in a change to support NFS in October of 2005 – more than two years ago; all kernels since 2.6.15 are affected. The change was aimed at making NFSv4 open calls be atomic (because an open is really a lookup followed by an open), but also did some code reorganization that changed the semantics of a flag variable. That variable was being used to determine the access mode for directories and read-only filesystems, so that change subtly broke the tests.

Part of the problem is that the tests are in a function called may_open(), which takes two flag parameters:

    int may_open(struct nameidata *nd, int acc_mode, int flag)
The incorrect code was using flag in the tests when it should have been using acc_mode. Each of them is a bitmask of values that, on first glance, might be easy to confuse – each is related to permissions. The bit values for each have names like FMODE_WRITE and MAY_WRITE, which would seem to have a fair amount of overlap. This may explain why the problem was not spotted at the time it was introduced.

There may be no easy solution to this kind of problem – other than more scrutiny. Using different types, rather than plain int, for each flag might have helped, but since the tests were using the right kind of bit values for flag, that is a somewhat hard sell.

Something unpleasant to consider in all of this is that this may not be the first time this problem has been noticed. It may just have been the first time it was noticed by someone who reported it. Folks with a malicious intent are much less inclined to report bugs. This particular bug is not one that would be particularly useful to attackers, but we would do well to remember that fixing a two year old hole means that systems were vulnerable for all that time. It is not only the good guys who can read code.

Comments (26 posted)

New vulnerabilities

apache: several vulnerabilities

Package(s):apache CVE #(s):CVE-2007-5000 CVE-2007-6388 CVE-2008-0005
Created:January 15, 2008 Updated:July 29, 2008
Description: A flaw was found in the mod_imap module. On sites where mod_imap was enabled and an imagemap file was publicly available, a cross-site scripting attack was possible. (CVE-2007-5000)

A flaw was found in the mod_status module. On sites where mod_status was enabled and the status pages were publicly available, a cross-site scripting attack was possible. (CVE-2007-6388)

A flaw was found in the mod_proxy_ftp module. On sites where mod_proxy_ftp was enabled and a forward proxy was configured, a cross-site scripting attack was possible against Web browsers which did not correctly derive the response character set following the rules in RFC 2616. (CVE-2008-0005)

Alerts:
Slackware SSA:2008-210-02 httpd 2008-07-29
rPath rPSA-2008-0035-1 httpd 2008-07-16
SuSE SUSE-SA:2008:021 apache2,apache 2008-04-04
Fedora FEDORA-2008-1711 httpd 2008-02-15
Gentoo 200803-19 apache 2008-03-11
Fedora FEDORA-2008-1695 httpd 2008-02-15
Slackware SSA:2008-045-02 apache 2008-02-15
Slackware SSA:2008-045-01 httpd 2008-02-15
Ubuntu USN-575-1 apache2 2008-02-04
Red Hat RHSA-2008:0009-01 httpd 2008-01-21
Mandriva MDVSA-2008:016 apache 2007-01-16
Mandriva MDVSA-2008:015 apache 2008-01-16
Mandriva MDVSA-2008:014 apache 2008-01-16
Red Hat RHSA-2008:0008-01 httpd 2008-01-15
Red Hat RHSA-2008:0007-01 httpd 2008-01-15
Red Hat RHSA-2008:0006-01 httpd 2008-01-15
Red Hat RHSA-2008:0005-01 httpd 2008-01-15
Red Hat RHSA-2008:0004-01 apache 2008-01-15

Comments (1 posted)

claws-mail: insecure temp file

Package(s):claws-mail CVE #(s):CVE-2007-6208
Created:January 10, 2008 Updated:January 16, 2008
Description: Claws Mail creates temp files in an insecure manner. This can be used by a local attacker to make a symlink attack, allowing files with the local user's privileges to be overwritten.
Alerts:
Gentoo 200801-03 claws-mail 2008-01-09

Comments (none posted)

drupal: multiple vulnerabilities

Package(s):drupal CVE #(s):
Created:January 14, 2008 Updated:January 16, 2008
Description:

From the Fedora advisory:

Update to 5.6, security fixes:

DRUPAL-SA-2008-005
DRUPAL-SA-2008-006
DRUPAL-SA-2008-007
see http://drupal.org/security for more information.
Alerts:
Fedora FEDORA-2008-0469 drupal 2008-01-11
Fedora FEDORA-2008-0485 drupal 2008-01-11

Comments (none posted)

fail2ban: denial of service

Package(s):fail2ban CVE #(s):CVE-2007-4321
Created:January 10, 2008 Updated:January 16, 2008
Description: From the Debian alert: Daniel B. Cid discovered that fail2ban, a tool to block IP addresses that cause login failures, is too liberal about parsing SSH log files, allowing an attacker to block any IP address.
Alerts:
Debian DSA-1456-1 fail2ban 2008-01-09

Comments (none posted)

gforge: SQL injection

Package(s):gforge CVE #(s):CVE-2008-0173
Created:January 14, 2008 Updated:January 16, 2008
Description:

From the Debian advisory:

It was discovered that Gforge, a collaborative development tool, did not properly sanitise some CGI parameters, allowing SQL injection in scripts related to RSS exports.

Alerts:
Debian DSA-1459-1 gforge 2008-01-13

Comments (none posted)

httpd: cross-site scripting, denial of service

Package(s):httpd CVE #(s):CVE-2007-6421 CVE-2007-6422
Created:January 15, 2008 Updated:April 4, 2008
Description: A flaw was found in the mod_proxy_balancer module. On sites where mod_proxy_balancer was enabled, a cross-site scripting attack against an authorized user was possible. (CVE-2007-6421)

A flaw was found in the mod_proxy_balancer module. On sites where mod_proxy_balancer was enabled, an authorized user could send a carefully crafted request that would cause the Apache child process handling that request to crash. This could lead to a denial of service if using a threaded Multi-Processing Module. (CVE-2007-6422)

Alerts:
SuSE SUSE-SA:2008:021 apache2,apache 2008-04-04
Gentoo 200803-19 apache 2008-03-11
Fedora FEDORA-2008-1695 httpd 2008-02-15
Fedora FEDORA-2008-1711 httpd 2008-02-15
Slackware SSA:2008-045-01 httpd 2008-02-15
Ubuntu USN-575-1 apache2 2008-02-04
Red Hat RHSA-2008:0009-01 httpd 2008-01-21
Red Hat RHSA-2008:0008-01 httpd 2008-01-15

Comments (1 posted)

kernel: denial of service vulnerabilities

Package(s):kernel CVE #(s):CVE-2007-4133 CVE-2007-5093
Created:January 12, 2008 Updated:November 20, 2008
Description: The (1) hugetlb_vmtruncate_list and (2) hugetlb_vmtruncate functions in fs/hugetlbfs/inode.c in the Linux kernel before 2.6.19-rc4 perform certain prio_tree calculations using HPAGE_SIZE instead of PAGE_SIZE units, which allows local users to cause a denial of service (panic) via unspecified vectors.

The disconnect method in the Philips USB Webcam (pwc) driver in Linux kernel 2.6.x before 2.6.22.6 relies on user space to close the device, which allows user-assisted local attackers to cause a denial of service (USB subsystem hang and CPU consumption in khubd) by not closing the device after the disconnect is invoked. NOTE: this rarely crosses privilege boundaries, unless the attacker can convince the victim to unplug the affected device.

Alerts:
CentOS CESA-2008:0972 kernel 2008-11-20
Red Hat RHSA-2008:0972-01 kernel 2008-11-19
CentOS CESA-2008:0275 kernel 2008-05-21
Mandriva MDVSA-2008:105 kernel 2007-05-21
Red Hat RHSA-2008:0275-01 kernel 2008-05-20
Debian DSA-1504 kernel-source-2.6.8 2008-02-22
Debian DSA-1503-2 kernel-source-2.4.27 2008-03-06
Debian DSA-1503 kernel-source-2.4.27 2008-02-22
Ubuntu USN-578-1 linux-source-2.6.15 2008-02-14
Ubuntu USN-574-1 linux-source-2.6.17/20/22 2008-02-04
Mandriva MDVSA-2008:008 kernel 2008-01-11

Comments (none posted)

libxml2: denial of service

Package(s):libxml2 CVE #(s):CVE-2007-6284
Created:January 11, 2008 Updated:January 31, 2008
Description: A denial of service flaw was found in the way libxml2 processes certain content. If an application linked against libxml2 processes malformed XML content, it could cause the application to stop responding.
Alerts:
Gentoo 200801-20 libxml2 2008-01-30
SuSE SUSE-SR:2008:002 tog-pegasus, xine, libxml2, libqt4, XFree86/X.Org, krb5, libexif, openafs, Apache, MozillaThunderbird, Xen 2008-01-25
rPath rPSA-2008-0017-1 libxml2 2008-01-15
Ubuntu USN-569-1 libxml2 2008-01-14
Debian DSA-1461-1 libxml2 2008-01-13
Mandriva MDVSA-2008:010 libxml2 2007-01-11
Fedora FEDORA-2008-0477 libxml2 2008-01-11
Fedora FEDORA-2008-0462 libxml2 2008-01-11
Red Hat RHSA-2008:0032-01 libxml2 2008-01-11

Comments (none posted)

moodle: cross-site scripting

Package(s):moodle CVE #(s):CVE-2008-0123
Created:January 16, 2008 Updated:November 12, 2008
Description: Moodle suffers from a cross-site scripting vulnerability which is only open during the install process.
Alerts:
Fedora FEDORA-2008-9502 moodle 2008-11-08
SuSE SUSE-SR:2008:003 java, nss_ldap, cairo, geronimo, moodle, SDL_image, python, mysql, nx, xemacs 2008-02-07
Fedora FEDORA-2008-0627 moodle 2008-01-15

Comments (none posted)

openafs: denial of service

Package(s):openafs CVE #(s):CVE-2007-6599
Created:January 10, 2008 Updated:January 25, 2008
Description: From the Gentoo advisory: Russ Allbery, Jeffrey Altman, Dan Hyde and Thomas Mueller discovered a race condition due to an improper handling of the clients callbacks lists. A remote attacker could construct cases which trigger the race condition, resulting in a server crash.
Alerts:
SuSE SUSE-SR:2008:002 tog-pegasus, xine, libxml2, libqt4, XFree86/X.Org, krb5, libexif, openafs, Apache, MozillaThunderbird, Xen 2008-01-25
Debian DSA-1458-1 openafs 2008-01-10
Gentoo 200801-04 openafs 2008-01-09

Comments (none posted)

paramiko: insecure random pool usage

Package(s):paramiko CVE #(s):CVE-2008-0299
Created:January 16, 2008 Updated:March 4, 2008
Description: Programs which keep more than one paramiko connection open may leak random pool information.
Alerts:
Gentoo 200803-07 paramiko 2008-03-03
Fedora FEDORA-2008-0644 python-paramiko 2008-01-15
Fedora FEDORA-2008-0722 python-paramiko 2008-01-15

Comments (none posted)

R: buffer overflows

Package(s):R CVE #(s):
Created:January 10, 2008 Updated:January 16, 2008
Description: The R language has a copy of PCRE, that has a number of buffer overflow and memory corruption vulnerabilities. If an attacker creates specially crafted regular expressions, it may be possible to create a denial of service, execute arbitrary code or disclose unauthorized information.
Alerts:
Gentoo 200801-02:02 R 2008-01-09

Comments (none posted)

xfce4: multiple vulnerabilities

Package(s):xfce4 CVE #(s):CVE-2007-6531 CVE-2007-6532
Created:January 10, 2008 Updated:January 16, 2008
Description: From the Gentoo alert: Gregory Andersen reported that the Xfce4 panel does not correctly calculate memory boundaries, leading to a stack-based buffer overflow in the launcher_update_panel_entry() function (CVE-2007-6531). Daichi Kawahata reported libxfcegui4 did not copy provided values when creating "SessionClient" structs, possibly leading to access of freed memory areas (CVE-2007-6532).
Alerts:
Gentoo 200801-06:02 xfce4-panel 2008-01-09

Comments (none posted)

xine-lib: buffer overflow

Package(s):xine-lib CVE #(s):CVE-2008-0225
Created:January 16, 2008 Updated:August 7, 2008
Description: xine-lib contains a buffer overflow which could be exploited (via a specially-crafted stream) to execute arbitrary code; see this advisory for more information.
Alerts:
Ubuntu USN-635-1 xine-lib 2008-08-06
Mandriva MDVSA-2008:045 mplayer 2007-02-14
Gentoo 200801-12 xine-lib 2008-01-27
SuSE SUSE-SR:2008:002 tog-pegasus, xine, libxml2, libqt4, XFree86/X.Org, krb5, libexif, openafs, Apache, MozillaThunderbird, Xen 2008-01-25
Mandriva MDVSA-2008:020 xine-lib 2007-01-22
Debian DSA-1472-1 xine-lib 2008-01-21
Fedora FEDORA-2008-0718 xine-lib 2008-01-15

Comments (none posted)

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


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