20761 : NetBSD Kernel sys_semop() Function Local Overflow
Printer | http://osvdb.org/20761 | Email This | Edit Vulnerability

Views This Week

1

Views All Time

46

Info

Last Modified

10 months ago

Percent Complete

100%

Disclosure

Sep 06, 2001

Discovery

Unknown

Dates

Exploit

Unknown

Solution

Unknown

Description

A local overflow exists in NetBSD as a result of sys_semop() function mismatched data types. With a specially crafted request, an attacker can cause a denial of service and/or execute arbitrary code, resulting in a loss of integrity, and/or availability.

Classification

Location: Local Access Required
Attack Type: Denial of Service, Input Manipulation
Impact: Loss of Integrity, Loss of Availability
Exploit: Exploit Unavailable
Disclosure: OSVDB Verified

Technical

The kernel function sys_semop provides a number of atomic operations (operations that are not interrupted and must all occur at once) on a set of semaphores. Semaphores are protected variables used to restrict access to shared resources. The semaphore set has sops, which is an array of semaphore operations, and it also has nsops, which is the number of operations in this array.

A malicious user can pass a value for nsops that is greater than INT_MAX, causing nsops to flip negative (because it is a signed integer) and pass the existing check on bounds. The value is then used in the copyin() function, which copies data from user memory to a local array on the process's kernel stack. Since the number of bytes to copyin is computed as 'nsops * sizeof(struct sembuf)', this can be used to copy an almost arbitrary number of bytes from userland to the caller process's kernel stack.

Solution

Upgrade to version 1.5.2 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

Products

NetBSD Foundation, Inc.
Watch-list
NetBSD
Watch-list
1.4
1.5
1.5.1
1.4.x

References

Credit

  • Jaromir Dolecek - jdolecekBrand New Doo Doonetbsd.org -
  • Christos Zoulas -

Blogs

None found at this time

Comments

No Comments.

DONATE NOW!

User Status

Quick Searches

Advertisements

The database information may change without any notice. Use of the information constitutes acceptance for use in an AS IS condition, and there are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. In no event shall the copyright holder or distributor (OSVDB or OSF) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.

© Copyright 2008 Open Source Vulnerability Database (OSVDB), All Rights Reserved.
Privacy Statement - Terms of Use