J-Security Center

Title: NetBSD semop Arbitrary Code Execution Vulnerability

Severity: HIGH

Description:

An input validation error exists in the NetBSD kernel that may result in a denial of service or the user execution of arbitrary code with elevated privileges.

The problem is due to insufficient length checking on a parameter passed to the semop() function, which acts as the entry point for the semop syscall. The function stores an unsigned integer argument 'nsops' in a local signed variable. This value is then used to copy data from user memory onto the process' kernel stack. The vulnerability exists because it is possible to bypass the check used to ensure that a sane value is given. This can be be accomplished by passing a large numeric value and causing a signed integer overflow.

This vulnerability can be used to write an almost arbitrary number of bytes to the process' kernel stack. It could be exploited to cause a kernel trap, call arbitrary kernel code, or execute arbitrary code on an architecture where stack memory is executable.

Affected Products:

  • NetBSD NetBSD 1.4.0
  • NetBSD NetBSD 1.4.1
  • NetBSD NetBSD 1.4.2
  • NetBSD NetBSD 1.4.3
  • NetBSD NetBSD 1.5.0
  • NetBSD NetBSD 1.5.1
  • NetBSD NetBSD current pre20010805

References:

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.