Proc filesystem information

I found that each /proc/PID/ directory has a “as” file.
Though Its’ permission is readable, I can’t read it.
Actually I can open a “as” file, but it doesn’t show anything though its’
size is not zero.

What information does it have?
And How can I access those files to get some information about proceses?

It seems that there are some differences between QNX and Linux Proc
filesystem.
Where can I get information about QNX Proc filesystem?

Thanks.

redcloak <redcloak@rtsolutions.co.kr> wrote:

I found that each /proc/PID/ directory has a “as” file.
Though Its’ permission is readable, I can’t read it.
Actually I can open a “as” file, but it doesn’t show anything though its’
size is not zero.

What information does it have?

It represents the address space of the process.

And How can I access those files to get some information about proceses?

lseek() to a memory location that is valid in the process, then you
can read from that memory.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs <dagibbs@qnx.com> wrote:
DG > redcloak <redcloak@rtsolutions.co.kr> wrote:

I found that each /proc/PID/ directory has a “as” file.
Though Its’ permission is readable, I can’t read it.
Actually I can open a “as” file, but it doesn’t show anything though its’
size is not zero.

What information does it have?

DG > It represents the address space of the process.

And How can I access those files to get some information about proceses?

DG > lseek() to a memory location that is valid in the process, then you
DG > can read from that memory.

DG > -David
DG > –
DG > QNX Training Services
DG > http://www.qnx.com/support/training/
DG > Please followup in this newsgroup if you have further questions.

This is cool. But isn’t it a security hole?

Bill Caroselli <qtps@earthlink.net> wrote:

DG > It represents the address space of the process.

And How can I access those files to get some information about proceses?

DG > lseek() to a memory location that is valid in the process, then you
DG > can read from that memory.

DG > -David
DG > –
DG > QNX Training Services
DG > > http://www.qnx.com/support/training/
DG > Please followup in this newsgroup if you have further questions.

This is cool. But isn’t it a security hole?

Sure, kind of like qnx_debug_xfer().

Or, maybe, “gdb pid”. (wd pid)

And, I think they are root:root 0644

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Hello, David!

DG> And, I think they are root:root 0644

Maybe 0640 would be better ?

With best regards, Mike Gorchak. E-mail: mike@malva.com.ua

Mike Gorchak <mike@malva.com.ua> wrote:
MG > Hello, David!

DG>> And, I think they are root:root 0644

MG > Maybe 0640 would be better ?

MG > With best regards, Mike Gorchak. E-mail: mike@malva.com.ua

I would agree.

Hey Mike, where is the “.ua” domain in your e-mail? I haven’t seen
that before.

Mike Gorchak <mike@malva.com.ua> wrote:

Hello, David!

DG> And, I think they are root:root 0644

Maybe 0640 would be better ?

Maybe, but it would make this only usable by root.

What would be best would be to check the uid of the reading
process against the uid of the process whose memory you are
trying to read from /proc/pid/as and verify based on that.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

In article <b89bls$jgk$2@inn.qnx.com>, qtps@earthlink.net says…

Hey Mike, where is the “.ua” domain in your e-mail? I haven’t seen
that before.

…ua? It’s Ukraine. Malva JSC (malva.com.ua) is in Kiev > :slight_smile:

Eduard.

t
“ed1k” <ed1k@humber.bay> wrote in message
news:MPG.19125c47840a392c9896be@inn.qnx.com

In article <b89bls$jgk$> 2@inn.qnx.com> >, > qtps@earthlink.net > says…
Hey Mike, where is the “.ua” domain in your e-mail? I haven’t seen
that before.

.ua? It’s Ukraine. Malva JSC (malva.com.ua) is in Kiev > :slight_smile:
Eduard.

t
“ed1k” <ed1k@humber.bay> wrote in message
news:MPG.19125c47840a392c9896be@inn.qnx.com

In article <b89bls$jgk$> 2@inn.qnx.com> >, > qtps@earthlink.net > says…
Hey Mike, where is the “.ua” domain in your e-mail? I haven’t seen
that before.

.ua? It’s Ukraine. Malva JSC (malva.com.ua) is in Kiev > :slight_smile:
Eduard.

t
“Yuriy Synytskyy” <ysynytskyy@mds.nordion.com> wrote in message
news:bgr4qi$io1$1@inn.qnx.com

t
“ed1k” <> ed1k@humber.bay> > wrote in message
news:> MPG.19125c47840a392c9896be@inn.qnx.com> …
In article <b89bls$jgk$> 2@inn.qnx.com> >, > qtps@earthlink.net > says…
Hey Mike, where is the “.ua” domain in your e-mail? I haven’t seen
that before.

.ua? It’s Ukraine. Malva JSC (malva.com.ua) is in Kiev > :slight_smile:
Eduard.