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

NetBSD-SA1999-012.vax.ptrace

NetBSD-SA1999-012.vax.ptrace
Posted Sep 23, 1999

NetBSD uses the ptrace(2) system call to trace and debug other processes. The debugging process can also modify the internal registers, including the status (PSL) register, for the process being debugged. Besides the normal user-accessible flags, the VAX hardware also stores information about privilege levels and used stacks in the PSL. Those flags are only altered via the instruction REI (return from interrupt) or LDPCTX (load process context) and cannot be modified while running in "user" mode. NetBSD security page here.

systems | netbsd, vax
SHA-256 | a2eae820bbf7e17d7b14c389412aaa0a20c9afbfb8e698cf5ca9f30212b728e8

NetBSD-SA1999-012.vax.ptrace

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----

NetBSD Security Advisory 1999-012
=================================

Topic: ptrace(2)'d processes can gain "kernel" privileges on vax.
Version: NetBSD/vax 1.4.1 and earlier; -current prior to 19991212
Severity: Theoretical problem only, no known exploits


Abstract
========

As part of an ongoing effort to construct a secure kernel and application
environment, the NetBSD project has identified and corrected a possible
security issue.

A wrapper program can be constructed by a local user that can modify the
hardware privileges of a ptrace(2)'d process.

It might be possible to write a security-related exploit via this mechanism.


Technical Details
=================

NetBSD uses the ptrace(2) system call to trace and debug other processes.
The debugging process can also modify the internal registers, including
the status (PSL) register, for the process being debugged.

Besides the normal user-accessible flags, the VAX hardware also stores
information about privilege levels and used stacks in the PSL. Those
flags are only altered via the instruction REI (return from interrupt)
or LDPCTX (load process context) and cannot be modified while running
in "user" mode.

When the PSL contents are altered by the debugging process, the debugged
process is in the kernel, and will get the privileges defined by the
PSL when it REI to userspace to continue execution.

Solutions and Workarounds
=========================

Upgrade to NetBSD-current, or apply the following patch to 1.4.1:

Index: machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/vax/vax/machdep.c,v
retrieving revision 1.76.2.1
diff -c -r1.76.2.1 machdep.c
*** machdep.c 1999/04/16 16:26:01 1.76.2.1
- --- machdep.c 1999/12/12 11:08:46
***************
*** 770,776 ****
tf->fp = regs->fp;
tf->sp = regs->sp;
tf->pc = regs->pc;
! tf->psl = regs->psl;
return 0;
}

- --- 770,777 ----
tf->fp = regs->fp;
tf->sp = regs->sp;
tf->pc = regs->pc;
! tf->psl = (regs->psl|PSL_U|PSL_PREVU) &
! ~(PSL_MBZ|PSL_IS|PSL_IPL1F|PSL_CM); /* Allow compat mode? */
return 0;
}



Thanks To
=========

Discovery of the problem by Klaus Klein (kleink@netbsd.org)


Revision History
================

1999/12/12 - initial version


More Information
================

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.ORG/ and http://www.NetBSD.ORG/Security/.


Copyright 1999, The NetBSD Foundation, Inc. All Rights Reserved.

$NetBSD: NetBSD-SA1999-012.txt,v 1.3 2000/02/15 13:33:47 dan Exp $

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBOKlXcD5Ru2/4N2IFAQEvPAP+IXJ+48+eC/iDXTDXTG4QLNsqBZT4QRki
Y6DI7j0NqioiEvuJScW54dVpL0rUOd7XJH5bI27q2XEBy2J9furOwjFDb3Y4gpoU
4GWyQyw1oCd3tGecfUETlFtBdPNM6qVObEeKeQr87kbUsugSZUW+RuY4OA6Lywf7
rTMlmyoYuss=
=xqwx
-----END PGP SIGNATURE-----

Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close