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

dragonflybsd-firewire.txt

dragonflybsd-firewire.txt
Posted Nov 16, 2006
Authored by Rodrigo Rubira Branco | Site kernelhacking.com

The Firewire device enabled by default in the GENERIC kernel for DragonFlyBSD defines an IOCTL function which can be malicious called passing a negative buffer length value. This value will bypass the length check (because the value is negative) and will be used in a copyout operation. This is a kernel bug and the system can be compromised by local users and important system information can be disclosed.

tags | advisory, kernel, local
SHA-256 | 544872d3cf1474aa8017d59d4555b331e3d8e6bc6286478e935ee38627971745

dragonflybsd-firewire.txt

Change Mirror Download
DragonFlyBSD all versions FireWire IOCTL kernel integer overflow information disclousure
11/15/2006

Notice
===================
This bug has been specially discovered for the Month of Kernel Bugs and to
the Hackers to Hackers Conference III (http://www.h2hc.org.br/en/).


Summary
===================

Firewire device is enabled by default in the GENERIC kernel. It defines
an IOCTL function which can be malicious called passing a negative buffer
lenght value. This value will bypass the lenght check (because the value
is negative) and will be used in a copyout operation.

Systems Affected
===================

FreeBSD all versions
NetBSD all versions
DragonFly all versions
TrustedBSD* all versions

Impact
===================

This is a kernel bug and the system can be compromised by local users and
important system informations can be discloused (basically, a mem dump ;) )

Explanation
===================

Firewire interface can be tunned. It provides an ioctl function receiving
many parameters that can be changed.

The follow is a code fragment from (FreeBSD - dev/firewire/fwdev.c (fw_ioctl function) || DragonFlyBSD bus/firewire/fwdev.c (fw_ioctl function) || NetBSD - dev/ieee1394/fwdev.c (FW_IOCTL function)) file:

if (crom_buf->len < len)
len = crom_buf->len;
else
crom_buf->len = len;

err = copyout(ptr, crom_buf->ptr, len);

We control the crom_buf->len (it's passed as argument to the ioctl function)
so, passing it as a negative value will bypass this if statement (our value
is minor than the default one).

So, our value is used in a copyout function. ptr is defined before this
copyout as:
if ( fwdev == NULL ) {
...
ptr = malloc(CROMSIZE, M_FW, M_WAITOK);
...
} else {
ptr = (void *)&fwdev->csrrom[0];
...
}

This information disclousure lead an attacker dump all the system memory.

Solution
===================

Attached in this advisory a patch for the FreeBSD 5.5 (it's pretty simple, so, just need to be little changed to the other BSD's)

Timelife
===================

11/15/2006 - Advisory Public Disclousure (sorry for the developers, but we
are just respecting the Month of Kernel Bugs Timelife)

Acknowledgments
===================

Filipe Balestra <filipe@balestra.com.br> and Rodrigo Rubira Branco
(BSDaemon) <rodrigo@kernelhacking.com> for the discovering, analysis
and patch.

Contact Information
===================

You can reach the authors of this advisory by mail or visiting some
websites:
http://www.balestra.com.br -> Personal Website of Filipe
http://www.risesecurity.org -> RISE Security Research (Rodrigo is member of the RISE Security Team)
http://www.kernelhacking.com/rodrigo -> Personal Website of Rodrigo

References
===================

http://www.kernelhacking.com/bsdadv1.txt -> Actual version of the advisory
http://www.risesecurity.org/RISE-2006002.txt -> Related issue

Disclaimer (taken from teso-team)
===================

This advisory does not claim to be complete or to be usable for any
purpose. Especially information on the vulnerable systems may be
inaccurate or wrong. The supplied exploit is not to be used for malicious
purposes, but for educational purposes only.

This advisory is free for open distribution in unmodified form.
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    47 Files
  • 25
    Jul 25th
    31 Files
  • 26
    Jul 26th
    13 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    27 Files
  • 30
    Jul 30th
    49 Files
  • 31
    Jul 31st
    29 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