Re: [PATCH] parisc: Fix syscall restarts (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2015-12-24 11:07 AM, Mathieu Desnoyers wrote:
Is it valid to have unaligned instructions ? Does the architecture
>>allow it, or it's a fumble and we should pr_warn ?
>
>How can it be unaligned? It's about u32...
That would be an instruction that is volountarily offset
from 1, 2, 3 bytes from 4-bytes multiples by the application.
The only situation where I have seen this is in cases where
applications are trying to play games with the debugger or
disassembler and hide what they are doing: they can offset
the start of a function like this, and therefore all the
instructions within that function.

This is not possible on PA-RISC. Indeed, user instruction addresses are always offset by three. There is no way to branch to an instruction that is offset.

The least significant two bits of an instruction address contain a priority level. User code on linux and hpux executes at level 3. The only way a user can change privilege level is with a "gate" instruction (a special branch). Whether this is permitted or not depends on page table permissions that the user can't change.
In practice, a level change is only allowed on the gateway page.

Dave

--
John David Anglin  dave.anglin@xxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux