Skip navigation.
Home
The QNX Community Portal

View topic - QNX Page Access Permissions

QNX Page Access Permissions

anything that doesn't fit to other groups.

QNX Page Access Permissions

Postby dimaggios » Mon May 12, 2014 9:32 am

Hey all,

I'm very new to QNX programming (actually BB10 programming), so this may sound stupid.
I'm currently tackling a bug and thus looking forward some kind of a techinque that, given an address, will provide me with its access permissions (r/w/x) -
similarly to WinDBG's !address or Windows' VirtualQuery().

Unfortunately, ntoarm-gdb is lacking "maintenance info sections".
Any other ideas?

Thanks in advance!
Sue.
dimaggios
New Member
 
Posts: 4
Joined: Thu May 08, 2014 7:43 am

Re: QNX Page Access Permissions

Postby maschoen » Mon May 12, 2014 1:41 pm

To start with, I don't think there is such a function, but I can't think of a reason you would need it.

If the address is in the code segment, then you have read and execute permission.
If the address is in the data or stack segment, you have read and write permission.
If the address is in an unpopulated page, you have no permissions.

If you don't know which of these applies, you are probably not do something legitimate.

I should add that given super user access in a QNX process you can do a little more, but in the BB10 environment, you are more constrained.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: QNX Page Access Permissions

Postby dimaggios » Mon May 12, 2014 4:10 pm

What about JIT-featured applications?
I'm sure BB10 has some, and as far as I understand they require a r/w/x memory environment.
Where would it be located, then?

Thanks for your reply.
dimaggios
New Member
 
Posts: 4
Joined: Thu May 08, 2014 7:43 am

Re: QNX Page Access Permissions

Postby maschoen » Mon May 12, 2014 6:11 pm

If you are running a native QNX application, it is possible to control the r/w/x permissions of a segment. But BB10 at the application level does not give you that ability. It's like IOS where you are running in a sandbox.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: QNX Page Access Permissions

Postby dimaggios » Tue May 13, 2014 8:52 am

Perhaps I haven't made myself clear, so I'll rephrase:

I'm not looking for a way to control access permissions at an application level (e.g. VirtualProtect(), mprotect() etc.).
I'm looking for a way to tell which access permissions a given address in some process has (for example, when debugging it with ntoarm-gdb).

Examples from other platforms include WinDBG's !address and GDB/Linux's "maintenance info sections".
Is there anything I could do to mimic that functionality?

Thanks again!
dimaggios
New Member
 
Posts: 4
Joined: Thu May 08, 2014 7:43 am

Re: QNX Page Access Permissions

Postby maschoen » Wed May 14, 2014 1:37 am

I don't think that the debugger has that functionality, nor do I understand why you would need it.
If you can get a map from the linker, you will know the addresses of the code and the addresses of the data segments. The code segments are read/execute and the data segments are read-write. That leaves the stack which is read-write to the extent that it is usable. Beyond that is a page with no rights in order to allow the OS to dynamically insert real memory and grow the stack dynamically.

I don't know why you would want to know the permissions on some random address. Do you think it will help you in debugging some how?
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron