Skip to content

dtrace: failed to grab pid ?!

December 17, 2012

There seems to be a reasonable security feature in Solaris that limits usage of diagnostics tools based on privileges(5) of source and target PIDs. Saying that, tools  such as dtrace(1M) and pstack(1) should have equal or more privileges(5) than the target PID they want to observe. Otherwise the process owner can use the target PID to run instrumented instructions with higher privileges which is obviously a security hole.

But this fair statement can cause some headache especially when processes start from sources other than a shell such as SMF.

Let’s examine this scenario. What prevents the owner of this process to look inside even after setting all dtrace permissions to zone and user.

What’s up? The reason is hiding somewhere in the SMF service manifest. Let’s have a look:

Looking at the PID of the service we notice it has extra sys_resource privilege assigned via SMF that we don’t have in our bash PID ($$).

That’s preventing bash PID to access SMF started service PID although they are owned by the same user. So what is this extra privilege?

That’s a necessary  for this service. So have to add the missing to the user:

Next time bash has sys_resource privilege and executes dtrace/pstack against SMF service successfully:


From → dtrace, solaris

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: