Ah, thanks!
I was under wrong impression that the restriction only allowed proces
X to read
/proc/X/environ (esentially allowing only
/proc/self/environ), and not that any process can read
/proc/X/environ, provided it is the same process that opened the file!
And the usage case is actually quite simple; the code in question executes shell helper which does (among other things) something like:
- Code: Select all
tr '\000' '\n' < /proc/12659/environ
so, it was the shell that opens the
/proc/*/environ, but the tr(1) that reads from it!
I've replaced it with:
- Code: Select all
cat /proc/12659/environ | tr '\000' '\n'
and so it should work now (as only
cat(1) would both open and read from it).
As additional bonus, I finally have excuse for beating down "the useless use of cat award" - it is not ALWAYS useless if one is using grsecurity :-)