flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > why use another stack when calling higher ring Goto page 1, 2 Next |
Author |
|
revolution 20 Feb 2015, 01:36
The x86 has one stack register per ring. The hardware enforces this.
This has the advantage of not destroying the user level stack. And it doesn't leak system information into a lower privileged task. Any OS that wants to support task isolation will require such a feature. |
|||
20 Feb 2015, 01:36 |
|
l4m2 20 Feb 2015, 02:35
revolution wrote: The x86 has one stack register per ring. The hardware enforces this. |
|||
20 Feb 2015, 02:35 |
|
revolution 20 Feb 2015, 02:43
You can't rely on user software to properly setup system stacks for each call. It wouldn't be secure, it wouldn't be reliable and malware writers would be very happy.
|
|||
20 Feb 2015, 02:43 |
|
l4m2 20 Feb 2015, 05:28
revolution wrote: You can't rely on user software to properly setup system stacks for each call. It wouldn't be secure, it wouldn't be reliable and malware writers would be very happy. p.s. acc=a |
|||
20 Feb 2015, 05:28 |
|
revolution 20 Feb 2015, 05:35
Stacks are used for many things, not only registers. And even registers can hold sensitive information. Why risk problems when the hardware solves it for free?
|
|||
20 Feb 2015, 05:35 |
|
l4m2 20 Feb 2015, 07:01
revolution wrote: Stacks are used for many things, not only registers. And even registers can hold sensitive information. Why risk problems when the hardware solves it for free? |
|||
20 Feb 2015, 07:01 |
|
revolution 20 Feb 2015, 07:05
Why are you so flippant about data insecurity?
What if RAX contains the first 8 characters of your password, are you happy to place it on the stack for any process to examine as they wish? |
|||
20 Feb 2015, 07:05 |
|
l4m2 20 Feb 2015, 11:00
revolution wrote: Why are you so flippant about data insecurity? |
|||
20 Feb 2015, 11:00 |
|
revolution 20 Feb 2015, 11:32
A user process can't access the system stacks or other user process stacks. So a normal app can't see data from other apps. i.e. your spreadsheet program can't see your email password. And your email program can't see your spreadsheet tax data.
|
|||
20 Feb 2015, 11:32 |
|
l4m2 20 Feb 2015, 11:42
revolution wrote: A user process can't access the system stacks or other user process stacks. So a normal app can't see data from other apps. i.e. your spreadsheet program can't see your email password. And your email program can't see your spreadsheet tax data. |
|||
20 Feb 2015, 11:42 |
|
revolution 20 Feb 2015, 12:48
If the system used the user stack then the user process could watch the stack and see information left on the stack by the system interrupts. You could watch for the keyboard interrupts and probably make a keylogger quite easily.
|
|||
20 Feb 2015, 12:48 |
|
l4m2 20 Feb 2015, 12:53
revolution wrote: If the system used the user stack then the user process could watch the stack and see information left on the stack by the system interrupts. You could watch for the keyboard interrupts and probably make a keylogger quite easily. |
|||
20 Feb 2015, 12:53 |
|
revolution 20 Feb 2015, 12:57
In a protected OS a user process cannot read the keyboard directly. This is by design. The process would call the OS to ask if any keys are available, or to ask to wait until a key is pressed, or whatever. But never directly trap interrupts unless it was the system keyboard driver.
If you use DOS then forget about having secure app separation. Everything just does whatever it wants; and that includes crashing the whole system, spying on the user, exfiltrating data to a port, etc. |
|||
20 Feb 2015, 12:57 |
|
l4m2 20 Feb 2015, 12:59
revolution wrote: In a protected OS a user process cannot read the keyboard directly. This is by design. The process would call the OS to ask if any keys are available, or to ask to wait until a key is pressed, or whatever. But never directly trap interrupts unless it was the system keyboard driver. Use the 1st floor to make an example(Of course, don't try to get @x0 directly, for x51 has no <segment>), will you? |
|||
20 Feb 2015, 12:59 |
|
revolution 20 Feb 2015, 14:23
An example of what?
|
|||
20 Feb 2015, 14:23 |
|
l4m2 20 Feb 2015, 15:01
revolution wrote: An example of what? |
|||
20 Feb 2015, 15:01 |
|
revolution 20 Feb 2015, 15:07
In DOS it is easy, just scan the memory. Or watch the stack.
In a protected mode OS I can't give an example because if it is done correctly you can't see another processes data. That is the whole point; to not leak data. |
|||
20 Feb 2015, 15:07 |
|
l4m2 20 Feb 2015, 15:52
revolution wrote: In DOS it is easy, just scan the memory. Or watch the stack. |
|||
20 Feb 2015, 15:52 |
|
baldr 20 Feb 2015, 20:40
l4m2,
CPL, DPL, RPL and paging. Do you need more of human language? |
|||
20 Feb 2015, 20:40 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.