Project

General

Profile

Bug #6457

ucopystr can't find its way home

Added by Robert Mustacchi about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
2015-11-16
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:

Description

The amd64 version of the ucopystr routine can end up causing an 8-byte stack entry to be lost and result in a rather confused system. The problem is that ucopystr ends up doing a jmp to do_copystr, from which it returns from. do_copystr is part of copystr. copystr pushes on a frame pointer; however, ucopystr does not. This means that when we end up leaving do_copystr we do a leave and a ret.

Because ucopystr does not push on a frame pointer, that results in the leave from do_copystr losing the return address and returning to something else entirely.

#1

Updated by Electric Monk about 5 years ago

  • Status changed from New to Closed

git commit cbff3abd8ecaa7b8e6a47457e0a5e562dbfc2cad

commit  cbff3abd8ecaa7b8e6a47457e0a5e562dbfc2cad
Author: Robert Mustacchi <rm@joyent.com>
Date:   2015-11-30T18:47:57.000Z

    6457 ucopystr can't find its way home
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF