9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Race condition in /sys/src/9/pc/trap.c?
Date: Thu, 30 Jul 2009 11:20:06 -0400	[thread overview]
Message-ID: <e646cf66efc2961e107eeecce085ec2b@quanstro.net> (raw)
In-Reply-To: <a77443fd0762504eb1179278b34d0351@plan9.cs.bell-labs.com>

> I think you may be right, Elly.  Multithreaded programs indeed have their
> stack running outside the stack segment, so this could happen there.
> splhi won't even do on a multiprocessor.  One should probably lock down
> the segment.
> We've never seen this happen, of course — or rather, we haven't noticed
> this as the cause of a crash.

just to beat a dead horse, i disabled the check in question
and ran the following program with an invalid address.
the program faulted and the kernel did not care.

; cat evil.c
#include <u.h>
#include <libc.h>

extern void evil(void);

void
main(void)
{
	evil();
	exits("");
}
; cat evil.s
TEXT evil(SB), $0
	PUSHL	SP
	MOVL	$0xa0000000, SP
	MOVL	$1, AX
	INT	$64
	POPL	SP
	RET
% 8.out
8.out 78: suicide: invalid address 0xa0000000/24 in sys call pc=0x1046

- erik



  parent reply	other threads:[~2009-07-30 15:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  4:03 Matthew J Jones
2009-07-30 11:27 ` erik quanstrom
2009-07-30 14:25   ` Elizabeth Jones
2009-07-30 14:37     ` Sape Mullender
2009-07-30 15:01       ` cinap_lenrek
2009-07-30 15:24         ` cinap_lenrek
2009-07-30 15:17       ` cinap_lenrek
2009-07-30 15:54         ` Charles Forsyth
2009-07-31 13:07           ` Charles Forsyth
2009-07-31 13:28             ` Richard Miller
2009-07-31 17:13             ` cinap_lenrek
2009-07-31 18:00               ` erik quanstrom
2009-07-31 18:08                 ` Devon H. O'Dell
2009-07-31 18:18                   ` erik quanstrom
2009-07-31 18:35                     ` Devon H. O'Dell
2009-07-31 21:52                 ` cinap_lenrek
2009-07-31 19:31               ` Charles Forsyth
2009-07-31 19:40                 ` erik quanstrom
2009-07-31 20:41                   ` Charles Forsyth
2009-07-30 15:20       ` erik quanstrom [this message]
2009-07-30 14:39     ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e646cf66efc2961e107eeecce085ec2b@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).