what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

iDEFENSE Security Advisory 2007-09-25.1

iDEFENSE Security Advisory 2007-09-25.1
Posted Sep 26, 2007
Authored by iDefense Labs, mu-b | Site idefense.com

iDefense Security Advisory 09.25.07 - Local exploitation of an information disclosure vulnerability within the ALSA driver included in the Linux Kernel allows attackers to obtain sensitive information from kernel memory. iDefense has confirmed the existence of this vulnerability in version 2.6.22.1 of the Linux Kernel as installed with Fedora CORE 7. It is suspected that other versions are also vulnerable.

tags | advisory, kernel, local, info disclosure
systems | linux, fedora
advisories | CVE-2007-4571
SHA-256 | 949399f1ef56b7cf5b001af2d386dd168ad4fea165fb77e0c740cb6214ea3165

iDEFENSE Security Advisory 2007-09-25.1

Change Mirror Download
Linux Kernel ALSA snd_mem_proc_read Information Disclosure Vulnerability

iDefense Security Advisory 09.25.07
http://labs.idefense.com/intelligence/vulnerabilities/
Sep 25, 2007

I. BACKGROUND

Linux is a clone of the UNIX operating system, written from scratch by
Linus Torvalds with assistance from a loosely-knit team of hackers
across the Internet. The Advanced Linux Sound Architecture (ALSA)
project provides audio device support for Linux systems. More
information can be found at the URLs shown below.

http://kernel.org/

http://www.alsa-project.org/main/index.php/Main_Page

II. DESCRIPTION

Local exploitation of an information disclosure vulnerability within the
ALSA driver included in the Linux Kernel allows attackers to obtain
sensitive information from kernel memory.

The problem lies within the handling of multiple reads from the
"/proc/driver/snd-page-alloc" file. The kernel side function that
handles the read system call, "snd_mem_proc_read", is defined in
sound/core/memalloc.c as shown below.

484 static int snd_mem_proc_read(char *page, char **start, off_t off,
485 int count, int *eof, void *data)
486 {
487 int len = 0;
...
494 len += snprintf(page + len, count - len,
495 "pages : %li bytes (%li pages per %likB)\n",
496 pages * PAGE_SIZE, pages, PAGE_SIZE / 1024);
...
508 return len;
509 }

On line 494, snprintf is called to generate the output for the proc file
system entry. By supplying a count value of 1, snprintf will only write
a single byte to the destination buffer. However, the function will
return the number of bytes that would have been written if enough space
were available. The "*eof" value is never set, and the "*ppos" value is
never used.

This function is called from "proc_file_read" function, which is defined
in fs/proc/generic.c.

51 static ssize_t
52 proc_file_read(struct file *file, char __user *buf, size_t nbytes,
53 loff_t *ppos)
54 {
...
136 n = dp->read_proc(page, &start, *ppos,
137 count, &eof, dp->data);
...
155 n -= *ppos;
156 if (n <= 0)
157 break;
158 if (n > count)
159 n = count;
160 start = page + *ppos;
...
186 n -= copy_to_user(buf, start < page ? page :
start, n);
...
193 *ppos += start < page ? (unsigned long)start : n;

The value "n" is returned from the call to the snd_proc_mem_read
function on line 136. Since the value returned, approximately 41 in
single device scenarios, is greater than the requested read size (1),
the value "n" is set to "count" on line 158. Later, "*ppos" is
incremented and "n" bytes are copied to user-land from "start" (which
is calculated as "page" + *ppos).

In subsequent user-land read operations, when "*ppos" is greater than
zero, the proc_file_read function will copy from beyond the part of the
page that snd_mem_proc_read wrote. This results in the disclosure of
kernel memory.

III. ANALYSIS

Exploitation of this vulnerability allows attackers to obtain sensitive
information from kernel memory.

In order to exploit this vulnerability, an attacker would need access to
open the /proc/driver/snd-page-alloc file. It is important to note that
this file does not exist unless an audio device is present.

Additionally, the Linux kernel must be built with ALSA support as well
as support for the proc file system. The kernels for the majority of
common Linux distributions are built with these options.

Since memory is only disclosed from the beginning of an uninitialized
page, it may not be possible to obtain certain types of information.
However, the ability to obtain the password hash for the root account
was confirmed during iDefense Labs testing.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in version
2.6.22.1 of the Linux Kernel as installed with Fedora CORE 7. It is
suspected that other versions are also vulnerable.

V. WORKAROUND

The following workarounds will prevent exploitation of this
vulnerability.

* If the ALSA drivers have been built as modules, unload the
snd_page_alloc module.
* Restrict access to the /proc file system by modifying the mount
parameters within /etc/fstab

VI. VENDOR RESPONSE

The Linux Kernel maintainers have addressed this vulnerability within
version 2.6.22.8. More information can be found from the URLs shown
below.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ccec6e2c4a74adf76ed4e2478091a311b1806212

http://kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.22.8

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CVE-2007-4571 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org/), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

09/12/2007 Initial vendor notification
09/12/2007 Initial vendor response
09/25/2007 Coordinated public disclosure

IX. CREDIT

This vulnerability was reported to iDefense by Neil Kettle (mu-b) of
www.digit-labs.org.

Get paid for vulnerability research
http://labs.idefense.com/methodology/vulnerability/vcp.php

Free tools, research and upcoming events
http://labs.idefense.com/

X. LEGAL NOTICES

Copyright © 2007 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically,
please e-mail customerservice@idefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct,
indirect, or consequential loss or damage arising from use of, or
reliance on, this information.
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    17 Files
  • 21
    May 21st
    18 Files
  • 22
    May 22nd
    7 Files
  • 23
    May 23rd
    111 Files
  • 24
    May 24th
    27 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close